Re: [Tutor] SQL Datetimes

2005-02-14 Thread Danny Yoo
On Mon, 14 Feb 2005, Bill Kranec wrote: > I'm using Kinterbasdb to access a Firebird database through Python, and > when I retrieve a row with a datetime value, I get a tuple like: > > >>> myCursor.execute( 'SELECT * FROM table' ) > >>> for row in myCursor.fetchall(): > print row > > (

Re: [Tutor] Fwd: Delivery Status Notification (Failure)

2005-02-14 Thread Liam Clarke
I've emailed him about it, I think it's an autodirect somewhere on his end. On Tue, 15 Feb 2005 12:39:15 +0800, Jeffrey Lim <[EMAIL PROTECTED]> wrote: > perhaps it's the same Bob Gailer in this thread here? - > http://mail.python.org/pipermail/tutor/2005-February/035774.html, in > which case you

Re: [Tutor] Fwd: Delivery Status Notification (Failure)

2005-02-14 Thread Jeffrey Lim
perhaps it's the same Bob Gailer in this thread here? - http://mail.python.org/pipermail/tutor/2005-February/035774.html, in which case you should probably not see any such messages anymore. -jf On Mon, 14 Feb 2005 22:06:51 -0500, Jacob S. <[EMAIL PROTECTED]> wrote: > I got one or two, same reci

[Tutor] SQL Datetimes

2005-02-14 Thread Bill Kranec
Hello, I'm using Kinterbasdb to access a Firebird database through Python, and when I retrieve a row with a datetime value, I get a tuple like: >>> myCursor.execute( 'SELECT * FROM table' ) >>> for row in myCursor.fetchall(): print row (, 'value2', 'value3', 'value4', 100) I would lik

Re: [Tutor] newbie OSX module path question

2005-02-14 Thread Max Noel
On Feb 15, 2005, at 02:38, Mike Hall wrote: Ok, I've got it working. The environment.plist file wants a path beginning with /Users, not /Local_HD. So simple! Thanks everyone. Yeah, the system hard drive on Mac OS X (which is seen as "Macintosh HD", or in your case "Local HD" in the Finder) is m

Re: [Tutor] Fwd: Delivery Status Notification (Failure)

2005-02-14 Thread Jacob S.
I got one or two, same recipient... Jacob Anyone else getting these? -- Forwarded message -- From: [EMAIL PROTECTED] <[EMAIL PROTECTED]> Date: Sun, 13 Feb 2005 17:59:35 -0800 Subject: Delivery Status Notification (Failure) To: [EMAIL PROTECTED] This is an automatically generated

Re: [Tutor] Negative IF conditions

2005-02-14 Thread Jacob S.
And now for something only slightly different: education research shows that people process "positives" far more quickly and accurately than "negatives", so for readability I often code like: Well, that depends on whether we're optimists or pessimists... ;-) I probably process negatives alot fas

Re: [Tutor] newbie OSX module path question

2005-02-14 Thread Mike Hall
Ok, I've got it working. The environment.plist file wants a path beginning with /Users, not /Local_HD. So simple! Thanks everyone. On Feb 14, 2005, at 6:26 PM, David Rock wrote: * Mike Hall <[EMAIL PROTECTED]> [2005-02-14 18:22]: Hm, so if I import glob, and then execute this line: print glob.gl

Re: [Tutor] newbie OSX module path question

2005-02-14 Thread David Rock
* Mike Hall <[EMAIL PROTECTED]> [2005-02-14 18:22]: > Hm, so if I import glob, and then execute this line: > > print glob.glob('/Local_HD/Users/mike/Documents/pythonModules/*.py') > > I simply get brackets returned: > > [] > > > ...not sure what this means. Thanks again. It means it didn't fi

Re: [Tutor] newbie OSX module path question

2005-02-14 Thread Mike Hall
Hm, so if I import glob, and then execute this line: print glob.glob('/Local_HD/Users/mike/Documents/pythonModules/*.py') I simply get brackets returned: [] ...not sure what this means. Thanks again. On Feb 14, 2005, at 5:41 PM, Danny Yoo wrote: On Mon, 14 Feb 2005, Mike Hall wrote: Can you show

Re: [Tutor] newbie OSX module path question

2005-02-14 Thread Danny Yoo
On Mon, 14 Feb 2005, Mike Hall wrote: > > Can you show us what your sys.path looks like? Just do a > > cut-and-paste so we can quickly validate it for you. > > Thanks for the response. Here's a paste of what sys.path returns. The > first listing is the path inside of environment.plist: > > ['',

Re: [Tutor] newbie OSX module path question

2005-02-14 Thread Danny Yoo
On Mon, 14 Feb 2005, Mike Hall wrote: > I'm on OS X, and I cannot get Python to import modules I've saved. I > have created the the environment.plist file and appended it with my > desired module path. If I print sys.path from the interpreter, my new > path does indeed show up as the first listi

[Tutor] newbie OSX module path question

2005-02-14 Thread Mike Hall
I'm on OS X, and I cannot get Python to import modules I've saved. I have created the the environment.plist file and appended it with my desired module path. If I print sys.path from the interpreter, my new path does indeed show up as the first listing, yet any attempt at importing modules from

Re: [Tutor] Problems with test cgi script on windows XP/Apache

2005-02-14 Thread Liam Clarke
Hehe, I meant the new one, but yeah... :p On Mon, 14 Feb 2005 22:56:24 +, Max Noel <[EMAIL PROTECTED]> wrote: > > On Feb 14, 2005, at 22:18, Liam Clarke wrote: > > > Windows, she is a woman, and woman are mysterious in their little > > quirks. Unfortunately, you cannot divorce her, for she

Re: [Tutor] Problems with test cgi script on windows XP/Apache

2005-02-14 Thread Max Noel
On Feb 14, 2005, at 22:18, Liam Clarke wrote: Windows, she is a woman, and woman are mysterious in their little quirks. Unfortunately, you cannot divorce her, for she controls your software and you really need DirectX if you want to play Sid Mier's Pirates! Actually, you can find Atari ST and Amig

Re: Re: [Tutor] Problems with test cgi script on windows XP/Apache

2005-02-14 Thread Liam Clarke
Windows, she is a woman, and woman are mysterious in their little quirks. Unfortunately, you cannot divorce her, for she controls your software and you really need DirectX if you want to play Sid Mier's Pirates! On Mon, 14 Feb 2005 11:35:45 -0900, Tim Johnson <[EMAIL PROTECTED]> wrote: > > >Date

Fwd: Re: [Tutor] Problems with test cgi script on windows XP/Apache

2005-02-14 Thread Tim Johnson
Date: Mon, 14 Feb 2005 10:25:28 -0900 From: Tim Johnson <[EMAIL PROTECTED]> Subject: Re: [Tutor] Problems with test cgi script on windows XP/Apache To: Tim Johnson <[EMAIL PROTECTED]> X-Mailer: QUALCOMM Windows Eudora Version 6.2.1.2 At 12:22 PM 2/13/2005, you wrote: I'm attempting to run a test c

Re: [Tutor] Is an executable available?

2005-02-14 Thread Alan Gauld
> I am working from within python and want to know the best way to know if > a certain package is installed for use on my machine. You mean a Python package or a software package in general terms? > I want to know from within python that a specific executable file is on > my path where I could ac

Re: [Tutor] Is an executable available?

2005-02-14 Thread Danny Yoo
On Mon, 14 Feb 2005, Kent Johnson wrote: > > I am working from within python and want to know the best way to know > > if a certain package is installed for use on my machine. > > > > I want to know from within python that a specific executable file is > > on my path where I could actually run t

Re: [Tutor] calling an external program

2005-02-14 Thread Danny Yoo
On Mon, 14 Feb 2005, Alan Gauld wrote: > > - I am trying to call up an external program with something like a > > "Shell" command - can not find a way of doing this (in windows) > > Look in the os module, there are several options depending on exactly > what you need to do. The simplest option i

Re: [Tutor] I thank you . . .

2005-02-14 Thread Danny Yoo
On Mon, 14 Feb 2005, Lobster wrote: > # Wikipedia single word search engine > # Monday Feb 14 > > import webbrowser > > sought_word = raw_input("What is your wikipedia search word? ") > goto_url_location = "http://en.wikipedia.org/wiki/"; + sought_word > webbrowser.open(goto_url_location) Hi L

[Tutor] I thank you . . .

2005-02-14 Thread Lobster
Dear Snake Charmers, Many thanks and much appreciation to everyones kind help on my attempts to open a browser and seek a word in wikipedia here is the code I eventually settled on: = # Wikipedia single word search engine # Monday Feb 14 import webbrowser sought_word = raw_inp

Re: [Tutor] Is an executable available?

2005-02-14 Thread Kent Johnson
Stuart Murdock wrote: Hi I am working from within python and want to know the best way to know if a certain package is installed for use on my machine. I want to know from within python that a specific executable file is on my path where I could actually run the command from a prompt in a system

Re: [Tutor] Negative IF conditions

2005-02-14 Thread Liam Clarke
It (imao) really depends. If I see if a == 'foo': do nothing else: do what I want I always expect a equalling foo to be the primary result being tested for, as it comes first. When it comes time to bug hunt, it takes a mental readjustment to realise that I don't want a to be 'foo', and it i

Re: [Tutor] Is an executable available?

2005-02-14 Thread Liam Clarke
Hi Stuart, it's a vague question, so all I can give is vague answers. What OS are you using? But - If your environment variables will contain info about the file, you can use os.environ, however, that pulls all the env variables - i.e., on my WinXP - >>> envVars = os.environ >>> for (key, val)

Re: [Tutor] Negative IF conditions

2005-02-14 Thread Ron Phillips
And now for something only slightly different: education research shows that people process "positives" far more quickly and accurately than "negatives", so for readability I often code like:   if os.path.exists('filename')     #no-operation else     #operation   YMMV, of course.   Ron At 08:5

Re: [Tutor] Re: Tutor Digest, Vol 12, Issue 71

2005-02-14 Thread Kent Johnson
Lobster wrote: That is a good tip and seems to be the place I need to look - not really quite sure what I am looking at in the help docs I also have the complication of having to use is it "C:\\" - two back slashes? I am trying to get a wikipedia directed search that will load firefox and search fo

Re: [Tutor] Value Error solved. Another question

2005-02-14 Thread Kent Johnson
Ron Nixon wrote: Ignore my first posting. Here's what I'm trying to do. I want to extract headlines from a newspaper's website using this code. It works, but I want to match the second group in (.*) and print that out. Sugguestions import urllib, re pattern = re.compile(""" href="(.*)">(.*)""", re.

Re: [Tutor] Re: Tutor Digest, Vol 12, Issue 71

2005-02-14 Thread Brian van den Broek
Lobster said unto the world upon 2005-02-14 13:32: >> - I am trying to call up an external program >> with something like a "Shell" command - can not find a way of doing >> this >> (in windows) >> >> Any hints? What about os.system('your_command_here')? = That is a good tip and seems t

[Tutor] Re: Tutor Digest, Vol 12, Issue 71

2005-02-14 Thread Lobster
>> - I am trying to call up an external program >> with something like a "Shell" command - can not find a way of doing >> this >> (in windows) >> >> Any hints? What about os.system('your_command_here')? = That is a good tip and seems to be the place I need to look - not really quite sure wha

[Tutor] Is an executable available?

2005-02-14 Thread Stuart Murdock
Hi I am working from within python and want to know the best way to know if a certain package is installed for use on my machine. I want to know from within python that a specific executable file is on my path where I could actually run the command from a prompt in a system shell. I don't want

Re: [Tutor] writing list to new file

2005-02-14 Thread Alan Gauld
> If line.startswith('XXX'): > save list to new file > > But I get errors saying only stings can be saved this > way. You can save the list if the list can be printed, but its usually better to save the list contents. You will need to convert the contents into strings or else use

Re: [Tutor] calling an external program

2005-02-14 Thread Alan Gauld
> - I am trying to call up an external program > with something like a "Shell" command - can not find a way of doing this > (in windows) Look in the os module, there are several options depending on exactly what you need to do. The simplest option is system(). To read the output look at the vario

Re: [Tutor] Tweaking list comprehensions

2005-02-14 Thread Alan Gauld
> > isHTML = [filename if filename.endswith('.htm') or\ > >filename.endswith(.html') for filename in files] > > return isHTML > > No, it should be... Well spotted, but... > > isHTML = [filename for filename in files if filename.endswith('.htm') or\ > filename.endswith('.html') for filenam

Re: [Tutor] error message

2005-02-14 Thread Alan Gauld
> The biggest problem that nobody has mentioned yet is the fact that group() > will not have anything unless you explicitly tell it to group it. Nope, group will work OK even with a normal string regex. Alan G. ___ Tutor maillist - Tutor@python.org h

Re: [Tutor] Tweaking list comprehensions

2005-02-14 Thread Alan Gauld
> > I am fine tuning list comprehensions (at least my understandng > > thereof), and I'm not near a Python interpreter at the moment, so I > > was wondering if someone could tell me if I did OK - > > def approachB(files): > > > > isHTML = [filename if filename.endswith('.htm') or\ > >filename.