[Tutor] Python upgrade from 2.3 to 2.4

2006-01-06 Thread Ivan Furone
Hello Srinivas, You can install both versions on the same platform,in separate directories,and start them individually as any other else application.Obviously each one will rely on the modules with which was coming when installed.(And,if you installed further extensions,they will work properly with

Re: [Tutor] Nearly there

2006-01-06 Thread Terry Carroll
This is itching at me, too. On Fri, 6 Jan 2006, John Corry wrote: > Can anyone understand or tell me why this works but the following code does > not:- > > import win32api > filename = "testprint.txt" > fileobj=open (filename, "w") > fileobj.write ("This is a test") > fileobj.close() > win32api.

Re: [Tutor] iterate over daterange

2006-01-06 Thread Terry Carroll
On Fri, 6 Jan 2006, captnswing wrote: > Hello > I have a startdate and an enddate and I want to iterate over all days > in between the two > > there doesn't seem to be a range function for dates?!? Sounds like a good application for a generator: # def daterange(fr

[Tutor] iterate over daterange

2006-01-06 Thread captnswing
Hello I have a startdate and an enddate and I want to iterate over all days in between the two there doesn't seem to be a range function for dates?!? i.e. currently I am going through integers with something like this: = startdate = datetime.date(2006,1,1)

[Tutor] Nearly there

2006-01-06 Thread John Corry
Thanks for all the feedback and help. The good news is that I have managed to get my windows 98 SE machine to print a text file using the follwing code:- import tempfile import win32api filename = tempfile.mktemp (".txt") open (filename, "w").write ("This is a test") win32api.ShellExecute ( 0,

Re: [Tutor] IDLE doesn't start in Python 2.4 in windows XP

2006-01-06 Thread Danny Yoo
On Fri, 6 Jan 2006, Srinivas Iyyer wrote: > Hi Danny, > > I was following some of your suggestions in making my IDLE work in > Windows XP laptop. > (http://mail.python.org/pipermail/tutor/2005-January/034683.html). Hi Srinivas, That suggestion, to change the desktop shortcut, wasn't mine. *gr

[Tutor] IDLE doesn't start in Python 2.4 in windows XP

2006-01-06 Thread Srinivas Iyyer
Hi Danny, I was following some of your suggestions in making my IDLE work in Windows XP laptop. (http://mail.python.org/pipermail/tutor/2005-January/034683.html). First, i changed the IDLE shortcut path: from C:\Python24\python.exe TO C:\Python24\python.exe "C:\Python24\Lib\idlelib\idle.pyw" -

Re: [Tutor] MySQL api does not accept variable.

2006-01-06 Thread Alan Gauld
> I can't think of the con's and the pro's of keeping open > the mysql connection when the script starts and close > it when it ends.. The reasoning is that you want to open the connection at the start of a script do all your processing then close it. In between you might want to add data, cre

Re: [Tutor] Web-log, not blog

2006-01-06 Thread Kent Johnson
Øyvind wrote: > Hello. > > I am trying to find some Pythonmodules to work with some webserver logs. I > have found http://www.mnot.net/python/WebLog/, but it is very old (from > 1999). And when I try to serach in Google and so forth, all I get is > Python weblogs as in blogs. Do you have some su

[Tutor] Web-log, not blog

2006-01-06 Thread Øyvind
Hello. I am trying to find some Pythonmodules to work with some webserver logs. I have found http://www.mnot.net/python/WebLog/, but it is very old (from 1999). And when I try to serach in Google and so forth, all I get is Python weblogs as in blogs. Do you have some suggestions of other sites a

Re: [Tutor] MySQL api does not accept variable.

2006-01-06 Thread Panagiotis Atmatzidis
Hello, Thank you for the reply. You can browse the entire script code[1]. The truth is that I did not think about it. The speed is acceptable for me, but as you point you out, it does not make much sense. I can't think of the con's and the pro's of keeping open the mysql connection when the script

Re: [Tutor] Avoiding repetetive pattern match in re module

2006-01-06 Thread Kent Johnson
Intercodes wrote: > Hello everyone, > > Iam new to this mailing list as well as python(uptime-3 weeks).Today > I learnt about RE from http://www.amk.ca/python/howto/regex/ > .This one was really > helpful. I started working out with few exampl

Re: [Tutor] MySQL api does not accept variable.

2006-01-06 Thread Alan Gauld
def sql_listusers(hostname, dbusername, dbpassword, dbbase, dbasename): try: conn = MySQLdb.connect (host = hostname, user = dbusername, passwd = dbpassword, db = dbbase) cursor = conn.cursor () cursor.execute

Re: [Tutor] Excel files to Tab delim files

2006-01-06 Thread Carlo Capuano
Hi, If you run python on windows, you may also take the control of office (word,excel) and may others tools, for example image you have a mysheet.xls in C import pythoncom, win32com.client,os pythoncom.CoInitializeEx(pythoncom.COINIT_APARTMENTTHREADED) excelapp = win32com.client.gencache.Ensure

[Tutor] MySQL api does not accept variable.

2006-01-06 Thread Panagiotis Atmatzidis
Hello, This is a snip of my code: def sql_listusers(hostname, dbusername, dbpassword, dbbase, dbasename): try: conn = MySQLdb.connect (host = hostname, user = dbusername, passwd = dbpassword, db = dbbase) cursor

Re: [Tutor] string to integer

2006-01-06 Thread Alan Gauld
>> nums = [ch for ch in aString if ch in string.digits] > I'd spell that > > nums = [ch for ch in aString if ch.isdigit()] Now I had a look for a digit() method but never notoced the isdigit() one. Thanks Brian. Alan G. ___ Tutor maillist - Tutor@