Re: [Tutor] Threading + socket server (blocking IO)

2006-02-17 Thread Liam Clarke
Hi, Just coming back to the server end of things. Kent, could I please ask you to confirm that I'm not doing anything abnormal with the ThreadingMixIn? The code is here at rafb: http://www.rafb.net/paste/results/915JVm90.html Basically, when I test it using a script to generate the datagrams via

[Tutor] MySQLdb update

2006-02-17 Thread Servando Garcia
Here is an update concerning my MySQLdb issue.( unable to insert data into database using Python and MySQLdb) I have tested the scripts that I posted here on both my Mac and Linux machines the script functioned as expected, ran without error and inserted data into database. It is my conclusion

Re: [Tutor] 'in-place' methods

2006-02-17 Thread Kent Johnson
Michael Broe wrote: > I think I understand this sorting-a-list 'in place' stuff, and things > of that kind (reversing for example); but I am finding it very > difficult to get used to, since sorting a list doesn't return the > sorted list as a value, but simply does the work as a side effect.

Re: [Tutor] 'in-place' methods

2006-02-17 Thread Alan Gauld
> is, I think you've hit on the answer: the default, if you will, is to > perform operations in-place, to avoid the necessity of reassigning a > list to it's sorted version, to give one example. But that isn't necessary, you could just return a reference to the sorted list, that is: x = L.s

Re: [Tutor] 'in-place' methods

2006-02-17 Thread Alan Gauld
>I think I understand this sorting-a-list 'in place' stuff, and things > of that kind (reversing for example); but I am finding it very > difficult to get used to, since sorting a list doesn't return the > sorted list as a value, but simply does the work as a side effect. If its any consola

Re: [Tutor] 'in-place' methods

2006-02-17 Thread w chun
hi mike, welcome to python. :-) your query is quite common amongst beginners, and i have actually spend some time on this topic in my courses. On 2/17/06, Michael Broe <[EMAIL PROTECTED]> wrote: > I think I understand this sorting-a-list 'in place' stuff, and things > of that kind (reversing fo

Re: [Tutor] 'in-place' methods

2006-02-17 Thread Orri Ganel
Michael Broe wrote: >I think I understand this sorting-a-list 'in place' stuff, and things >of that kind (reversing for example); but I am finding it very >difficult to get used to, since sorting a list doesn't return the >sorted list as a value, but simply does the work as a side effect. >

[Tutor] 'in-place' methods

2006-02-17 Thread Michael Broe
I think I understand this sorting-a-list 'in place' stuff, and things of that kind (reversing for example); but I am finding it very difficult to get used to, since sorting a list doesn't return the sorted list as a value, but simply does the work as a side effect. The place where it really

Re: [Tutor] TypeError: 'str' object is not callable

2006-02-17 Thread Chris Hallman
Oh, gee. Do I feel sheepish. I knew I had been staring at the error all along, but yet couldn't see it.Thanks!!On 2/17/06, Kent Johnson <[EMAIL PROTECTED]> wrote:Chris Hallman wrote: >> Here is my script:> input = file(rpath, "r")> for line in file(rpath):> for file in dirList:>   

Re: [Tutor] Sqrt is listed as always available.

2006-02-17 Thread Kent Johnson
struggle wrote: > Hello everybody : > I feel very interest in the python language ! And I want to learn > something about the language , > I want to know how it be designed and implemented . I look into the > www.python.org , but I didn't > find anything about that , can you help me ? If you

[Tutor] How is python designed ?

2006-02-17 Thread struggle
Hello everybody : I feel very interest in the python language ! And I want to learn something about the language , I want to know how it be designed and implemented . I look into the www.python.org , but I didn't find anything about that , can you help me ? ___

Re: [Tutor] TypeError: 'str' object is not callable

2006-02-17 Thread Kent Johnson
Chris Hallman wrote: > > Here is my script: > input = file(rpath, "r") > for line in file(rpath): > for file in dirList: > filename = file.lower() You use the name 'file' for a global variable. This hides the builtin function 'file'. This is a bit of a gotcha for newbies - t

Re: [Tutor] Sqrt is listed as always available.

2006-02-17 Thread struggle
Hello everybody : I feel very interest in the python language ! And I want to learn something about the language , I want to know how it be designed and implemented . I look into the www.python.org , but I didn't find anything about that , can you help me ? ___

[Tutor] TypeError: 'str' object is not callable

2006-02-17 Thread Chris Hallman
Here is my script:send_file.pyimport os, random, re, string, sys, telnetlib, threading, timefrom time import strftimefrom threading import Threadclass ConfigIT(threading.Thread):     def __init__(self,host):        Thread.__init__(self)        self.host = host        self.filename = filename    def

[Tutor] Once again I am in error

2006-02-17 Thread Servando Garcia
Hello list Seems once again unknowingly I have violated the rules of this list. I posted a request for help with working with a database. A few members of this list were kind enough to reply. When I answered their emails. I simply hit the reply button which sent out a personal email and not

Re: [Tutor] unable to insert data into database

2006-02-17 Thread Wolfram Kraus
Wolfram Kraus wrote: > Servando Garcia wrote: > >>Hello to all >>I have been trying to insert data into a database using MySQLdb >>with no success. I have no idea why this script is not working. I took >>it from a tutorial from DEV Shed. >> >>#!/usr/bin/python >>import MySQLdb >># connect >

Re: [Tutor] unable to insert data into database

2006-02-17 Thread Kent Johnson
Servando Garcia wrote: > Hello to all > I have been trying to insert data into a database using MySQLdb > with no success. I have no idea why this script is not working. I took > it from a tutorial from DEV Shed. What happens when you try it? "Not working" doesn't give us much to go on. If

Re: [Tutor] unable to insert data into database

2006-02-17 Thread Wolfram Kraus
Servando Garcia wrote: > Hello to all > I have been trying to insert data into a database using MySQLdb > with no success. I have no idea why this script is not working. I took > it from a tutorial from DEV Shed. > > #!/usr/bin/python > import MySQLdb > # connect > db = MySQLdb.connect(host

Re: [Tutor] Problem wxPython

2006-02-17 Thread Andre Roberge
On 2/17/06, Prabhakar K <[EMAIL PROTECTED]> wrote: > Hai to all, > > I installed ActivePython-2.4.1-247-win32-ix86 and > wxPython2.6-win32-ansi-2.6.2.1-py2 in my system. When i Run > a wxPython example.. geeting an Errors > [snip] > File "F:\python\wx.py", line 1, in ? > from wxPython

[Tutor] Problem wxPython

2006-02-17 Thread Prabhakar K
Hai to all,       I installed ActivePython-2.4.1-247-win32-ix86 and wxPython2.6-win32-ansi-2.6.2.1-py2 in my system. When i Run a wxPython example.. geeting an Errors   Traceback (most recent call last):  File "E:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 310, i

[Tutor] unable to insert data into database

2006-02-17 Thread Servando Garcia
Hello to all I have been trying to insert data into a database using MySQLdb with no success. I have no idea why this script is not working. I took it from a tutorial from DEV Shed. #!/usr/bin/python import MySQLdb # connect db = MySQLdb.connect(host="localhost", user="root", passwd="*

Re: [Tutor] using popen(n) to intercept stdout

2006-02-17 Thread Alan Gauld
Hi Tim, > I now realize that to properly test this, I should use a command that > returns legitimate data: > I think the following gets me started: > f = os.popen('ls *.py','r').read() > now I have captured the output from 'ls *.py'. You probably should consider using the Popen class in the new

Re: [Tutor] python mechanize examples

2006-02-17 Thread Danny Yoo
On Thu, 16 Feb 2006, Ron Nixon wrote: > Anyone have or know where I can find working examples of python's > mechanize modules. Try to reverse engineer a script to see how it works. Hi Ron, I'm assuming, for the moment, that you're talking about the third-party 'mechanize' module: http://w

Re: [Tutor] problems with the shebang line and linux

2006-02-17 Thread Alan Gauld
> Try this with the file > > vi filename > escape > :%s/^M// > Or just run the dos2unix command that comes with most Linux distros... Or even use Python to write a script to strip() each line and write it back with a \n... In fact there's a prewritten script called crlf.py in the Tools folder

Re: [Tutor] problems with the shebang line and linux

2006-02-17 Thread Brian van den Broek
Thanks to all for the replies. Indeed, it must have been the DOS vs. Unix line terminators as several people suggested. A couple of comments in-line below. Roel Schroeven said unto the world upon 16/02/06 11:14 AM: >>On 16/02/06, *Brian van den Broek* <[EMAIL PROTECTED] >>

Re: [Tutor] problems with the shebang line and linux

2006-02-17 Thread Roel Schroeven
Adam schreef: > > > On 16/02/06, *Brian van den Broek* <[EMAIL PROTECTED] > > wrote: > > [EMAIL PROTECTED]:~$ which python > /usr/bin/python > [EMAIL PROTECTED]:~$ cd /media/windata/ > [EMAIL PROTECTED]:/media/windata$ ./testerlyfoo.py > Working! >

Re: [Tutor] G'day

2006-02-17 Thread Alan Gauld
On 16/02/06, John Connors <[EMAIL PROTECTED]> wrote: > My 1st dumb question: I have a copy of Teach Yourself Python in 24 Hours, > printed in 2000 so I guess it's virtually usless but i was hoping to learn > some of the basics from it. There is a small bit of code near the > beginning... I missed

Re: [Tutor] problems with the shebang line and linux

2006-02-17 Thread Adam
On 16/02/06, David Rock <[EMAIL PROTECTED]> wrote: * Adam <[EMAIL PROTECTED]> [2006-02-16 14:23]:> On 16/02/06, Brian van den Broek <[EMAIL PROTECTED]> wrote: >> It seems to me that that ^M is your problem although I'm not quite sure> where it came from there seems to be an extra character on the e