Re: waiting for file lock?

2006-04-11 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: >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 an

Re: How can I reduce the number of queries to my PostgreSQL database?

2006-04-11 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, "SR" <[EMAIL PROTECTED]> wrote: >The script works fine, if a little slow. I think that's because if I >have 50 books in my database, my script performs 51 database queries (1 >for all book names; then 1 for each book) If your database is that small, why bother wit

using regex to remove $ sign

2006-04-11 Thread Kun
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. -- http://mail

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") > IOE

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 r

[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: http://www.vmware.com/support/reference/li

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

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 an

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 i

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: > > http:

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 > program

Re: using regex to remove $ sign

2006-04-11 Thread bearophileHUGS
Fredrik Lundh>RE? 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 ca

Re: waiting for file lock?

2006-04-11 Thread Christos Georgiou
On Tue, 11 Apr 2006 19:07:19 +1200, rumours say that Lawrence D'Oliveiro <[EMAIL PROTECTED]> might have written: >In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] wrote: > >>i need to go into a directory to grab some files and do some >>processing. >>The thing is, i need to wait till the proces

Re: Is this object counter code pythonic

2006-04-11 Thread bruno at modulix
[EMAIL PROTECTED] wrote: > Fredrik is then this a valid "property" use case and pythonic to > get/set a common varibale across objects > > class E(object): > _i = 0 > def geti(self) : return E._i > def seti(self,val) : E._i = val > i = property(geti,seti) > > if __name__ == "_

Re: About classes and OOP in Python

2006-04-11 Thread Michele Simionato
Roy Smith wrote: > 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. Wrong,

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 >>conser

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

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: > >>

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. >

Re: About classes and OOP in Python

2006-04-11 Thread bruno at modulix
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. The double-leading-underscore stuff has nothing to do with "privacy". It's meant to protect from

Re: python interpreter widget for Tkinter?

2006-04-11 Thread Alexandre Guimond
thx ian. exactly what I wanted. best, alex. -- http://mail.python.org/mailman/listinfo/python-list

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 t

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

Re: using regex to remove $ sign

2006-04-11 Thread John Machin
[EMAIL PROTECTED] wrote: > Fredrik Lundh>RE? 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 al

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 language

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: > >>

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 par

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

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, bu

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: > >>

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 language

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

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

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: > >>

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: > >>

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 t

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: Web Service SOAP - Unknown element v1

2006-04-11 Thread Simon Brunning
On 4/11/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I've already tried that, but the problem persists... Instead of saying > "Unknown element v1", it says "Unknown element title" (In my case, the > parameter name in the server is title). > > Any other suggestion? Have a look at the SOAP m

Re: writing captcha image file

2006-04-11 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > 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 ? -- http://mail.python.or

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 I

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 in

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 minilangua

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 w

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

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

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 ** > >SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; > xmlns:SOAP-ENC="http://schema

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 sol

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 sty

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 lifeti

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 deprec

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 (shou

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 neit

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

2006-04-11 Thread Georg Brandl
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 l

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

2006-04-11 Thread Duncan Booth
Alexander Myodov wrote: > So, with 2.5, I tried to utilize "with...as" construct for this, but > unsuccessfully: >from __future__ import with_statement >with 5 as k: > pass >print k > - told me that "AttributeError: 'int' object has no attribute > '__context__'". > > > So, does

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 exa

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

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

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 stumbl

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

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 sug

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

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 suggestion

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 proce

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

2006-04-11 Thread Peter Hansen
looping wrote: > But I think that if we make "class C():" a synonym of "class > C(object):", it will save lot of keystrokes ;-) Saving keystrokes has only rarely influenced Python's design, thankfully. If you read "import this", you'll see "explicit is better than implicit", and interpreting in

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

2006-04-11 Thread bruno at modulix
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 in

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

2006-04-11 Thread Alexander Myodov
Hello Duncan, You wrote: > Alexander Myodov wrote: >> So, with 2.5, I tried to utilize "with...as" construct for this, but >> unsuccessfully: >> ... >> So, does this mean that we still don't have any kind of RIIA in >> Python, any capability to localize the lifetime of variables on a >> level less

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 "", 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 miss

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') root=T

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

2006-04-11 Thread Diez B. Roggisch
>> No, it means that Python 2.5 supports 'resource initialisation is >> acquisition', but that has nothing to do with the restricting the >> lifetime of a variable. > Sorry, I misworded the question - RIIA is indeed present at least by > the reason that the examples from PEP pass. Agree, my problem

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! -- -- http://mail.python.org/mailman/li

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 -- http://mail.python.org/m

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

2006-04-11 Thread bearophileHUGS
bruno at modulix>Since 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 se

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 do

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

2006-04-11 Thread looping
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 ask

Re: Saving files from post data via sys.stdin

2006-04-11 Thread ACB
"ACB" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I am rewriting an existing PERL script I wrote several months ago. It is a >script that is used as the action for a form containing several type="file" >inputs. The script is run unbuffered and writes the data from sys.stdin 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

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 Apac

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): pa

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 m

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, Unboun

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 modulix>Since 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

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" underst

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 unix(linux)

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.

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

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-1

  1   2   3   >