Re: [Tutor] this module

2009-08-08 Thread Mark Young
Thanks everybody, I didn't know modules ran code when you imported them, I just thought they defined the functions, etc. in them. Thanks for the info. I'm going to go look at the module's code now that I know where it's at. Mark Young ___ Tutor maillist

Re: [Tutor] droplet like behaviour in Python

2009-08-08 Thread Alan Gauld
"pedro" wrote is one thing I am not really sure how to do. I want to be able to drop a file onto a python script (or app I guess) and have the python script use the path to the file that was dropped on it as sys.argv[1] I may be wrong but I thought that, provided you had the path and sh

[Tutor] droplet like behaviour in Python

2009-08-08 Thread pedro
Hi I am porting some of my code over from Applescript to Python. There is one thing I am not really sure how to do. I want to be able to drop a file onto a python script (or app I guess) and have the python script use the path to the file that was dropped on it as sys.argv[1] In applescript it

Re: [Tutor] building database with sqlite3 and matplotlib

2009-08-08 Thread David Kim
Thanks so much for the comments! I appreciate the look. It's hard to know what the best practices are (or if they even exist). On Sat, Aug 8, 2009 at 2:28 PM, Kent Johnson wrote: > > You don't seem to actually have a main(). Are you running this by importing > it? > > I would make a separate func

Re: [Tutor] How to Split a String

2009-08-08 Thread Kent Johnson
On Sat, Aug 8, 2009 at 2:33 PM, Paras K. wrote: > What I am trying to do is find the mail folder for our lotus notes files. > > I get it by doing the following: > > lotusnotesmaildir = glob.glob('C:\Documents and Settings/pkinariwala/Local > Settings/Application Data/lotus/notes/data/'+'*mail*/') >

Re: [Tutor] How to Split a String

2009-08-08 Thread Alan Gauld
"Paras K." wrote lotusnotesmaildir = glob.glob('C:\Documents and Settings/pkinariwala/Local Settings/Application Data/lotus/notes/data/'+'*mail*/') You don't need the plus. lotusnotesmaildir = glob.glob('C:\Documents and Settings/pkinariwala/Local Settings/Application Data/lotus/notes/data

[Tutor] How to Split a String

2009-08-08 Thread Paras K.
What I am trying to do is find the mail folder for our lotus notes files. I get it by doing the following: lotusnotesmaildir = glob.glob('C:\Documents and Settings/pkinariwala/Local Settings/Application Data/lotus/notes/data/'+'*mail*/') That returns: ['C:\\Documents and Settings/pkinariwala/Loc

Re: [Tutor] building database with sqlite3 and matplotlib

2009-08-08 Thread Kent Johnson
On Fri, Aug 7, 2009 at 5:35 PM, David Kim wrote: > I've been learning python in a vacuum for the past few months and I > was wondering whether anyone would be willing to take a look at some > code? I've been messing around with sqlite and matplotlib, but I > couldn't get all the string substitutio

Re: [Tutor] Overriding MySQLdb.cursors.DictCursor.execute()

2009-08-08 Thread Tim Johnson
* Kent Johnson [090808 05:06]: > On Fri, Aug 7, 2009 at 10:18 PM, Tim Johnson wrote: > > If you use the two argument form of cursor.execute - passing the > parameter values in a sequence, rather than substituting them yourself > - then you have to worry about injection attacks. The DB-API module

Re: [Tutor] this module

2009-08-08 Thread Dave Angel
Mark Young wrote: Hi, I was reading a tutorial, and it mentioned the "import this" easter egg. I was curious, and looked up the contents of the module, and dscovered that it had attributes c, d, i, and s. I was wondering if anyone had any clue what these attributes were supposed to mean. I think

Re: [Tutor] Overriding MySQLdb.cursors.DictCursor.execute()

2009-08-08 Thread Kent Johnson
On Fri, Aug 7, 2009 at 10:18 PM, Tim Johnson wrote: > Hello: > I am currently using python 2.5 and do a lot of database programming > with MySQLdb. > > I need to tighten up control over queries since I am concerned about > malicious injections. If you use the two argument form of cursor.execute -

Re: [Tutor] this module

2009-08-08 Thread Chris Fuller
Something else to note: you can find any module's location by looking it up in the dictionary sys.modules. For instance: Python 2.4.4 (#2, Oct 22 2008, 19:52:44) [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >

Re: [Tutor] this module

2009-08-08 Thread Alan Gauld
"Mark Young" wrote I was curious, and looked up the contents of the module, and dscovered that it had attributes c, d, i, and s. I was wondering if anyone had any clue what these attributes were supposed to mean. Mostly they are just variables used to construct the message. The values are

Re: [Tutor] this module

2009-08-08 Thread Chris Fuller
On Friday 07 August 2009 21:31, Mark Young wrote: > Hi, I was reading a tutorial, and it mentioned the "import this" easter > egg. I was curious, and looked up the contents of the module, and dscovered > that it had attributes c, d, i, and s. I was wondering if anyone had any > clue what these attr