[Tutor] MySQL api does not accept variable.

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

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

Re: [Tutor] Problem with os.access function. [semantic error, if check does not work]

2005-12-26 Thread Panagiotis Atmatzidis
Hello, Thank you both for the tip's and the interesting links. I resolved my problem easily using another function, os.path.isdir(x) which was more specific. Best Regards. On 12/24/05, bob [EMAIL PROTECTED] wrote: At 05:20 AM 12/24/2005, Panagiotis Atmatzidis wrote: Hello, I am writing

[Tutor] Problem with os.access function. [semantic error, if check does not work]

2005-12-24 Thread Panagiotis Atmatzidis
Hello, I am writing a function in order to check if a directory exists. If exists the functions must do nothing, otherwise must check the users permissions and if it's possible create the dir. Looking at pydoc's httpd I found the module os and the function access. From the http-doc: access(...)

[Tutor] Input checking [letters or numbers]

2005-12-23 Thread Panagiotis Atmatzidis
Hello, Can someone provide me with an error checking example about an x variable that needs to be number only? I used something like: def useridf(): print print WARNING: If you don't understand why this must be unique, exit and read the manual. print userid = input(x : )

Re: [Tutor] Input checking [letters or numbers]

2005-12-23 Thread Panagiotis Atmatzidis
Hello there, Thank you for the prompt response. On 12/23/05, bob [EMAIL PROTECTED] wrote: At 10:15 AM 12/23/2005, Panagiotis Atmatzidis wrote: Hello, Can someone provide me with an error checking example about an x variable that needs to be number only? I used something like: def

Re: [Tutor] Input checking [letters or numbers]

2005-12-23 Thread Panagiotis Atmatzidis
Hello Dany :-) On 12/23/05, Danny Yoo [EMAIL PROTECTED] wrote: x = raw_input(x : ) if x.isdigit(): # ensure input is a number y = int(x) # convert to integer else: print 'Boo Hello Bob and Panagiotis, It might be good to make this number-reading thing a function, just to

Re: [Tutor] Input checking [letters or numbers]

2005-12-23 Thread Panagiotis Atmatzidis
Yeah works you're right. :-) On 12/23/05, bob [EMAIL PROTECTED] wrote: At 11:16 AM 12/23/2005, Panagiotis Atmatzidis wrote: Hello there, Thank you for the prompt response. On 12/23/05, bob [EMAIL PROTECTED] wrote: [snip] print input(x ; ) and enter Hello world x = input(x

Re: [Tutor] Input checking [letters or numbers]

2005-12-23 Thread Panagiotis Atmatzidis
On 12/23/05, Panagiotis Atmatzidis [EMAIL PROTECTED] wrote: Hello Dany :-) On 12/23/05, Danny Yoo [EMAIL PROTECTED] wrote: [...] Hello Bob and Panagiotis, It might be good to make this number-reading thing a function, just to make it easier to reuse (and test!) it. Let's call

[Tutor] Python Script Problem. Simple sql problem py problems.

2005-12-06 Thread Panagiotis Atmatzidis
? Best Regards, Panagiotis Atmatzidis [1] http://beast.merseine.nu/files/other/vuhandle.html ps. This script comes with a specific proftpd configuration file, it does not make sense without it. If someone wants to test this please drop a mail and I'll upload the proftpd conf file