The Artima Developer Community
Sponsored Link

.NET Buzz Forum
PrimalCode IDE and Python

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Sam Gentile

Posts: 1605
Nickname: managedcod
Registered: Sep, 2003

Sam Gentile is a Microsoft .NET Consultant who has been working with .NET since the earliest
PrimalCode IDE and Python Posted: Jan 9, 2005 4:19 PM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Sam Gentile.
Original Post: PrimalCode IDE and Python
Feed Title: Sam Gentile's Blog
Feed URL: http://samgentile.com/blog/Rss.aspx
Feed Description: .NET and Software Development from an experienced perspective - .NET/CLR, Rotor, Interop, MC+/C++, COM+, ES, Mac OS X, Extreme Programming and More!
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Sam Gentile
Latest Posts From Sam Gentile's Blog

Advertisement

After coming home from work today, I had a copy of PrimalCode lying around as an alternative UI for .NET so I installed it. As I installed it, I found that it was an editor for many “scripting languages” of which Python was one. So while I was at it, I thought I would try Mark's first program in Dive Into Python, an odbchelper function. This isn't going to be a deep post on Python and instead has to do with, egad, an IDE or two (and “IntelliSense“,) sacrilege!!, so the Python heads can stop reading now and go back to command line, vi, Emacs or whatever they are doing. For the rest of us, having had incredible language IntelliSense support in the VS IDE, I was more interested in seeing what this IDE would give me in language support. The bad news is that all I seemed to get what syntax coloring (oh boy!) but going over to ActiveState's ActivePython IDE gave me full “IntelliSense” and provided a much better experience in terms of direct integration with the Python runtime in an interactive window which also had IntelliSense. So it looks like ActivePython may be the best so far in terms of learning the language, at least in a way us Microsoft types are used to. The first program (which I didn't bother modifying for my use) follows:

def buildConnectionString(params)
    """Build a connection string from a dictionary of parameters
   
    Returns string."""
    return ";".join(["%s=%s" % (k,v) for k, v in params.items()])
   
if __name__ == "__main__";
    myParams = {"server":"mpilgrim", \
                "database":"master", \
                "uid":"sa", \
                "pwd":"secret" \
                }
    print buildConnectionString(myParams)

The Python doc feature is cool:

>>> import odbchelper
>>> params = {"server":"mpilgrim", "database":"master", "uid":"sa",
... "pwd":"secret"}
>>> print odbchelper.buildConnection(params)
pwd=secret;database=master;uid=sa;server=mpilgrim
>>> print odbchelper.buildConnection.func_doc
Build a connection string from a dictionary of parameters.

Read: PrimalCode IDE and Python

Topic: Framework vs Tool Previous Topic   Next Topic Topic: Captcha to Remove Comment SPAM for .Text

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use