ANN: uuid-0.3.0 released

2006-04-11 Thread Jürgen Urner
Happy to announce the release of uuid-0.3.0 What is uuid? uuid is a python module to generate RFC 4122 compatible UUIDs The new release includes some bugfixes a new function format_mac_address(), other minor changes + an update on the documentation to provide some more background

Re: Python 3.0 or Python 3000?

2006-04-11 Thread Robert Kern
Sergei Organov wrote: Dennis Lee Bieber [EMAIL PROTECTED] writes: On Mon, 10 Apr 2006 12:12:58 +0200, Benjamin Niemann [EMAIL PROTECTED] declaimed the following in comp.lang.python: That's actually the versioning scheme of TeX, currently being at 3.141592 eeek My last exposure to TeX

Re: Python 3.0 or Python 3000?

2006-04-11 Thread Sergei Organov
Robert Kern [EMAIL PROTECTED] writes: Sergei Organov wrote: Dennis Lee Bieber [EMAIL PROTECTED] writes: On Mon, 10 Apr 2006 12:12:58 +0200, Benjamin Niemann [EMAIL PROTECTED] declaimed the following in comp.lang.python: [...] Anyway, it's unfair to speak of one of the most wonderful pieces of

Re: using vim as a python class/module/function etc.. browser

2006-04-11 Thread Robert Kern
Chris Jones wrote: Robert Kern wrote: Of course, modern versions of Exuberant Ctags also support Python, too. I apt-installed this package but the man page is rather intimidating so I thought I might as well make sure I was going in the right direction. You will probably want to read the

Re: import help

2006-04-11 Thread placid
Dennis Lee Bieber wrote: On 10 Apr 2006 20:55:31 -0700, placid [EMAIL PROTECTED] declaimed the following in comp.lang.python: Traceback (most recent call last): File LinkedList.py, line 7, in ? main() File LinkedList.py, line 4, in main n = Node(test) NameError:

modifying html input date for mysql, reg ex or string interpolation?

2006-04-11 Thread Kun
I have an html form that takes dates and inserts them into a mysql file. Currently, users have to type in dates in the -mm-dd format. As of now, this process works with the sql. However, I would like to make this process easier by: 1) providing drop down menus for year, month, and date

Re: writing captcha image file

2006-04-11 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: I get this msg: Traceback (most recent call last): File /usr/local/apache/cgi-bin/newuser.cgi, line 61, in ? cstatus = im.save(file_name,'JPEG') File /usr/local/lib/python2.4/PIL/Image.py, line 1299, in save fp = __builtin__.open(fp, wb) IOError: [Errno

Re: Python 3.0 or Python 3000?

2006-04-11 Thread Sergei Organov
Dennis Lee Bieber [EMAIL PROTECTED] writes: On Tue, 11 Apr 2006 09:40:50 +0400, Sergei Organov [EMAIL PROTECTED] declaimed the following in comp.lang.python: Anyway, it's unfair to speak of one of the most wonderful pieces of software ever written in such a tone. I refer to the

[Off topic] Re: Backing Up VMWare

2006-04-11 Thread Franck Pommereau
Hello - has anyone written a Python script to backup VMWare servers? If so, I'd appreciate any pointers as to how to go about doing so. Nothing to do with Python, but... Under Linux, VMware disks are mountable using the script vmware-mount.pl, see:

Re: using vim as a python class/module/function etc.. browser

2006-04-11 Thread Daniel Nogradi
Of course, modern versions of Exuberant Ctags also support Python, too. I apt-installed this package but the man page is rather intimidating so I thought I might as well make sure I was going in the right direction. You will probably want to read the vim documentation on how to use ctags

Re: Calling Web Services from Python

2006-04-11 Thread Ivan Zuzak
m.banaouas wrote: Can you tell us more about SOAPpy bug ? Is it about authentication ? Ivan Zuzak a écrit : ... I need a package/tool that generates web service proxies that will do all the low-level HTTP work. (Someting like the WSDL.EXE tool in .NET Framework) The ZSI and SOAPy

Re: can't pass command-line arguments

2006-04-11 Thread Duncan Booth
Lawrence D'Oliveiro wrote: In article [EMAIL PROTECTED], Duncan Booth [EMAIL PROTECTED] wrote: Windows variants such as NT/2000/XP are not based on MS-DOS in any way. Then why are Windows system files still restricted to 8.3 names? Doesn't that restriction derive from a core

Re: using regex to remove $ sign

2006-04-11 Thread Fredrik Lundh
Kun [EMAIL PROTECTED] wrote: i have an html/cgi input that takes in values to a mysql database, however, if i stick in $20 instead of 20, it crashes the program because of the extra $ sign. I was wondering if anyone has a quick regular expression in python to remove the $-sign if it is

Re: [Off topic] Re: Backing Up VMWare

2006-04-11 Thread Duncan Booth
Franck Pommereau wrote: Hello - has anyone written a Python script to backup VMWare servers? If so, I'd appreciate any pointers as to how to go about doing so. Nothing to do with Python, but... Under Linux, VMware disks are mountable using the script vmware-mount.pl, see:

Re: About classes and OOP in Python

2006-04-11 Thread Ben Sizer
fyhuang wrote: It seems to me that it is difficult to use OOP to a wide extent in Python code because these features of the language introduce many inadvertant bugs. For example, if the programmer typos a variable name in an assignment, the assignment will probably not do what the programmer

Re: using regex to remove $ sign

2006-04-11 Thread bearophileHUGS
Fredrik LundhRE? ex-perler? try strip+lstrip instead: Or even: text = $12921 text.replace($, ) ' 12921 ' Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: About classes and OOP in Python

2006-04-11 Thread Fredrik Lundh
Ben Sizer wrote: I think it's important not to wrongly confuse 'OOP' with ''data hiding' or any other aspect you may be familiar with from Java or C++. The primary concept behind OOP is not buzzwords such as abstraction, encapsulation, polymorphism, etc etc, but the fact that your program

Re: Python 3.0 or Python 3000?

2006-04-11 Thread per9000
I can't wait to get my hands on version PAL9000, then we will all have to deallocate memory *the hard way*. /per9000 --- I'm afraid. I'm afraid, Dave. Dave, my mind is going. I can feel it. I can feel it. My mind is going. There is no question about it. I can feel it. I

Re: About classes and OOP in Python

2006-04-11 Thread Michele Simionato
Roy Smith wrote: snip That being said, you can indeed have private data in Python. Just prefix your variable names with two underscores (i.e. __foo), and they effectively become private. Yes, you can bypass this if you really want to, but then again, you can bypass private in C++ too.

Re: Decorators, Identity functions and execution...

2006-04-11 Thread Christos Georgiou
On Tue, 11 Apr 2006 15:05:22 +1200, rumours say that Lawrence D'Oliveiro [EMAIL PROTECTED] might have written: In article [EMAIL PROTECTED], Roy Smith [EMAIL PROTECTED] wrote: One of the most basic maxims on the Internet has always been, Be liberal in what you accept, be conservative in what

dircache.listdir() or os.listdir()

2006-04-11 Thread kai
Hello, I use dircache.listdir(myDir) in my module repeatedly. On OS WIN 2000 listdir() will re-read the directory structure! But on AIX, listdir() will not re-read the directory structure (see Python Library Reference). I work with python version 2.2. Now my 2 questions: Why does

Re: updated pre-PEP: The create statement

2006-04-11 Thread Michele Simionato
Steven Bethard wrote: Azolex wrote: Steven Bethard wrote: and named, nested hierarchies like XML documents could be created like:: create ETobject html: This statement would generate an ElementTree object create ETobject head: generate the head

Re: About classes and OOP in Python

2006-04-11 Thread bruno at modulix
fyhuang wrote: Hello all, I've been wondering a lot about why Python handles classes and OOP the way it does. From what I understand, there is no concept of class encapsulation in Python, i.e. no such thing as a private variable. Seems you're confusing encapsulation with data hiding. Any

Web Service SOAP - Unknown element v1

2006-04-11 Thread Jesus . Javier . Masa . Lledo
Im trying to develope a web service that comunicates python (client) with Java (server). Everything works fine until the client calls a method that takes parameters ( for example: setName(Joe) ). Any other method that takes no parameteres works perfect ( For example: getDate() ), even the ones

Re: how relevant is C today?

2006-04-11 Thread Lawrence D'Oliveiro
In article [EMAIL PROTECTED], Thomas Bellman [EMAIL PROTECTED] wrote: Lawrence D'Oliveiro [EMAIL PROTECTED] writes: const is in C89/C90. Although with slightly different semantics from in C++... For instance: static const int n = 5; double a[n]; is valid C++, but not valid C.

Re: using regex to remove $ sign

2006-04-11 Thread John Machin
[EMAIL PROTECTED] wrote: Fredrik LundhRE? ex-perler? try strip+lstrip instead: Or even: text = $12921 text.replace($, ) ' 12921 ' That's fair enough with the given input, but it would silently swallow the $ in 123$5678 -- this sort of approach leads to all sorts of disasters.

Re: challenging (?) metaclass problem

2006-04-11 Thread alainpoint
Hi Peter, I don't know if you noticed but i changed my mind and removed the post as i realised that people seemed to have much more interest in how relevant c code still is than in solving an interesting problem. I only speak French and Dutch and my knowledge of Belgium's third official

Re: updated pre-PEP: The create statement

2006-04-11 Thread Michele Simionato
Steven Bethard wrote: Azolex wrote: Steven Bethard wrote: and named, nested hierarchies like XML documents could be created like:: create ETobject html: This statement would generate an ElementTree object create ETobject head: generate the head

Re: Web Service SOAP - Unknown element v1

2006-04-11 Thread Simon Brunning
On 4/11/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Im trying to develope a web service that comunicates python (client) with Java (server). Everything works fine until the client calls a method that takes parameters ( for example: setName(Joe) ). Any other method that takes no parameteres

dircache.listdir() or os.listdir()

2006-04-11 Thread kai
Hello, I use dircache.listdir(myDir) in my module repeatedly. On OS WIN 2000 listdir() will re-read the directory structure! But on AIX, listdir() will not re-read the directory structure (see Python Library Reference). I work with python version 2.2. Now my 2 questions: Why does

Re: Decorators, Identity functions and execution...

2006-04-11 Thread Ben Sizer
Lawrence D'Oliveiro wrote: In article [EMAIL PROTECTED], Carl Banks [EMAIL PROTECTED] wrote: Always use spaces when posting, and use them in your code as well. Spaces are the current recommended practice, and in the future tabs might become illegal. I'd prefer tabs myself, but it's more

Re: updated pre-PEP: The create statement

2006-04-11 Thread Michele Simionato
Steven Bethard wrote: Azolex wrote: Steven Bethard wrote: and named, nested hierarchies like XML documents could be created like:: create ETobject html: This statement would generate an ElementTree object create ETobject head: generate the head

Re: challenging (?) metaclass problem

2006-04-11 Thread alainpoint
Hi Peter, I don't know if you noticed but i changed my mind and removed the post as i realised that people seemed to have much more interest in how relevant c code still is than in solving an interesting problem. I only speak French and Dutch and my knowledge of Belgium's third official

dircache.listdir() or os.listdir()

2006-04-11 Thread kai
Hello, I use dircache.listdir(myDir) in my module repeatedly. On OS WIN 2000 listdir() will re-read the directory structure! But on AIX, listdir() will not re-read the directory structure (see Python Library Reference). I work with python version 2.2. Now my 2 questions: Why does

dircache.listdir() or os.listdir()

2006-04-11 Thread kai
Hello, I use dircache.listdir(myDir) in my module repeatedly. On OS WIN 2000 listdir() will re-read the directory structure! But on AIX, listdir() will not re-read the directory structure (see Python Library Reference). I work with python version 2.2. Now my 2 questions: Why does

Re: updated pre-PEP: The create statement

2006-04-11 Thread Michele Simionato
Steven Bethard wrote: Azolex wrote: Steven Bethard wrote: and named, nested hierarchies like XML documents could be created like:: create ETobject html: This statement would generate an ElementTree object create ETobject head: generate the head

Re: updated pre-PEP: The create statement

2006-04-11 Thread Michele Simionato
Steven Bethard wrote: Azolex wrote: Steven Bethard wrote: and named, nested hierarchies like XML documents could be created like:: create ETobject html: This statement would generate an ElementTree object create ETobject head: generate the head

Re: ftp putting information in a variable

2006-04-11 Thread Stefan Schwarzer
Hi Arne, On 2006-04-08 12:44, Arne wrote: I am looking for a way to put ftp returns in a variable. My OS is XP and I want to get the owner of a file. So I have to connect to ftp. But I am stacked with how I can receive this information and put it in a variable. you can use a library to

Re: writing captcha image file

2006-04-11 Thread amaltasb
I changed the owner of the file to root using chown root newuser.cgi, but still i m not able to write... -- http://mail.python.org/mailman/listinfo/python-list

Re: dircache.listdir() or os.listdir()

2006-04-11 Thread kai
sorry, my posting was crazy -- http://mail.python.org/mailman/listinfo/python-list

Re: Characters contain themselves?

2006-04-11 Thread Sion Arrowsmith
Graham Fawcett [EMAIL PROTECTED] wrote: You could always use an is-proper-subset-of function, which is closer to the intent of your algorithm. Using Jamitzky's very clever infix recipe [1], you can even write it as an infix operator: #Jamitzky's infix-operator class, abbreviated class Infix: [

Re: Decorators, Identity functions and execution...

2006-04-11 Thread Sybren Stuvel
Ben Sizer enlightened us with: Every day I come across people or programs that use tab stops every 2 or 8 columns. I am another fan of tabs every 4 columns, but unfortunately this isn't standard, so spaces in Python it is. I don't care about how people see my tabs. I use one tab for every

Re: updated pre-PEP: The create statement

2006-04-11 Thread Peter Hansen
Michele Simionato wrote: Honestly, I don't want the 'create' statement to be used to write XML in Python. I think this would be a misuse of the functionality. OTOH I believe that the main selling point for the 'create' statements is that it make it easy to implement declarative minilanguages,

Why new Python 2.5 feature class C() return old-style class ?

2006-04-11 Thread looping
For Python developers around. From Python 2.5 doc: The list of base classes in a class definition can now be empty. As an example, this is now legal: class C(): pass nice but why this syntax return old-style class, same as class C:, and not the new style class C(object): ? Old-style

Re: How to initiate HotSync of Palm device?

2006-04-11 Thread Peter Hansen
dylpkls91 wrote: I know how to get the program to wait for a process to finish, but I'm having trouble initiating a HotSync through Python. While poking around the Palm Desktop and HotSync system files, I found a DLL called HSAPI with the title HotSync API, but I'm not sure if this is what I

Re: wxStyledTextCtrl - Dead?

2006-04-11 Thread Peter Hansen
David Rasmussen wrote: I am trying to make a programmer's editor (and later a full IDE), and I want things like syntax highlighting etc. I could of course roll my own fancy editing control, but if STC could solve my problem and is flexible enough, then I'll use that for now :) There are at

Re: minidom + wxPython woes

2006-04-11 Thread grahamd
Paul Boddie wrote: Frank Millman wrote: Fredrik Lundh wrote: no, it's not a bug in the pyexpat module -- the problem is that wxPython uses it's own incompatible version of the expat library, and loads it in a way that causes problems for any library that's tries to use its own

Re: Sorting a list of objects by multiple attributes

2006-04-11 Thread Kent Johnson
gry@ll.mit.edu wrote: For multiple keys the form is quite analogous: L.sort(key=lambda i: (i.whatever, i.someother, i.anotherkey)) I.e., just return a tuple with the keys in order from your lambda. Such tuples sort nicely. In Python 2.5 you can do this with operator.attrgetter():

Re: Web Service SOAP - Unknown element v1

2006-04-11 Thread Simon Brunning
On 4/11/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: This is the result of doing: setDVD(title=BenHur) *** Outgoing SOAP ** ?xml version=1.0 encoding=UTF-8? SOAP-ENV:Envelope

Re: wxStyledTextCtrl - Dead?

2006-04-11 Thread Franz Steinhaeusler
On Tue, 11 Apr 2006 06:58:28 -0400, Peter Hansen [EMAIL PROTECTED] wrote: David Rasmussen wrote: I am trying to make a programmer's editor (and later a full IDE), and I want things like syntax highlighting etc. I could of course roll my own fancy editing control, but if STC could solve my

Re: Why new Python 2.5 feature class C() return old-style class ?

2006-04-11 Thread Georg Brandl
looping wrote: For Python developers around. From Python 2.5 doc: The list of base classes in a class definition can now be empty. As an example, this is now legal: class C(): pass nice but why this syntax return old-style class, same as class C:, and not the new style class

RIIA in Python 2.5 alpha: with... as

2006-04-11 Thread Alexander Myodov
Hello, Having heard that Python 2.5 offers some kind of RIIA concept via PEP343, got it downloaded (Windows version) and tried. But it did not work as expected and as wanted. For the time since I first learned Python, the only reason why I just could not use it was inability to localize the

Re: Why new Python 2.5 feature class C() return old-style class ?

2006-04-11 Thread Peter Hansen
Georg Brandl wrote: class C(): is meant to be synonymous with class C: and therefore cannot create a new-style class. I think looping understands that, but is basically asking why anyone is bothering with a change that involves a part of the language that is effectively deprecated.

Re: Best Python web-hosting?

2006-04-11 Thread Simon Brunning
On 9 Apr 2006 11:31:38 -0700, Steve [EMAIL PROTECTED] wrote: http://www.python-hosting.com/ I haven't used them myself, but recent research that I did made them look like good candidates. Python-Hosting.com is run by Remi Delon, author of CherryPy, so you'll be getting your support (should

Re: Compleated Begginers Guide. Now What?

2006-04-11 Thread Steve Holden
James Stroud wrote: Mirco Wahab wrote: Jay wrote: Malchick, you cracked your veshchs to classes, which is not that gloopy. So rabbit on them and add class methods that sloosh on beeing called and do the proper veshchs to the gulliwuts of their classes. Brillig! But neither helpful nor

Re: updated pre-PEP: The create statement

2006-04-11 Thread Michele Simionato
Peter Hansen wrote: Michele Simionato wrote: You can pull out the example in the official PEP, if you like. Please do. If this is supposed to have anything to do with namespaces, it has nothing to do with the type of data structures XML is capable of and the presence of this example

Re: Why new Python 2.5 feature class C() return old-style class ?

2006-04-11 Thread looping
Peter Hansen wrote: Georg Brandl wrote: class C(): is meant to be synonymous with class C: and therefore cannot create a new-style class. I think looping understands that, but is basically asking why anyone is bothering with a change that involves a part of the language that is

Re: using regex to remove $ sign

2006-04-11 Thread Tim Chase
i have an html/cgi input that takes in values to a mysql database, however, if i stick in $20 instead of 20, it crashes the program because of the extra $ sign. I was wondering if anyone has a quick regular expression in python to remove the $-sign if it is present in the input. While the

Help - strange behaviour from python list

2006-04-11 Thread Sean Hammond
I've managed to create a scenario in which editing an object in a list of objects seems to edit every object in the list, rather than just the one. I'm totally stumped and wondered if anyone would be kind enough to read my explanation and see if they have any suggestions. I have probably

Re: how relevant is C today?

2006-04-11 Thread bruno at modulix
Lawrence D'Oliveiro wrote: In article [EMAIL PROTECTED], bruno at modulix [EMAIL PROTECTED] wrote: gregarican wrote: Here are a few languages I recommend most programmers should at least have a peek at: (snip) 2) Lisp - Along with FORTRAN, one of the oldest programming languages still

Re: newbie: Need Help Moving Data from Kirbybase to Gadfly

2006-04-11 Thread dc
The addresslist table was defined and did exist, I had connection defined incorrectly. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help - strange behaviour from python list

2006-04-11 Thread Schüle Daniel
Sean Hammond schrieb: I've managed to create a scenario in which editing an object in a list of objects seems to edit every object in the list, rather than just the one. I'm totally stumped and wondered if anyone would be kind enough to read my explanation and see if they have any

Re: Help - strange behaviour from python list

2006-04-11 Thread Duncan Booth
Sean Hammond wrote: class Area: def __init__(self, occupants = []): self.occupants = occupants ... I must be making some really stupid mistake, but this just doesn't look like the list behaviour I would expect. What's going on here? Whenever you use the default value for

Re: Help - strange behaviour from python list

2006-04-11 Thread Fredrik Lundh
Sean Hammond wrote: I've managed to create a scenario in which editing an object in a list of objects seems to edit every object in the list, rather than just the one. I'm totally stumped and wondered if anyone would be kind enough to read my explanation and see if they have any suggestions.

Re: writing captcha image file

2006-04-11 Thread Fredrik Lundh
I changed the owner of the file to root using chown root newuser.cgi, but still i m not able to write... have you tried asking in a unix or apache forum, or do you expect pythoneers to help you with all your computer-related problems ? (are you sure your apache install runs CGI processes

MySQLdb module generating errors

2006-04-11 Thread amaltasb
I installed MySQLdb module on bsd and when I import I get the following error... Traceback (most recent call last): File stdin, line 1, in ? File MySQLdb/__init__.py, line 27, in ? import _mysql ImportError: /usr/local/lib/liblthread.so.2: Undefined symbol _sched_yield Is any module

Refresh loop

2006-04-11 Thread Aleksandar Cikota
Hello, I'm beginner in python. I want to refresh and print Scope.SiderealTime every second in Tkiner. I have a easy question. How to refresh this loop every second? Here the code: from Tkinter import * import win32com.client Scope = win32com.client.dynamic.Dispatch('ScopeSim.Telescope')

Re: Help - strange behaviour from python list

2006-04-11 Thread Sean Hammond
Right, thanks everyone, that's a useful lesson learned. As I suspected I was being tripped over by some feature of Python I was unaware of. I had been looking up lists in the documentation, not functions, and could find no explanation. Prbolem solved! -- --

Re: Characters contain themselves?

2006-04-11 Thread Graham Fawcett
Sion Arrowsmith wrote: Unfortunately: print 'a'+'bc' |ips| 'abc' True Which might not be what you want. On the other hand, it's a simple fix: ips = Infix(lambda a, b: (a != b) and (a in b)) print 'a'+'bc' |ips| 'abc' Ah, good point. Graham --

Re: Why new Python 2.5 feature class C() return old-style class ?

2006-04-11 Thread bearophileHUGS
bruno at modulixSince the class statement without superclass actually creates an old-style class, I'd expect the class MyClass(): variant to behave the same. In Python 3.0 I really hope the class C: pass class C(): pass class C(object): pass will mean the same thing. (So in Python 2.5 the

Re: RIIA in Python 2.5 alpha: with... as

2006-04-11 Thread Martin v. Löwis
Alexander Myodov wrote: Sorry, I misworded the question - RIIA is indeed present at least by the reason that the examples from PEP pass. Agree, my problem is a bit different, and I a bit mixed up initialization/acquisition with lifetime blocks. So, seems that we indeed have one and still don't

Re: waiting for file lock?

2006-04-11 Thread Larry Bates
[EMAIL PROTECTED] wrote: hi i need to go into a directory to grab some files and do some processing. The thing is, i need to wait till the process that generates the files in that directory to finish before i can grab the files. eg if file A is being generated and has not finished, my

Re: Why new Python 2.5 feature class C() return old-style class ?

2006-04-11 Thread Georg Brandl
looping wrote: Peter Hansen wrote: Georg Brandl wrote: class C(): is meant to be synonymous with class C: and therefore cannot create a new-style class. I think looping understands that, but is basically asking why anyone is bothering with a change that involves a part of the

Re: Best Python web-hosting?

2006-04-11 Thread walterbyrd
I emailed them, they say they have mod_python. -- http://mail.python.org/mailman/listinfo/python-list

Re: Best Python web-hosting?

2006-04-11 Thread walterbyrd
I emailed them, they say they have mod_python. -- http://mail.python.org/mailman/listinfo/python-list

Re: Re[2]: RIIA in Python 2.5 alpha: with... as

2006-04-11 Thread Duncan Booth
Alexander Myodov wrote: Or maybe you have an idea how this can be fixed? The simplest way I see is putting all the controlled variables into a dedicated class... and do that each time for each block of variables I need control lifetime. Is there any simpler way? I wouldn't use the word

setting up mod_python handlers on a server?

2006-04-11 Thread John Salerno
I get this internal error message when I try to access a PSP page: Invalid command 'PythonHandler', perhaps mis-spelled or defined by a module not included in the server configuration So it seems that mod_python is not fully configured yet to handled PSP pages. When I check the installed

Re: Why new Python 2.5 feature class C() return old-style class ?

2006-04-11 Thread Felipe Almeida Lessa
Em Ter, 2006-04-11 às 06:49 -0700, looping escreveu: But in an other hand, I believe that new-style class are faster to instanciate (maybe I'm wrong...). $ python2.4 -m timeit -s 'class x: pass' 'x()' 100 loops, best of 3: 0.435 usec per loop $ python2.4 -m timeit -s 'class x(object):

Re: Why new Python 2.5 feature class C() return old-style class ?

2006-04-11 Thread Aahz
In article [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: In Python 3.0 I really hope the class C: pass class C(): pass class C(object): pass will mean the same thing. The BDFL made that one of the very first Pronouncements of 3.0. ;-) (So in Python 2.5 the second version can be made to mean

Re: unboundlocalerror with cgi module

2006-04-11 Thread bruno at modulix
David Bear wrote: I'm attempting to use the cgi module with code like this: import cgi fo = cgi.FieldStorage() # form field names are in the form if 'name:part' keys = fo.keys() for i in keys: try: item,value=i.split(':') except NameError,

Re: how relevant is C today?

2006-04-11 Thread gregarican
bruno wrote: Err... And ? It's the snide, curt replies such as your recent ones in this thread that reinforce the generalization that the Python community can be rude. -- http://mail.python.org/mailman/listinfo/python-list

the mysql for python cann't be install from the source! Help!!

2006-04-11 Thread boyeestudio
I install the mysqldb module for python,I use: python setup.py build but it tell me cann't find include file my_conf.h' I search the mysql directory but gain none of it! Please help me with it! Thanks a lot! -- http://mail.python.org/mailman/listinfo/python-list

Re: Why new Python 2.5 feature class C() return old-style class ?

2006-04-11 Thread bruno at modulix
[EMAIL PROTECTED] wrote: bruno at modulixSince the class statement without superclass actually creates an old-style class, I'd expect the class MyClass(): variant to behave the same. In Python 3.0 I really hope the class C: pass class C(): pass class C(object): pass will mean the same

Re: Why new Python 2.5 feature class C() return old-style class ?

2006-04-11 Thread bruno at modulix
looping wrote: bruno at modulix wrote: looping wrote: Peter Hansen wrote: Georg Brandl wrote: class C(): is meant to be synonymous with class C: and therefore cannot create a new-style class. I think looping understands that, but is basically asking why anyone is bothering with a

Override on terminal

2006-04-11 Thread fivestars
Hi there. I'm computer science student at the end of my degree. I'm new about python. I've a question for all of you. Do you know how to write, from python code, on a unix(linux) terminal on specified coordinates? And also: is it possible to override, from python code, something on a

Re: setting up mod_python handlers on a server?

2006-04-11 Thread Gerard Flanagan
John Salerno wrote: I get this internal error message when I try to access a PSP page: Invalid command 'PythonHandler', perhaps mis-spelled or defined by a module not included in the server configuration So it seems that mod_python is not fully configured yet to handled PSP pages. When I

Re: Creating an event loop

2006-04-11 Thread Michele Simionato
Fabian Steiner wrote: Hello! I am currently wondering how to write something like an event loop. For example, if I want to write a function that checks whether a file was added or removed in a directory I would think of a while 1: ... construct that checks the mtime of the directory. Is this

Re: [fcntl]how to lock a file

2006-04-11 Thread marcello
Carl J. Van Arsdall wrote: [...] If you end up having problems working with the python fcntl module let me know your configuration I'd be interested to see if anyone else had similar problems to me. Python 2.2.3 (#1, Aug 8 2003, 08:44:02) [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-13)]

Terminal Emulation Modules?

2006-04-11 Thread lysdexia
I am attempting to screen scrape SuperDOS, an extremely closed system that uses wyse 60 terminals to communicate with a dos machine. I have not been able to communicate properly with superdos until trying the handy miniterm.py example from the pyserial package in conjunction with Markus

Re: Why new Python 2.5 feature class C() return old-style class ?

2006-04-11 Thread Duncan Booth
bruno at modulix wrote: cause is bother me to type (object) when I don't need their features. Please repeat this 101 times each morning: thou shall not use old-style classes for they are deprecated. It's a pity though that Python still uses old-style classes internally, even for some

list.clear() missing?!?

2006-04-11 Thread Ville Vainio
I tried to clear a list today (which I do rather rarely, considering that just doing l = [] works most of the time) and was shocked, SHOCKED to notice that there is no clear() method. Dicts have it, sets have it, why do lists have to be second class citizens? --

Re: Why new Python 2.5 feature class C() return old-style class ?

2006-04-11 Thread Aahz
In article [EMAIL PROTECTED], bruno at modulix [EMAIL PROTECTED] wrote: Please repeat this 101 times each morning: thou shall not use old-style classes for they are deprecated. Classic classes are *NOT* deprecated. And Python for Dummies will make that clear (though we will note that there are

Re: setting up mod_python handlers on a server?

2006-04-11 Thread John Salerno
Gerard Flanagan wrote: and I think what you want is: AddHandler mod_python .psp PythonHandler mod_python.psp This is what I have in my htaccess file (along with debugging). But there is also an option in the control panel to set new handlers and extensions on the server, but I'm not sure

Re: list.clear() missing?!?

2006-04-11 Thread Fredrik Lundh
Ville Vainio wrote: I tried to clear a list today (which I do rather rarely, considering that just doing l = [] works most of the time) and was shocked, SHOCKED to notice that there is no clear() method. Dicts have it, sets have it, why do lists have to be second class citizens? because

Re: Unicode, command-line and idle

2006-04-11 Thread a . serrano
Hello again, I've investigated a little bit and this is what I found: If I run IDLE and type import sys sys.stdin.encoding I get 'cp1252' But if I have a whatever.py file (it can even be a blank file), I edit it with IDLE, I press F5 (Run Module) and then type: import sys

Removing an item from a QListView in PyQt

2006-04-11 Thread Svenn Bjerkem
Hi, I am looking for a bit more elaboration on the problem of deleting elements from a QListsView. I know this is a tricky problem with references, but I have not been able to extract enough knowledge from the documentation to solve a specific problem: In a dialog I have a QListView called

Re: Why new Python 2.5 feature class C() return old-style class ?

2006-04-11 Thread Peter Otten
Aahz wrote: The whole point of adding the () option to classes was to ease the learning process for newbies who don't understand why classes have a different syntax from functions. That cuts both ways. Now a determined newbie won't understand why def f: pass and bases = A, B class

Re: Application Generators

2006-04-11 Thread walterbyrd
In case anybody is interested, here is an update on my reviews for code generators: AppGini PHPMagic. ($35 - $70) Cheap and easy to use, but not very functional. Okay if you are making flat-file, unsecure, CRUD. No authentication. No real relational functionallity. No event triggers.

[OT] Re: a unicode question?

2006-04-11 Thread Peter Otten
John Machin wrote: ... and yes Peter, info travels faster also from China that it does from Armenia :-()) Q: Can info travel faster from Armenia than from China? Radio Yerevan: In principle, yes. Just make sure that it doesn't go the other way round the globe or meets some friends on the

Re: Override on terminal

2006-04-11 Thread Peter Hansen
fivestars wrote: Do you know how to write, from python code, on a unix(linux) terminal on specified coordinates? Search for the curses module. And also: is it possible to override, from python code, something on a unix(linux) terminal? The word override is ambiguous here (actually it's just

  1   2   3   >