Re: Python analog of Ruby on Rails?

2005-05-27 Thread Ville Vainio
Shane == Shane Hathaway [EMAIL PROTECTED] writes: Shane BTW, here's the proper response to that religious thread Shane that keeps invading this list: Shane python -c 'print sum([ord(c) for c in HOLYBIBLE])' Shane I'm Christian and I think it's funny. ;-) Some background:

Re: using timeit for a function in a class

2005-05-27 Thread Fredrik Lundh
flupke wrote: ? i think you missed some of the code ... s = test = TimeTest() test.f() ... So the function is being called (as i said, it prints the hello message). timeit is a benchmark utility. it's supposed to call your function enough times to get an accurate

Re: Access from one class to methode of other class

2005-05-27 Thread Aaron Bingham
Dennis Lee Bieber [EMAIL PROTECTED] writes: On Thu, 26 May 2005 14:33:45 +0200, VK myname@example.invalid declaimed the following in comp.lang.python: Hi, all! In my programm i have to insert a variable from class 2 to class 1 and I get error NameError: global name 'd' is not defined.

More Rewrite Request Within SocketServer?

2005-05-27 Thread John Abel
OK, I'm guessing what I was after ( see below ) isn't possible. Does anyone know of an easy way of having verify_request inform the request handler of certain events, say client is unauthorised? I thought of having it set a flag, and referring to it from the handler class (

Re: More Rewrite Request Within SocketServer?

2005-05-27 Thread Paul Rubin
John Abel [EMAIL PROTECTED] writes: OK, I'm guessing what I was after ( see below ) isn't possible. Does anyone know of an easy way of having verify_request inform the request handler of certain events, say client is unauthorised? I thought of having it set a flag, and referring to it from

Re: More Rewrite Request Within SocketServer?

2005-05-27 Thread John Abel
Paul Rubin wrote: John Abel [EMAIL PROTECTED] writes: OK, I'm guessing what I was after ( see below ) isn't possible. Does anyone know of an easy way of having verify_request inform the request handler of certain events, say client is unauthorised? I thought of having it set a flag, and

Re: Running a python program during idle time only

2005-05-27 Thread Shane Hathaway
Mike Meyer wrote: On a completely different topic, this looks like the wrong way to solve the problem. You want to update a search engine based on changes to the underlying file system. The right way to do this isn't to just keep rescanning the file system, it's to arrange things so that your

Re: More Rewrite Request Within SocketServer?

2005-05-27 Thread Paul Rubin
John Abel [EMAIL PROTECTED] writes: Unfortunately not. verify_request is called before process_request which launches the thread ( in the ThreadingMixIn version ). Unless I passed the flag as an argument to the thread, and then had it reset. Hm, worth thinking about, If verify_request

Re: Running a python program during idle time only

2005-05-27 Thread John Abel
Shane Hathaway wrote: Mike Meyer wrote: On a completely different topic, this looks like the wrong way to solve the problem. You want to update a search engine based on changes to the underlying file system. The right way to do this isn't to just keep rescanning the file system, it's to

Re: how to accomplish dl progress bars?

2005-05-27 Thread Edvard Majakari
flamesrock [EMAIL PROTECTED] writes: Certain web applications, everything from wget to downloader for X has this nifty feature I'd like to accomplish in python. Its the progress bar/time elapsed/time remaining scheme Filename | Progress| Speed (kB/s) | T/Elapsed | T/Remaining

Re: Running a python program during idle time only

2005-05-27 Thread John Abel
John Abel wrote: Shane Hathaway wrote: Mike Meyer wrote: On a completely different topic, this looks like the wrong way to solve the problem. You want to update a search engine based on changes to the underlying file system. The right way to do this isn't to just keep rescanning the

Re: More Rewrite Request Within SocketServer?

2005-05-27 Thread John Abel
Paul Rubin wrote: If verify_request is finished before the new thread starts, then I'd think it could set a flag and the new thread could find it. You get a race condition only if both threads are trying to mess with the flag simultaneously. Hmm, I think you're right. Thanks! J --

Re: Case Sensitive, Multiline Comments

2005-05-27 Thread Duncan Booth
Dennis Lee Bieber wrote: On 26 May 2005 17:33:33 -0700, Elliot Temple [EMAIL PROTECTED] declaimed the following in comp.lang.python: Thanks for the link on case sensitivity. I'm curious about the person who found case sensitivity useful though: what is it useful for? Making a

Re: ftplib fails when directory name contains spaces

2005-05-27 Thread Manu
Oops..It was my mistake :(. Directory name with spaces work by default. -- http://mail.python.org/mailman/listinfo/python-list

Re: Running a python program during idle time only

2005-05-27 Thread John Abel
Shane Hathaway wrote: Mike Meyer wrote: On a completely different topic, this looks like the wrong way to solve the problem. You want to update a search engine based on changes to the underlying file system. The right way to do this isn't to just keep rescanning the file system, it's to

Re: Writing a bytecode interpreter (for TeX dvi files)

2005-05-27 Thread Andreas Lobinger
Aloha, Jonathan Fine wrote: I'm writing some routines for handling dvi files. In case you didn't know, these are TeX's typeset output. These are binary files containing opcodes. I wish to write one or more dvi opcode interpreters. Are there any tools or good examples to follow for writing a

[OT] Re: Python analog of Ruby on Rails?

2005-05-27 Thread d'yeux le pair
Shane Hathaway a écrit : BTW, here's the proper response to that religious thread that keeps invading this list: python -c 'print sum([ord(c) for c in HOLYBIBLE])' I'm Christian and I think it's funny. ;-) Aha. Notice that the Original Sin story admits a defensible reading while

Re: What are OOP's Jargons and Complexities?

2005-05-27 Thread Piet van Oostrum
Xah Lee [EMAIL PROTECTED] (XL) wrote: XL Joe: lang x is strongly typed XL Dave: you mean statically typed? XL John: no no, that's weakly typed. That should have been `weekly typed', according to the link below. Maybe there is also `daily typed' or `monthly typed'? XL

Xml writing in Python and verifying using XSD

2005-05-27 Thread Prashanth Ellina
Hi, I need to write some data to an xml file. I have an XML Schema defined. I would like to use some mechanism of writing the data to the xml file and having exceptions thrown back to me when the data is invalid. I have looked at xml.dom and xml.dom.minidom but could not figure out what to do to

CygWin ODBC

2005-05-27 Thread Simon Faulkner
Hi All, I am new to Cygwin and am hoping that someone here will be able to tell me how to get ODBC running in Python on Cygwin. Maximum gratefullness... Simon -- http://mail.python.org/mailman/listinfo/python-list

struct unpack newline

2005-05-27 Thread grant
Hi All, I am pretty new to python and am having a problem intepreting binary data using struct.unpack. I am reading a file containing binary packed data using open with rb. All the values are coming through fine when using (integer1,) = struct.unpack('l', line[86:90]) except when line[86:90]

Re: struct unpack newline

2005-05-27 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: I am pretty new to python and am having a problem intepreting binary data using struct.unpack. I am reading a file containing binary packed data using open with rb. All the values are coming through fine when using (integer1,) = struct.unpack('l', line[86:90])

Re: Intellisense and the psychology of typing

2005-05-27 Thread EventHelix.com
Intellisense does improve programmer productivity as you do not have to keep opening header files to refer to the interfaces. In VC++ the intellisense display also shows the function header comment, so you have full access to the information about the interface. Deepa -- EventStudio 2.5 -

[ANN] pylint 0.7

2005-05-27 Thread Sylvain Thénault
Hello all ! I'm pleased to announce a new release of PyLint. I've been promising a 1.0 release some time ago, but it appears I've not enough time yet to do the polishing I wish, and since the latest (0.6.4) release has a few really annoying bugs (mainly related to options handling), I eventually

Re: struct unpack newline

2005-05-27 Thread Richard Brodie
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] except when line[86:90] contains carriage-return linefeed which are valid binary packed values. You probably don't want to be reading binary data a line at a time, if that's what you're doing. --

Incrementing letters

2005-05-27 Thread Michael
Hi, I've got a string s, and i want to shift all the letters up by one, eg a-b, b-c z-a In c++ i can do this quite simply with if(C == 'z') C='a'; else C++; but i can't work out how to do this this in python?? Regards Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Incrementing letters

2005-05-27 Thread Heiko Wundram
Am Freitag, 27. Mai 2005 13:31 schrieb Michael: if(C == 'z') C='a'; else C++; if C == z: C = a else: C = chr(ord(C)+1) -- --- Heiko. see you at: http://www.stud.mh-hannover.de/~hwundram/wordpress/ pgpC3uVPL36vD.pgp Description: PGP signature --

Re: Strange Execution Times

2005-05-27 Thread John Machin
Elliot Temple wrote: On May 26, 2005, at 3:22 PM, John Machin wrote: Then post your summarised results back to the newsgroup for the benefit of all -- there's this vague hope that folk actually read other peoples' posts before firing off questions :-) Here is my new version. It

Strings for a newbie

2005-05-27 Thread Malcolm Wooden
I'm trying to get my head around Python but seem to be failing miserably. I use RealBasic on a Mac and find it an absolute dream! But PythonUGH! I want to put a sentence of words into an array, eg This is a sentence of words In RB it would be simple: Dim s as string Dim a(-1) as string

Re: Strings for a newbie

2005-05-27 Thread Mage
Malcolm Wooden wrote: In RB it would be simple: Dim s as string Dim a(-1) as string Dim i as integer s = This is a sentence of words For i = 1 to CountFields(s, ) a.append NthField(s, ,i) next That's it an array a() containing the words of the sentence. Now can I see how this is done in

Re: Strings for a newbie

2005-05-27 Thread John Machin
Malcolm Wooden wrote: I'm trying to get my head around Python but seem to be failing miserably. I use RealBasic on a Mac and find it an absolute dream! But PythonUGH! I want to put a sentence of words into an array, eg This is a sentence of words In RB it would be simple: Dim s

Re: Strings for a newbie

2005-05-27 Thread Wolfram Kraus
Malcolm Wooden wrote: I'm trying to get my head around Python but seem to be failing miserably. I use RealBasic on a Mac and find it an absolute dream! But PythonUGH! I want to put a sentence of words into an array, eg This is a sentence of words In RB it would be simple: Dim s

Re: Incrementing letters

2005-05-27 Thread Wolfram Kraus
Heiko Wundram wrote: Am Freitag, 27. Mai 2005 13:31 schrieb Michael: if(C == 'z') C='a'; else C++; if C == z: C = a else: C = chr(ord(C)+1) According to the OP's problem (with the assumption that only characters from a-z are given) he might even try a lil LC: s = shiftthis

Re: Strings for a newbie

2005-05-27 Thread Sergei Organov
Malcolm Wooden [EMAIL PROTECTED] writes: I'm trying to get my head around Python but seem to be failing miserably. I use RealBasic on a Mac and find it an absolute dream! But PythonUGH! I want to put a sentence of words into an array, eg This is a sentence of words In RB it would

Re: Incrementing letters

2005-05-27 Thread Duncan Booth
Michael wrote: Hi, I've got a string s, and i want to shift all the letters up by one, eg a-b, b-c z-a In c++ i can do this quite simply with if(C == 'z') C='a'; else C++; but i can't work out how to do this this in python?? import string upone = string.maketrans(

VIRUS WARNING W32/Mydoom.O@mm

2005-05-27 Thread viruscontrol
This is a notice from Architec hosting. You sent an email infected with a virus. Please take action and clean your computerReceived: (qmail 16811 invoked from network); 27 May 2005 12:23:38 - Received: from unknown (HELO python.org) (81.199.115.158) by server8.architec.co.uk with SMTP;

Re: Strings for a newbie

2005-05-27 Thread Malcolm Wooden
Sorry John but that don't do it for me. Just get errors comming back John Machin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Malcolm Wooden wrote: I'm trying to get my head around Python but seem to be failing miserably. I use RealBasic on a Mac and find it an absolute dream!

Re: Strings for a newbie

2005-05-27 Thread John Machin
Malcolm Wooden wrote: Sorry John but that don't do it for me. Just get errors comming back John Machin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] s = This is a sentence of words a = s.split() a ['This', 'is', 'a', 'sentence', 'of', 'words'] Malcolm, What errors did

write to the same file from multiple processes at the same time?

2005-05-27 Thread gabor
hi, what i want to achieve: i have a cgi file, that writes an entry to a text-file.. like a log entry (when was it invoked, when did his worke end). it's one line of text. the problem is: what happens if 2 users invoke the cgi at the same time? and it will happen, because i am trying now to

Re: Xml writing in Python and verifying using XSD

2005-05-27 Thread Diez B. Roggisch
Prashanth Ellina wrote: Hi, I need to write some data to an xml file. I have an XML Schema defined. I would like to use some mechanism of writing the data to the xml file and having exceptions thrown back to me when the data is invalid. I have looked at xml.dom and xml.dom.minidom but

Re: write to the same file from multiple processes at the same time?

2005-05-27 Thread Paul Rubin
gabor [EMAIL PROTECTED] writes: so, how does one synchronizes several processes in python? first idea was that the cgi will create a new temp file every time, and at the end of the stress-test, i'll collect the content of all those files. but that seems as a stupid way to do it :( There was

Re: Case Sensitive, Multiline Comments

2005-05-27 Thread Szabolcs Nagy
i found case sensitivity very useful 1. variables can be stored in a dict (think about __dict__, globals()) and dict type should be case sensitive 2. It's necessary when i write short scripts and i use one letter names. (eg. when i playing with linear algebra i always use a,b,c for vectors and

Re: Strings for a newbie

2005-05-27 Thread Malcolm Wooden
my actual code is: for x in range(len(l)): h = string.split(l[x]) where the sentence string is in an array of one element 'l' Error is: Traceback (most recent call last): File string, line 34, in ? File string, line 27, in SentenceText File C:\PYTHON22\lib\string.py, line 122, in

Re: write to the same file from multiple processes at the same time?

2005-05-27 Thread Roy Smith
gabor [EMAIL PROTECTED] wrote: so, how does one synchronizes several processes in python? This is a very hard problem to solve in the general case, and the answer depends more on the operating system you're running on than on the programming language you're using. On the other hand, you said

Re: write to the same file from multiple processes at the same time?

2005-05-27 Thread Peter Hansen
Roy Smith wrote: gabor [EMAIL PROTECTED] wrote: On the other hand, you said that each process will be writing a single line of output at a time. If you call flush() after each message is written, that should be enough to ensure that the each line gets written in a single write system

Re: Strings for a newbie

2005-05-27 Thread Wolfram Kraus
Malcolm Wooden wrote: my actual code is: for x in range(len(l)): h = string.split(l[x]) where the sentence string is in an array of one element 'l' Error is: Traceback (most recent call last): File string, line 34, in ? File string, line 27, in SentenceText File

Re: write to the same file from multiple processes at the same time?

2005-05-27 Thread Paul Rubin
Peter Hansen [EMAIL PROTECTED] writes: The OP was probably on the right track when he suggested that things like SQLite (conveniently wrapped with PySQLite) had already solved this problem. But they haven't. They depend on messy things like server processes constantly running, which goes

Re: Strings for a newbie

2005-05-27 Thread Malcolm Wooden
Yes Sergei, as 3 of the lines are Dim statements, the real code is just 4 lines, a totally logical. It's not the amout of code thats a probelm, it's following the logic and structure thats important. As I said Python.. UGH! Malcolm Sergei Organov [EMAIL PROTECTED] wrote in message

Re: write to the same file from multiple processes at the same time?

2005-05-27 Thread Roy Smith
Peter Hansen [EMAIL PROTECTED] wrote: The OP was probably on the right track when he suggested that things like SQLite (conveniently wrapped with PySQLite) had already solved this problem. Perhaps, but a relational database seems like a pretty heavy-weight solution for a log file. --

Re: write to the same file from multiple processes at the same time?

2005-05-27 Thread Jp Calderone
On 27 May 2005 06:21:21 -0700, Paul Rubin http://phr.cx@nospam.invalid wrote: Peter Hansen [EMAIL PROTECTED] writes: The OP was probably on the right track when he suggested that things like SQLite (conveniently wrapped with PySQLite) had already solved this problem. But they haven't. They

Copy paste in entry widget

2005-05-27 Thread Michael Onfrek
Hi, is copy, paste, cut of selection possible in entry widget? Docs say selection must be copied by default, in my programm it doesn't work. Regards, M.O. -- http://mail.python.org/mailman/listinfo/python-list

Re: write to the same file from multiple processes at the same time?

2005-05-27 Thread fraca7
gabor a écrit : [snip] Try this: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203 -- http://mail.python.org/mailman/listinfo/python-list

Re: __init__() not called automatically

2005-05-27 Thread Simon Brunning
On 26 May 2005 11:54:33 -0400, Roy Smith [EMAIL PROTECTED] wrote: And the correlary wart in Python is that the first argument to a method is not required to be called self. The vast majority of people use self, but every once in a great while you run into some yahoo who feels this is the

RE: Strings for a newbie

2005-05-27 Thread Marc Boeren
Hi Malcolm, It's not the amout of code thats a probelm, it's following the logic and structure thats important. As I said Python.. UGH! Do you find .. s = This is a sentence of words .. a = s.split(' ') less readable or logical than .. s = This is a sentence of words .. For i = 1 to

a html parse problem

2005-05-27 Thread cheng
hi,all if the html like: meta name = description content = a test page meta name = keywords content = keyword1 keyword2 if i use: def handle_starttag(self, tag, attrs): if tag == 'meta': self.attr = attrs self.headers += ['%s' % (self.attr)] self.attr =

Re: write to the same file from multiple processes at the same time?

2005-05-27 Thread Paul Rubin
Jp Calderone [EMAIL PROTECTED] writes: But they haven't. They depend on messy things like server processes constantly running, which goes against the idea of a cgi that only runs when someone calls it. SQLite is an in-process dbm. http://www.sqlite.org/faq.html#q7 (7) Can multiple

Re: Strings for a newbie

2005-05-27 Thread Kalle Anka
Malcolm Wooden mwooden at dtptypes.com writes: Yes Sergei, as 3 of the lines are Dim statements, the real code is just 4 lines, a totally logical. It's not the amout of code thats a probelm, it's following the logic and structure thats important. As I said Python.. UGH! Since I both use RB

Re: write to the same file from multiple processes at the same time?

2005-05-27 Thread Gerhard Haering
On Fri, May 27, 2005 at 09:27:38AM -0400, Roy Smith wrote: Peter Hansen [EMAIL PROTECTED] wrote: The OP was probably on the right track when he suggested that things like SQLite (conveniently wrapped with PySQLite) had already solved this problem. Perhaps, but a relational database

Re: Case Sensitive, Multiline Comments

2005-05-27 Thread Brian van den Broek
Duncan Booth said unto the world upon 2005-05-27 04:24: snip There are arguments that, especially for beginners, case sensitivity introduces an extra level of complexity, but the cost of losing this complexity would be to make Python a poor relation amongst programming languages. Well,

Re: Strings for a newbie

2005-05-27 Thread Kalle Anka
Malcolm Wooden mwooden at dtptypes.com writes: I want to put a sentence of words into an array, eg This is a sentence of words In RB it would be simple: Dim s as string Dim a(-1) as string Dim i as integer s = This is a sentence of words For i = 1 to CountFields(s, ) a.append

Re: write to the same file from multiple processes at the same time?

2005-05-27 Thread jean-marc
Sorry, why is the temp file solution 'stupid'?, (not aesthetic-pythonistic???) - it looks OK: simple and direct, and certainly less 'heavy' than any db stuff (even embedded) And collating in a 'official log file' can be done periodically by another process, on a time-scale that is 'useful' if

Re: Incrementing letters

2005-05-27 Thread Wolfram Kraus
Duncan Booth wrote: Michael wrote: Hi, I've got a string s, and i want to shift all the letters up by one, eg a-b, b-c z-a In c++ i can do this quite simply with if(C == 'z') C='a'; else C++; but i can't work out how to do this this in python?? import string upone =

Re: write to the same file from multiple processes at the same time?

2005-05-27 Thread Jp Calderone
On 27 May 2005 06:43:04 -0700, Paul Rubin http://phr.cx@nospam.invalid wrote: Jp Calderone [EMAIL PROTECTED] writes: But they haven't. They depend on messy things like server processes constantly running, which goes against the idea of a cgi that only runs when someone calls it. SQLite is

Re: a html parse problem

2005-05-27 Thread bruno modulix
cheng wrote: hi,all if the html like: meta name = description content = a test page meta name = keywords content = keyword1 keyword2 if i use: def handle_starttag(self, tag, attrs): if tag == 'meta': self.attr = attrs self.headers += ['%s' %

Re: Strings for a newbie

2005-05-27 Thread bruno modulix
Malcolm Wooden wrote: I'm trying to get my head around Python but seem to be failing miserably. I use RealBasic on a Mac and find it an absolute dream! But PythonUGH! Strange enough, Rb was one of my first languages, and last time I played with it, I founhd it was close to a nightmare when

Re: Strings for a newbie

2005-05-27 Thread bruno modulix
Malcolm Wooden wrote: (top post corrected) John Machin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Malcolm Wooden wrote: (snip useless rant) I want to put a sentence of words into an array, eg This is a sentence of words In RB it would be simple: (snip 'simple' example)

Re: Is Python suitable for a huge, enterprise size app?

2005-05-27 Thread Dieter Maurer
Fredrik Lundh [EMAIL PROTECTED] writes on Tue, 24 May 2005 22:38:05 +0200: ... nothing guarantees that, of course. but I've never seen that happen. and I'm basing my comments on observed behaviour in real systems, not on theoretical worst-case scenarios. I observed in real systems (Zope)

Re: python24.zip

2005-05-27 Thread Dieter Maurer
Martin v. Löwis [EMAIL PROTECTED] writes on Tue, 24 May 2005 23:58:03 +0200: ... 10.000 failing opens -- a cause for significant IO during startup ? ... So I would agree that IO makes a significant part of startup, but I doubt it is directory reading (unless perhaps you have an absent NFS

Re: python24.zip

2005-05-27 Thread Dieter Maurer
Scott David Daniels [EMAIL PROTECTED] writes on Wed, 25 May 2005 07:10:00 -0700: ... I'll bet this means that the 'zope.zip', 'python24.zip' would drop you to about 12500 - 1 = 2500 failing opens. That should be an easy test: sys.path.insert(0, 'zope.zip') or whatever. If that works and

Re: Case Sensitive, Multiline Comments

2005-05-27 Thread John Roth
Duncan Booth [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dennis Lee Bieber wrote: On 26 May 2005 17:33:33 -0700, Elliot Temple [EMAIL PROTECTED] declaimed the following in comp.lang.python: Thanks for the link on case sensitivity. I'm curious about the person who found case

Re: Incrementing letters

2005-05-27 Thread Simon Brunning
On 5/27/05, Michael [EMAIL PROTECTED] wrote: Hi, I've got a string s, and i want to shift all the letters up by one, eg a-b, b-c z-a In c++ i can do this quite simply with if(C == 'z') C='a'; else C++; but i can't work out how to do this this in python?? Here's one that works

Re: write to the same file from multiple processes at the same time?

2005-05-27 Thread Grant Edwards
On 2005-05-27, Peter Hansen [EMAIL PROTECTED] wrote: Roy Smith wrote: gabor [EMAIL PROTECTED] wrote: On the other hand, you said that each process will be writing a single line of output at a time. If you call flush() after each message is written, that should be enough to ensure that the

Re: Incrementing letters

2005-05-27 Thread Dan Sommers
On Fri, 27 May 2005 16:10:32 +0200, Wolfram Kraus [EMAIL PROTECTED] wrote: Duncan Booth wrote: import string upone = string.maketrans( 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 'bcdefghijklmnopqrstuvwxyzaBCDEFGHIJKLMNOPQRSTUVWXYZA') string.translate(I've got a string s,

cpu usage limit

2005-05-27 Thread mmf
Hi. My problem: How can I make sure that a Python process does not use more that 30% of the CPU at any time. I only want that the process never uses more, but I don't want the process being killed when it reaches the limit (like it can be done with resource module). Can you help me? Thanks in

Re: cpu usage limit

2005-05-27 Thread rbt
mf wrote: Hi. My problem: How can I make sure that a Python process does not use more that 30% of the CPU at any time. I only want that the process never uses more, but I don't want the process being killed when it reaches the limit (like it can be done with resource module). Can you

passing C++ parameters to a function

2005-05-27 Thread Stormbringer
Greetings, I was trying to use pyopengl - which is imported into python using SWIG - when I stumbled upon the following function with the C++ definition: void glShaderSourceARB(GLhangleARB shader, GLuint number_strings, const GLcharARB** strings, Glint * length); this is imported inside

Re: Incrementing letters

2005-05-27 Thread Duncan Booth
Dan Sommers wrote: Wolfram Kraus [EMAIL PROTECTED] wrote: Duncan Booth wrote: import string upone = string.maketrans( 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 'bcdefghijklmnopqrstuvwxyzaBCDEFGHIJKLMNOPQRSTUVWXYZA') string.translate(I've got a string s, upone)

Re: CygWin ODBC

2005-05-27 Thread Steve Holden
Simon Faulkner wrote: Hi All, I am new to Cygwin and am hoping that someone here will be able to tell me how to get ODBC running in Python on Cygwin. Maximum gratefullness... Simon There's a trick to this which involves recompiling from source. If you aren't experienced with

Re: Case Sensitive, Multiline Comments

2005-05-27 Thread Duncan Booth
John Roth wrote: Doing case translations in Unicode following all of the rules for all of the world's languages is, for want of a better world, a real bitch. Fair point, although that is true for anything, not just case translations. Fortunately, unlike Ecmascript, Python doesn't allow

Re: Intellisense and the psychology of typing

2005-05-27 Thread Brian Beck
Well, there are two distinct features of IntelliSense as you know it. One is auto-completion and the other is contextual help. Auto-completion is included almost all beefy Python IDE's. Contextual help is included even in IDLE, where if you begin typing a function call, its docstring pops up

Re: cpu usage limit

2005-05-27 Thread garabik-news-2005-05
rbt [EMAIL PROTECTED] wrote: mf wrote: Hi. My problem: How can I make sure that a Python process does not use more that 30% of the CPU at any time. I only want that the process never uses more, but I don't want the process being killed when it reaches the limit (like it can be done with

Re: Incrementing letters

2005-05-27 Thread Rocco Moretti
Dan Sommers wrote: On Fri, 27 May 2005 16:10:32 +0200, Wolfram Kraus [EMAIL PROTECTED] wrote: Duncan Booth wrote: import string upone = string.maketrans( 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 'bcdefghijklmnopqrstuvwxyzaBCDEFGHIJKLMNOPQRSTUVWXYZA')

Re: cpu usage limit

2005-05-27 Thread Markus Franz
Are you looping during a cpu intensive task? If so, make it sleep a bit like this: for x in cpu_task: time.sleep(0.5) do(x) No, I don't use an intensive loop. I have about 1200 lines of code inside a process - is there nothing like xyz.setlimit(xyz.cpu, 0.30) ??? Thank. Markus

Re: cpu usage limit

2005-05-27 Thread rbt
[EMAIL PROTECTED] wrote: rbt [EMAIL PROTECTED] wrote: mf wrote: Hi. My problem: How can I make sure that a Python process does not use more that 30% of the CPU at any time. I only want that the process never uses more, but I don't want the process being killed when it reaches the limit (like

Re: cpu usage limit

2005-05-27 Thread Grant Edwards
On 2005-05-27, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: How can I make sure that a Python process does not use more that 30% of the CPU at any time. I only want that the process never uses more, but I don't want the process being killed when it reaches the limit (like it can be done with

Re: CygWin ODBC

2005-05-27 Thread Simon Faulkner
Steve Holden wrote: Simon Faulkner wrote: Hi All, I am new to Cygwin and am hoping that someone here will be able to tell me how to get ODBC running in Python on Cygwin. Maximum gratefullness... Simon There's a trick to this which involves recompiling from source. If you aren't

Re: python24.zip

2005-05-27 Thread Steve Holden
Dieter Maurer wrote: Steve Holden [EMAIL PROTECTED] writes on Sun, 22 May 2005 16:19:10 -0400: ... Indeed I have written PEP 302-based code to import from a relational database, but I still don't believe there's any satisfactory way to have [such a hooked import mechanism] be a first-class

Re: Case Sensitive, Multiline Comments

2005-05-27 Thread Elliot Temple
One other interesting thing about case sensitivity I don't think anyone has mentioned: in Python keywords are all lowercase already (the way I want to type them). In some other languages, they aren't... -- Elliot Temple http://www.curi.us/ --- [This E-mail scanned for viruses by Declude

Re: python24.zip

2005-05-27 Thread Steve Holden
Martin v. Löwis wrote: Scott David Daniels wrote: Is the interpreter unable to call C functions (stat for example) to determine whether an object exists before it puts it on path. What do you mean, unable to? It just doesn't. In fact, the interpreter doesn't necessarily know when it is

Inheritance, polymorphism, and introspection in Python

2005-05-27 Thread combinational.logic $ soc-ip.com
The following website (http://www.soc-ip.com/weblog) has an example of inheritance, polymorphism, and introspection in Python. The example shows a simple classification system for microprocessors. Hopefully someone will find this interesting / useful. --

lambda a plusieurs arguments

2005-05-27 Thread nico
Bonjour, Comment faire une fonction lambda a plusieurs arguments ? (lambda a:a+1)(2) 3 f=(lambda (a,b):a+b) f(5,6) Traceback (most recent call last): File stdin, line 1, in ? TypeError: lambda() takes exactly 1 argument (2 given) f((5.6)) Traceback (most recent call last): File stdin,

Re: Strings for a newbie

2005-05-27 Thread Steve Holden
Malcolm Wooden wrote: Yes Sergei, as 3 of the lines are Dim statements, the real code is just 4 lines, a totally logical. It's not the amout of code thats a probelm, it's following the logic and structure thats important. As I said Python.. UGH! Malcolm Yes, the weirdest thing about the

Does Python have a Template::Extract equivalent from Perl's CPAN

2005-05-27 Thread [EMAIL PROTECTED]
Hi All, I already searched this newsgroup and google groups to see if I could find a Python equivalent to Perl's Template::Extract, but didn't find anything leading to a Python module that had similar functionality. I am a big fan of Python as an OO language and use it for many system admin

Re: Does Python have a Template::Extract equivalent from Perl's CPAN

2005-05-27 Thread [EMAIL PROTECTED]
should have read, if nobody is aware of any module... not if nobody is not aware -- http://mail.python.org/mailman/listinfo/python-list

Re: Does Python have a Template::Extract equivalent from Perl's CPAN

2005-05-27 Thread combinational.logic $ soc-ip.com
Can you please elaborate on how to use Python for MS Excel AddIn development? Is this easy to do? I would love to be able to create custom extensions to Excel using python! IMHO Python is much better than Perl due to its OOP features. Cheers, CL --

Re: lambda a plusieurs arguments

2005-05-27 Thread Jp Calderone
On Fri, 27 May 2005 19:38:33 +0200, nico [EMAIL PROTECTED] wrote: Bonjour, Comment faire une fonction lambda a plusieurs arguments ? (lambda a:a+1)(2) 3 f=(lambda (a,b):a+b) f(5,6) Traceback (most recent call last): File stdin, line 1, in ? TypeError: lambda() takes exactly 1 argument (2

distutils, 'scripts' and Windows

2005-05-27 Thread George van den Driessche
Hi folks, I'm looking at packaging a project I'm working on using distutils. The project is for Windows and contains a COM server which needs registration, so the installer needs to be a little more complicated than usual. Looking at the options for the bdist_wininst command to distutils, I

Python/Excel AddIn (was:Re: Does Python have a Template::Extract equivalent from Perl's CPAN)

2005-05-27 Thread Paul McNett
Please start a new thread when appropriate. combinational.logic $ soc-ip.com wrote: Can you please elaborate on how to use Python for MS Excel AddIn development? Is this easy to do? I would love to be able to create custom extensions to Excel using python! IMHO Python is much better than

Re: What are OOP's Jargons and Complexities?

2005-05-27 Thread James Stroud
On Friday 27 May 2005 02:15 am, Piet van Oostrum wrote: Xah Lee [EMAIL PROTECTED] (XL) wrote: XL Joe: lang x is strongly typed XL Dave: you mean statically typed? XL John: no no, that's weakly typed. That should have been `weekly typed', according to the link below. Maybe there is also

Determine if windows drive letter is hard drive or optical from python?

2005-05-27 Thread mh
Hi Folks- I'm trying to do a simple emulation of unix locate functionality in python for windows. Problem is I don't want to crawl/index optical drives. Do any of the windows people out there know how I can determine: 1. How many drives are on the system? (I could just iterate over the

  1   2   >