Re: Weird memory consumption problem.

2005-12-20 Thread Steven D'Aprano
Bo Peng wrote: > The real code is much more complicated and I can not possibly explain > the details here. Can anyone *guess* what might go wrong? Sorry, are you saying that the code you posted does NOT have a memory leak, but you want us to find the memory leak in your real code sight unseen?

How to call function which is in one program ...

2005-12-20 Thread Shahriar Shamil Uulu
Dear All, i got another questions. For example i have two programs in python like: first.py, second.py. In first.py i have a function test() like: # first.py ... def test(name): print name so other functions = #second.py Question is how i can include first.py i

Re: canceling and joining threads

2005-12-20 Thread Antoon Pardon
Op 2005-12-19, sir_alex schreef <[EMAIL PROTECTED]>: > 1) no, i didn't; i'll go and read that function gtk.gdk.threads_init, has to be called before gtk.main if you want threads in a pygtk program. > 2) well, the actual situation is: there's the main thread (the > application itself) and then the

Re: What is unique about Python?

2005-12-20 Thread dvm1981
On Mon, 19 Dec 2005 09:55:44 -0800, gsteff wrote: > I'm a computer science student, and have recently been trying to > convince the professor who teaches the programming language design > course to consider mentioning scripting languages in the future. Along > those lines, I've been trying to thi

Re: Unable to install Python Imaging Library

2005-12-20 Thread peter . mosley
Thanks for that reply. I hadn't tried installing the Tcl and Tk development libraries - because I had no idea these that these were necessary (or that they even existed!). My first attempt to do so was a total failure, as I downloaded the RPM files from http://rpmfind.net, but immediately entered

Re: Interprocess communication and memory mapping

2005-12-20 Thread Aguilar, James
Paul This is pretty useful for me. Appreciate it! My whole point is not that I actually want to do this, but that I want to make sure that Python is powerful enough to handle this kind of thing before I really invest myself deeply into learning and using it. I do believe that parallel computing

Re: synchronized enumerate

2005-12-20 Thread Antoon Pardon
Op 2005-12-20, [EMAIL PROTECTED] schreef <[EMAIL PROTECTED]>: > What I would like to see supported is > the concept that enumerate should give indices and items from an > iterable--it does right now--but it should also allow you to access a > different portion of the original list and *still* give

Re: How to call function which is in one program ...

2005-12-20 Thread Kevin Yuan
19 Dec 2005 23:56:04 -0800, Shahriar Shamil Uulu <[EMAIL PROTECTED]>: Dear All,i got another questions. For example i have two programs in pythonlike: first.py, second.py.In first.py i have a function test() like:# first.py...def test(name):  print name so other functions==

Re: UDP socket, need help setting sending port

2005-12-20 Thread keirr
Fred, It is quite possible I've misunderstood the problem :-) but have you tried anything like import socket tc_local_port = tc_remote_port = outgoing_if = "172.16.1.2" # say remote_tc_host = "172.16.1.3" # say # udp is the default for DGRAM tc_sock = socket(s

Re: How to call function which is in one program ...

2005-12-20 Thread Fredrik Lundh
"Shahriar Shamil Uulu" wrote: > i got another questions. For example i have two programs in python > like: first.py, second.py. > In first.py i have a function test() like: > # first.py > ... > def test(name): > print name > > so other functions > = > > #second.py

How simputer COULD HAVE succeeded ?

2005-12-20 Thread news
> Staff Writer > November 3 2005 > Cell phone giant Nokia has launched a portal to manage its open > source software projects and promote community involvement. > Opensource.nokia.com[61] features Nokia open source news and > links to all of its OSS projects. > >Launched yesterday at Nokia Mo

Re: UDP socket, need help setting sending port

2005-12-20 Thread keirr
A few trivial corrections, to my own post :-( tc_sock = socket(socket... should be tc_sock = socket.socket(socket... of course and, (while I'm here) when I stated that calling connect on an unbound socket caused a ephemeral port to be assigned, I should have written "calling connect on an unboun

Re: How to call function which is in one program ...

2005-12-20 Thread Kevin Yuan
Another thing to remeber: Make sure the first.py and second.py are locateed in the same directory OR the path of first.py is in *sys.path*. Otherwise you'll get an exception. 2005/12/20, Fredrik Lundh < [EMAIL PROTECTED]>:"Shahriar Shamil Uulu" wrote: > i got another questions. For example i have t

type 'slice' is not an acceptable base type

2005-12-20 Thread Antoon Pardon
That was the message I received when I imported a self written module. All I wanted to do was experiment with subclassing slice. So I write something like: class iterslice(slice): ... And when I fired up the python interpreter >>> from vslice import * Traceback (most recent call last): File

Re: Which Python web framework is most like Ruby on Rails?

2005-12-20 Thread Ben Sizer
Paul Rubin wrote: > "Russell E. Owen" <[EMAIL PROTECTED]> writes: > > I disagree. Once you've picked a database (not trivial in itself, of > > course), you typically only have a few options for talking to in in > > Python. Also, typically either: > > - One stands out (because others have been aband

Re: ANNOUNCE; Try python beta

2005-12-20 Thread Kay Schluehr
Mike Meyer wrote: > Ok, I've given it the interface I want, and made it less of an > attractive nuisance. > > http://www.mired.org/home/mwm/try_python/ is now ready for people to > play with. There's no tutorial information on it yet, that's the next > thing to do. However, I won't be able to work

Re: ANNOUNCE; Try python beta

2005-12-20 Thread Richie Hindle
[Claudio] > The page doesn't work for me in MSIE (I am on a Windows system) [Mike] > Yeah, I know. I poked at it briefly, but couldn't figure out what was > goiing on. MSIE on the Mac doesn't work at all (no AJAT), and I don't > have regular access to a Windows box to try it on. I think it's you

Do you recommend a good artificial intelligence book?

2005-12-20 Thread Tolga
Hi, Is there anybody here interested in artificial intelligence (AI)? Yes, perhaps this thread would be more suitable for an AI usenet group and I have also posted my question there, but I want to know Python community's opinion. Could you recommend me please a good AI book to start with? I don't

xml with python <-> python deprecated - why?

2005-12-20 Thread Frank Millman
Hi all I need to pass data between a server program and a client program, both written in Python. My first thought was to use xml. The server builds up an xml string, without using any xml tools. The client uses Sax to parse the string received. Here is an example. The server passes to the clien

Re: How to create linked list automatically

2005-12-20 Thread Peter Otten
Shahriar Shamil Uulu wrote: > Thank you very much to all, > we have figured it out, how to make it work, > w=[] > for i in range(10): >  node=Node(i) >  w.append(node) > > for i in range(10): > a=w[i] > if i+1>9: >b=w[9] >a.next=b > else: >b

How to get the path of current running python script?

2005-12-20 Thread Kevin Yuan
I tried the following  getFilePath = lambda name: os.path.normpath('%s\\%s' % (sys.modules[name].prefix, sys.modules[name].__name__)) getFilePath('__main__')Traceback (most recent call last):   File "", line 1, in ?  File "", line 1, in AttributeError: 'module' object has no attribute 'pr

Re: how to lock a file in ftp site

2005-12-20 Thread Kinsley Turner
> am trying to write some information into the file, which is located in > ftp, and this file can be updated by number of people, but if at all i > download a file from the ftp to my local machine, update it and then > upload it back to ftp, and at the same time if some one else downloads > the s

Re: Do you recommend a good artificial intelligence book?

2005-12-20 Thread Paul Rubin
"Tolga" <[EMAIL PROTECTED]> writes: > Is there anybody here interested in artificial intelligence (AI)? Yes, > perhaps this thread would be more suitable for an AI usenet group and I > have also posted my question there, but I want to know Python > community's opinion. Could you recommend me please

Re: How to get the path of current running python script?

2005-12-20 Thread Tim Williams (gmail)
On 20/12/05, Kevin Yuan <[EMAIL PROTECTED]> wrote: I tried the following  getFilePath = lambda name: os.path.normpath('%s\\%s' % (sys.modules[name].prefix, sys.modules[name].__name__)) getFilePath('__main__') getFilePath =  sys.argv[0]    ?? :) -- http://mail.python.org/mailman/listinf

Re: Existing FTP server code?

2005-12-20 Thread Mateusz Sołtysek
[EMAIL PROTECTED] wrote: > Hi, I'm writing a program that needs to upload files to a server > (probably using FTP), that also needs to be secured and be able to > setup username/password programmatically. > > I wonder if there are already well written base code I can work on. > > The reason I cho

Re: Which Python web framework is most like Ruby on Rails?

2005-12-20 Thread Paul Boddie
Paul Rubin wrote: > It's been a long-time source of puzzlement to me why so many web sites > are so slow, and RDBMS overhead is an obvious candidate. So the rant > seems appropriate even in the case of web apps where clients can cause > db updates. Indeed. Large portions of a lot of Web sites cou

Re: How to get the path of current running python script?

2005-12-20 Thread Kevin Yuan
Oh, my god! I forgot that python is written in C!int main(int argc, char* argv[]){     printf(argv[0]);    return 0; }*argv[0]* also woks here!!:) :) :)Thank you very much!!2005/12/20, Tim Williams (gmail) <[EMAIL PROTECTED]>: On 20/12/05, Kevin Yuan <[EMAIL PROTECTED]> wrote: I tried the followi

Re: Which Python web framework is most like Ruby on Rails?

2005-12-20 Thread paron
Wow! You´re right, at least at first reading. It looks REALLY simple, and almost anything you can dream up will work. Python scripts, python-in-html, html-in-python, and "karrigell services" ( based on CherryPy). Seems to support smart urls, sessions, authentication, and internationalization out-of

Re: ANNOUNCE; Try python beta

2005-12-20 Thread Paul Boddie
Mike Meyer wrote: [Browser behaviour] > Actually, it's doing form processing. It's doing XMLHttpRequests. You might want to add some workarounds for Konqueror. What I found was that Konqueror (on KDE 3.4.0) has a tendency to add null bytes to the end of some form field values. Consequently, I ge

Re: Which Python web framework is most like Ruby on Rails?

2005-12-20 Thread paron
Oops! Second line on the home page: With Karrigell you have . . . * a pure-Python database engine : KirbyBase Karrigell can also work with . . . all the databases for which a Python API exists (sqlite, mySql, PostGreSQL, ZODB, etc). Well, off to reread and work the tut! My apologies!

Re: how to remove duplicated elements in a list?

2005-12-20 Thread Tim N. van der Leeuw
Another way to do this, that also maintains order, is: >>> l = [3, 1, 'a', '@', -4, 'z', 'r', 1, '@', -4] >>> s = set() >>> l2 = [] >>> for v in l: ... if not v in s: ... s.add(v) ... l2.append(v) ... >>> l2 [3, 1, 'a', '@', -4, 'z', 'r'] I have no idea whether or not

Re: xml with python <-> python deprecated - why?

2005-12-20 Thread Duncan Booth
Frank Millman wrote: > > I am curious. Why is xml frowned upon? Is my new method ok, or is there > a better way? Using XML gives you portability at the expense of increased code manipulating the data structures. Try creating a button with "<<<" as the label and you'll find why your xml soluti

parsing engineering symbols

2005-12-20 Thread Suresh Jeevanandam
Hi, I want to convert a string to float value. The string contains engineering symbols. For example, s = '12k' I want some function which would return 12000 function(s) => 12000.0 I searched the web, but could not fi

Re: modify a long-running python script while it is running?

2005-12-20 Thread Peter Hansen
Kevin Yuan wrote: > I have a silly question: Can *VERY* large script cause memory overflow > if python load all the entire script file into memory? If you have a script that is literally larger than memory, then what else would happen but an overflow error of some kind? What's the point of

Re: xml with python <-> python deprecated - why?

2005-12-20 Thread Frank Millman
Duncan Booth wrote: > Frank Millman wrote: > > > > > I am curious. Why is xml frowned upon? Is my new method ok, or is there > > a better way? > > Using XML gives you portability at the expense of increased code > manipulating the data structures. > > Try creating a button with "<<<" as the label

checking if a string contains a number

2005-12-20 Thread Suresh Jeevanandam
Hi, I have a string like, s1 = '12e3' s2 = 'junk' Now before converting these values to float, I want to check if they are valid numbers. s1.isdigit returns False. Is there any other function which would return True for s1 and False for s2. Than

Re: Weird memory consumption problem.

2005-12-20 Thread Bo Peng
Steven D'Aprano wrote: > Sorry, are you saying that the code you posted does NOT have a memory > leak, but you want us to find the memory leak in your real code sight > unseen? valgrind does not detect anything so it does not look like memory leak. I just can not figure out why val[0], readonl

Re: Which Python web framework is most like Ruby on Rails?

2005-12-20 Thread Luis M. Gonzalez
> Karrigell can also work with . . . all the databases for which a Python > API exists (sqlite, mySql, PostGreSQL, ZODB, etc). Well, that's exactly what makes KARRIGELL so especial. It is very flexible and lets you use whatever database or component you want. It doesn't force you to use an specif

Re: putenv

2005-12-20 Thread Peter Hansen
Terry Hancock wrote: > source `my_script.py` > > It's ugly, but it does work -- I have had to use this > before in a production environment. Well, it's not really > any less advisable than scripting in csh to begin with. ;-) It can even be made no-so-ugly with an alias. alias my_script='source

Re: RasAdminUserGetInfo

2005-12-20 Thread Larry Bates
[EMAIL PROTECTED] wrote: > I got that far but the RasAdminUserGetInfo function isn't defined in > win32net (or anywhere else as far as I can work out). Is there a way > to use it without the win32 module? This is the first thing I haven't > been able to do with win32net so I'm a little stumped on

Re: checking if a string contains a number

2005-12-20 Thread Tim Williams (gmail)
On 20/12/05, Suresh Jeevanandam <[EMAIL PROTECTED]> wrote: Hi,I have a string like,s1 = '12e3's2 = 'junk'Now before converting these values to float, I want to check if theyare valid numbers.s1.isdigit returns False. Is there any other function which

Queueing in Python (ala JMS)

2005-12-20 Thread Stefan Arentz
Is there a JMS-like API available for Python? I would like to quickly receive messages through the network and then process those slowly in the backgound. In the Java world I would simply create a (persistent) queue and tell the JSM provider to run N messagehandlers parallel. Is something like th

Re: parsing engineering symbols

2005-12-20 Thread Larry Bates
Something like: def cvt(input): if input.lower().endswith('k'): return float(input[:-1])*1000 . . add your other special symbols here . return None # didn't find a match Larry Bates Suresh Jeevanandam wrote: > Hi, > I want to convert a string to float value. The stri

Re: checking if a string contains a number

2005-12-20 Thread Larry Bates
You should probably work through the tutorials. Use a try block: try: x=float(s) except ValueError: print 'Non-numeric value %s found' % s -Larry Bates Suresh Jeevanandam wrote: > Hi, > I have a string like, > s1 = '12e3' > s2 = 'junk' > > Now before converting these values

pythonic equivalent of upvar?

2005-12-20 Thread David MacKay
Dear Greater Py, I am writing a command-line reader for python. I'm trying to write something with the same brevity as perl's one-liner eval "\$$1=\$2" while @ARGV && $ARGV[0]=~ /^(\w+)=(.*)/ && shift; and with similar functionality. I've decided I don't like getopt, because it se

Re: Queueing in Python (ala JMS)

2005-12-20 Thread Tim Williams (gmail)
On 20 Dec 2005 15:01:02 +0100, Stefan Arentz <[EMAIL PROTECTED]> wrote: Is there a JMS-like API available for Python? I would like toquickly receive messages through the network and then processthose slowly in the backgound. In the Java world I would simplycreate a (persistent) queue and tell the J

numarray :: multiplying all the elements in 1d array

2005-12-20 Thread Suresh Jeevanandam
Hi all, Lets say I have an array: from numarray import * a = array([ 6, 7, 8, 9, 10, 11, 12]) I want to multiply out all the elements and get the result. r = 1.0 for i in a: r = r*i Is there any faster, efficient

Re: Do you recommend a good artificial intelligence book?

2005-12-20 Thread buriy
try "Artificial Intelligence: A Modern Approach" (look at http://aima.cs.berkeley.edu/ ) -- http://mail.python.org/mailman/listinfo/python-list

ANN: enum 0.4 - Enumerations in Python

2005-12-20 Thread Ben Finney
Howdy all, I've uploaded enum 0.4 to the Cheeseshop. http://cheeseshop.python.org/pypi/enum/> Main changes: Comparing values from an enumeration against a value not from the same enumeration will now succeed (previous versions raised an exception):: >>> from enum import Enum >>> We

Re: Enumeration idioms: Values from different enumerations

2005-12-20 Thread Bengt Richter
On Tue, 20 Dec 2005 09:16:03 +1100, Ben Finney <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] writes: >> Ben Finney wrote: >>> Is there some behaviour other than "evaluate to False" or "raise an >>> exception", that could indicate "not comparable"? >> >> Yes: return NotImplemented. Note that the =

Re: pythonic equivalent of upvar?

2005-12-20 Thread Peter Otten
David MacKay wrote: > I'm trying to write something with the same brevity > as perl's one-liner > > eval "\$$1=\$2" while @ARGV && $ARGV[0]=~ ^(\w+)=(.*) && shift; import optparse parser = optparse.OptionParser("See the error of your ways and use optparse") parser.add_option("--decode", action=

Re: Queueing in Python (ala JMS)

2005-12-20 Thread James
Stefan Arentz wrote: > Is there a JMS-like API available for Python? I would like to > quickly receive messages through the network and then process > those slowly in the backgound. In the Java world I would simply > create a (persistent) queue and tell the JSM provider to run > N messagehandlers p

Re: pythonic equivalent of upvar?

2005-12-20 Thread Fredrik Lundh
David MacKay wrote: > def main(): >## Define DEFAULTS that can be overridden on the command line >decode=0## are we decoding? >verbose=0 ## verbose output? >bits=7 ## how big are the blocks? >N = 1 ## What is the file length? >file="blah" ## file name strin

Re: numarray :: multiplying all the elements in 1d array

2005-12-20 Thread Mandus
Tue, 20 Dec 2005 19:32:13 +0530 skrev Suresh Jeevanandam: > Hi all, > Lets say I have an array: > from numarray import * > a = array([ 6, 7, 8, 9, 10, 11, 12]) > > I want to multiply out all the elements and get the result. > > r = 1.0 > for i in a: >

Re: pythonic equivalent of upvar?

2005-12-20 Thread Richie Hindle
[David] > I'm trying to write something with the same brevity > as perl's one-liner > > eval "\$$1=\$2" while @ARGV && $ARGV[0]=~ /^(\w+)=(.*)/ && shift; import sys, re for arg in sys.argv[1:]: if re.match(r'\w+=.*', arg): exec arg else: break -- Richie Hindle [EMAIL P

How convert text file between locale encoding and UTF-8?

2005-12-20 Thread davihigh
Dear Friends: Wondering that is there neat way to do "subject line" in Python? I am talking about Python 2.4 with Win32 extension installed. The locale can be any of ANSI defined, for example, zh_CN (CP936) or Korea (CP949) . I am not expert in Python, if you well note I will appreciate a

Re: Parsing text

2005-12-20 Thread Bengt Richter
On 19 Dec 2005 15:15:10 -0800, "sicvic" <[EMAIL PROTECTED]> wrote: >I was wondering if theres a way where python can read through the lines >of a text file searching for a key phrase then writing that line and >all lines following it up to a certain point, such as until it sees a >string of "-

Disable 'windows key'

2005-12-20 Thread paul . sherwood
Hi Ive made a simple game for my 10 month old son. I noticed that (having watched daddy) he loved to bash the keyboard whenever possible. So the game simply displays various pictures of animals, accompanied by the animal sound and printed name, whenever any keys are bashed 3 times. He loves it. Ho

Re: putenv

2005-12-20 Thread Mike Meyer
Terry Hancock <[EMAIL PROTECTED]> writes: > On Tue, 20 Dec 2005 05:35:48 - > Grant Edwards <[EMAIL PROTECTED]> wrote: >> On 2005-12-20, [EMAIL PROTECTED] <[EMAIL PROTECTED]> >> wrote: >> > I have csh script that calls a bunch of python programs >> > and I'd like to use env variables as kind of

Re: Weird memory consumption problem.

2005-12-20 Thread Bo Peng
Bo Peng wrote: >> Sorry, are you saying that the code you posted does NOT have a memory >> leak, but you want us to find the memory leak in your real code sight >> unseen? Problem found. It is hidden in a utility function that converts the return value to a double. The refcnt of the middle res

Re: Queueing in Python (ala JMS)

2005-12-20 Thread Jonathan LaCour
On Dec 20, 2005, at 9:01 AM, Stefan Arentz wrote: > Is there a JMS-like API available for Python? I would like to > quickly receive messages through the network and then process > those slowly in the backgound. In the Java world I would simply > create a (persistent) queue and tell the JSM provider

Re: numarray :: multiplying all the elements in 1d array

2005-12-20 Thread Robert Kern
Suresh Jeevanandam wrote: > Hi all, > Lets say I have an array: > from numarray import * > a = array([ 6, 7, 8, 9, 10, 11, 12]) > > I want to multiply out all the elements and get the result. > > r = 1.0 > for i in a: > r = r*i > >

Re: Which Python web framework is most like Ruby on Rails?

2005-12-20 Thread Mike Meyer
"Paul Boddie" <[EMAIL PROTECTED]> writes: > Paul Rubin wrote: >> It's been a long-time source of puzzlement to me why so many web sites >> are so slow, and RDBMS overhead is an obvious candidate. So the rant >> seems appropriate even in the case of web apps where clients can cause >> db updates. >

Re: Disable 'windows key'

2005-12-20 Thread Richie Hindle
[Paul] > I wonder if there might be a way of disabling [the windows key] within > my program. IHateThisKey will do this globally: http://www.bytegems.com/ihatethiskey.shtml The free edition blocks the Windows key, and the paid one ($10) lets you control all kinds of keys in quite flexible way

Re: Disable 'windows key'

2005-12-20 Thread Tim N. van der Leeuw
I found out that installing the LiteStep alternative for windows taskbar actually has the sideeffect of disabling the windows key... (But I don't know how inclined you are to tinker with your system to that degree. At least it offers a clean uninstall) winKey+e still works after installing LiteSte

Re: Do you recommend a good artificial intelligence book?

2005-12-20 Thread gene tani
buriy wrote: > try "Artificial Intelligence: A Modern Approach" > (look at http://aima.cs.berkeley.edu/ ) Jurafsky and Martin for NLP -- http://mail.python.org/mailman/listinfo/python-list

Re: ANNOUNCE; Try python beta

2005-12-20 Thread Mike Meyer
Richie Hindle <[EMAIL PROTECTED]> writes: >> Yeah, I know. I poked at it briefly, but couldn't figure out what was >> goiing on. MSIE on the Mac doesn't work at all (no AJAT), and I don't >> have regular access to a Windows box to try it on. > > I think it's your JavaScript '\r' processing that's b

Re: debian and python--any potential pitfalls?

2005-12-20 Thread Frithiof Andreas Jensen
"Brian van den Broek" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The only area of computing in which I am interested and with which > he's unfamiliar is Python. He suggested I try to find out if there are > any potential issues with Debian stable and Python. Only that Python i

Re: ANNOUNCE; Try python beta

2005-12-20 Thread Richie Hindle
[Richie] > I think it's your JavaScript '\r' processing that's broken. Certainly the > error ("unexpected EOF while parsing") is consistent with having a \r on the > end of the expression. [Mike] > Python doesn't care about the trailing newline. That's a carriage return, not a newline: >>> eva

Re: debian and python--any potential pitfalls?

2005-12-20 Thread Paul Boddie
Frithiof Andreas Jensen wrote: > [Debian issues with Python] > Only that Python is "smeared" over several different packages - idle is > packed separately f.ex. Yes, and I almost guarantee that you'll find yourself swearing over the separate bundling of various header files in the python*-dev pa

Re: Queueing in Python (ala JMS)

2005-12-20 Thread Wolfgang Keller
> Is there a JMS-like API available for Python? Better. >:-> Omninotify, a Corba notification service implementation. Sincerely, Wolfgang Keller -- http://mail.python.org/mailman/listinfo/python-list

Re: Do you recommend a good artificial intelligence book?

2005-12-20 Thread Bengt Richter
On 20 Dec 2005 04:27:29 -0800, Paul Rubin wrote: >"Tolga" <[EMAIL PROTECTED]> writes: >> Is there anybody here interested in artificial intelligence (AI)? Yes, >> perhaps this thread would be more suitable for an AI usenet group and I >> have also posted my question ther

Re: parsing engineering symbols

2005-12-20 Thread Bengt Richter
On Tue, 20 Dec 2005 19:07:02 +0530, Suresh Jeevanandam <[EMAIL PROTECTED]> wrote: >Hi, > I want to convert a string to float value. The string contains >engineering symbols. > For example, > > s = '12k' > > I want some function which would return 12000 >

Re: parsing engineering symbols

2005-12-20 Thread gene tani
Suresh Jeevanandam wrote: > Hi, > I want to convert a string to float value. The string contains > engineering symbols. > For example, > > s = '12k' > > I want some function which would return 12000 > function(s) > => 12000.0 > I searched t

Re: putenv

2005-12-20 Thread Steve Holden
Mike Meyer wrote: > Terry Hancock <[EMAIL PROTECTED]> writes: > >>On Tue, 20 Dec 2005 05:35:48 - >>Grant Edwards <[EMAIL PROTECTED]> wrote: >> >>>On 2005-12-20, [EMAIL PROTECTED] <[EMAIL PROTECTED]> >>>wrote: >>> I have csh script that calls a bunch of python programs and I'd like to u

Re: allow_none=True in SimpleXMLRPCServer

2005-12-20 Thread Daniel Crespo
Hi Dody! It works perfect! Now, I want the SimpleXMLRPCServer.py not to be on the same directory, but in my /lib directory. I tried it, but it seems that the module loads from python24/ first. How can I change this? Thank you! -- http://mail.python.org/mailman/listinfo/python-list

Re: Which Python web framework is most like Ruby on Rails?

2005-12-20 Thread Steve Holden
Mike Meyer wrote: > "Paul Boddie" <[EMAIL PROTECTED]> writes: > >>Paul Rubin wrote: >> >>>It's been a long-time source of puzzlement to me why so many web sites >>>are so slow, and RDBMS overhead is an obvious candidate. So the rant >>>seems appropriate even in the case of web apps where clients

Re: Existing FTP server code?

2005-12-20 Thread gene tani
Mateusz Soltysek wrote: > [EMAIL PROTECTED] wrote: > > Hi, I'm writing a program that needs to upload files to a server > > (probably using FTP), that also needs to be secured and be able to > > setup username/password programmatically. > > > > I wonder if there are already well written base code

Re: How convert text file between locale encoding and UTF-8?

2005-12-20 Thread gene tani
[EMAIL PROTECTED] wrote: > Dear Friends: > > Wondering that is there neat way to do "subject line" in Python? I am > talking about Python 2.4 with Win32 extension installed. The locale can > be any of ANSI defined, for example, zh_CN (CP936) or Korea (CP949) > . > > I am not expert in Pyth

Re: Parsing text

2005-12-20 Thread sicvic
Not homework...not even in school (do any universities even teach classes using python?). Just not a programmer. Anyways I should probably be more clear about what I'm trying to do. Since I cant show the actual output file lets say I had an output file that looked like this: a b Person: J

Add to python path in Linux

2005-12-20 Thread ninhenzo64
Hi, I am trying to use wxPython under Linux. Unfortunately, our system administrator has gone home for the holidays so I cannot get him to install the libraries properly. However, I have unpacked the libraries in my home directory, so if there was some way of adding this to the path that Python se

Re: Disable 'windows key'

2005-12-20 Thread Dody Suria Wijaya
But can it change "Fn" key mapping? Richie Hindle wrote: > [Paul] >> I wonder if there might be a way of disabling [the windows key] within >> my program. > > IHateThisKey will do this globally: > > http://www.bytegems.com/ihatethiskey.shtml > > The free edition blocks the Windows key, and th

Re: Disable 'windows key'

2005-12-20 Thread Richie Hindle
> But can it change "Fn" key mapping? I don't think so, no. There's no obvious user interface for that, anyway. -- Richie Hindle [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Which Python web framework is most like Ruby on Rails?

2005-12-20 Thread Kent Johnson
Luis M. Gonzalez wrote: > The only problem with KARRIGELL, I guess, is that its creator is very > humble and doesn't like to advertise his creature. He is not very fond > of "marketing" ... From my point of view the biggest problem with Karrigell is that it is released under the GPL. Most of my

Help with python_fold.vim

2005-12-20 Thread stephen
I see that the python_fold plugin for vim lets you fold classes/functions, etc. Can someone tell me how to fold/unfold sections? Thanks. Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing text

2005-12-20 Thread rzed
"sicvic" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Not homework...not even in school (do any universities even > teach classes using python?). Just not a programmer. Anyways I > should probably be more clear about what I'm trying to do. > > Since I cant show the actual output file l

Re: Parsing text

2005-12-20 Thread Gerard Flanagan
sicvic wrote: > Since I cant show the actual output file lets say I had an output file > that looked like this: > > a b Person: Jimmy > Current Location: Denver It may be the output of another process but it's the input file as far as the parsing code is concerned. The code below gives t

Eckel, ruby, python

2005-12-20 Thread gene tani
pretty sane article, i didn't see it linked/cited here http://www.artima.com/weblogs/viewpost.jsp?thread=141312 -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with python_fold.vim

2005-12-20 Thread stephen
Found an earlier thread that answered my question: http://mail.python.org/pipermail/python-list/2005-July/289078.html """Then zo opens the fold under the cursor one level, zO opens it recursively, zc and zC close it non- and recursively. zr opens all folds one level, zR opens them all recursively

Re: putenv

2005-12-20 Thread Christophe
Mike Meyer a écrit : > Terry Hancock <[EMAIL PROTECTED]> writes: > >>On Tue, 20 Dec 2005 05:35:48 - >>Grant Edwards <[EMAIL PROTECTED]> wrote: >> >>>On 2005-12-20, [EMAIL PROTECTED] <[EMAIL PROTECTED]> >>>wrote: >>> I have csh script that calls a bunch of python programs and I'd like t

Re: Parsing text

2005-12-20 Thread Scott David Daniels
sicvic wrote: > Not homework...not even in school (do any universities even teach > classes using python?). Yup, at least 6, and 20 wouldn't surprise me. > The code I currently have looks something like this: > ... > f = open(sys.argv[1]) #opens output file > #loop that goes through all lines and

Re: how to lock a file in ftp site

2005-12-20 Thread Ben Hutchings
<[EMAIL PROTECTED]> wrote: > hi all > > am trying to write some information into the file, which is located in > ftp, and this file can be updated by number of people, but if at all i > download a file from the ftp to my local machine, update it and then > upload it back to ftp, and at the same tim

Re: Add to python path in Linux

2005-12-20 Thread Sybren Stuvel
ninhenzo64 enlightened us with: > The variable PYTHONPATH doesn't seem to exist. Yet it is the one you should use. It's got the same syntax as the regular PATH variable. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don'

Re: Help with python_fold.vim

2005-12-20 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: > Found an earlier thread that answered my question: Good for you. I often want only one or two levels of indentation at maximum. This ensures not all if/while/for etc. blocks are indented. Most of my python files either contain classes (max indent 2) or onl

Re: checking if a string contains a number

2005-12-20 Thread egbert
On Tue, Dec 20, 2005 at 07:16:46PM +0530, Suresh Jeevanandam wrote: > s1 = '12e3' > s2 = 'junk' > Is there any other function which would return True for s1 and False > for s2. > isinstance(12e3, (int, float)) -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020

Re: pythonic equivalent of upvar?

2005-12-20 Thread Bengt Richter
On Tue, 20 Dec 2005 16:10:30 +0200, [EMAIL PROTECTED] (David MacKay) wrote: >Dear Greater Py, > > > I am writing a command-line reader for python. > > I'm trying to write something with the same brevity >as perl's one-liner > >eval "\$$1=\$2" while @ARGV && $ARGV[0]=~ /^(\w+)=(.*)/ && shi

Re: how to lock a file in ftp site

2005-12-20 Thread Steve Holden
Ben Hutchings wrote: > <[EMAIL PROTECTED]> wrote: > >>hi all >> >>am trying to write some information into the file, which is located in >>ftp, and this file can be updated by number of people, but if at all i >>download a file from the ftp to my local machine, update it and then >>upload it back

Re: Weird memory consumption problem.

2005-12-20 Thread Stephen Kellett
In message <[EMAIL PROTECTED]>, Bo Peng <[EMAIL PROTECTED]> writes >The problem is not that difficult to find, but it was 2am in the morning and >I was misled by the different behavior of pyFun1 and pyFun2. Don't know if you were using Windows, but if you were then Python Memory Validator would ha

[email protected]

2005-12-20 Thread ivan.dm
Hi Body, Can I set an image from file into DrawArea, so I can resize and drawing any object over its image? any tips or idea? Thanks Ivan -- http://mail.python.org/mailman/listinfo/python-list

Your message to ZDP awaits moderator approval

2005-12-20 Thread zdp-bounces
Your mail to 'ZDP' with the subject hi, ive a new mail address Is being held until the list moderator can review it for approval. The reason it is being held: Post by non-member to a members-only list Either the message will get posted to the list, or you will receive notification of t

  1   2   >