Re: open a file in python

2009-07-29 Thread jayshree
On Jul 27, 2:55 pm, "Diez B. Roggisch" wrote: > jayshree wrote: > > On Jul 27, 1:09 pm, Kushal Kumaran > > wrote: > >> On Mon, Jul 27, 2009 at 12:58 PM, jayshree > >> wrote: > >> > pk = open('/home/jayshree/my_key.public.pem' , 'rb').read() > > >> > Please tell me how to open a file placed in any

[no subject]

2009-07-29 Thread hch
Hi, everyone Is there a python script can get a list of how much stack space each function in your program uses? ( the program is compiled by gcc) Any advice will be appreciate. -- http://mail.python.org/mailman/listinfo/python-list

Re: "Deprecated sets module" with Python 2.6

2009-07-29 Thread Virgil Stokes
Diez B. Roggisch wrote: Virgil Stokes schrieb: I would appreciate help on correcting a problem when trying to create an *.exe file using py2exe via GUI2exe with Python 2.6.2. When using GUI2exe to create an *.exe I always get the following warning during the compile process: C:\Python26\lib

about analyze object's stack usage

2009-07-29 Thread hch
Hi, everyone Is there a python script can get a list of how much stack space each function in your program uses? ( the program is compiled by gcc) Any advice will be appreciate. -- http://mail.python.org/mailman/listinfo/python-list

Re: "Deprecated sets module" with Python 2.6

2009-07-29 Thread Virgil Stokes
Virgil Stokes wrote: Diez B. Roggisch wrote: Virgil Stokes schrieb: I would appreciate help on correcting a problem when trying to create an *.exe file using py2exe via GUI2exe with Python 2.6.2. When using GUI2exe to create an *.exe I always get the following warning during the compile proc

Re: If Scheme is so good why MIT drops it?

2009-07-29 Thread Hendrik van Rooyen
On Tuesday 28 July 2009 17:11:02 MRAB wrote: > If you were a "COBOL" programmer, would you want to shout about it? :-) Hey don't knock it! - at the time, it was either COBOL or FORTRAN or some assembler or coding in hex or octal. And if code is data, where is Pythons ALTER statement? *Ducks* :

Re: python 3 and stringio.seek

2009-07-29 Thread Miles Kaufmann
On Jul 28, 2009, at 6:30 AM, Michele Petrazzo wrote: Hi list, I'm trying to port a my library to python 3, but I have a problem with a the stringio.seek: the method not accept anymore a value like pos=-6 mode=1, but the "old" (2.X) version yes... The error: File "/home/devel/Py3/lib/pyt

fast video encoding

2009-07-29 Thread gregorth
Hi all, for a scientific application I need to save a video stream to disc for further post processing. My cam can deliver 8bit grayscale images with resolution 640x480 with a framerate up to 100Hz, this is a data rate of 30MB/s. Writing the data uncompressed to disc hits the data transfer limits

Re: instead of depending on data = array('h') .. write samples 1 by 1 to w = wave.open("wav.wav", "w")

2009-07-29 Thread Peter Otten
'2+ wrote: > it says > Wave_write.writeframes(data) > will that mean > "from array import array" > is a must? > > this does the job: > > import oil > import wave > from array import array > > a = oil.Sa() > > w = wave.open("current.wav", "w") > w.setnchannels(2) > w.setsampwidth(2) > w.setfram

64-bit issues with dictionaries in Python 2.6

2009-07-29 Thread Michael Ströder
HI! Are there any known issues with dictionaries in Python 2.6 (not 2.6.2) when running on a 64-bit platform? A friend of mine experiences various strange problems with my web2ldap running with Python 2.6 shipped with openSUSE 11.1 x64. For me it seems some dictionary-based internal registries of

idiom for list looping

2009-07-29 Thread superpollo
hi clp. i want to get from here: nomi = ["one", "two", "three"] to here: 0 - one 1 - two 2 - three i found two ways: first way: for i in range(len(nomi)): print i, "-", nomi[i] or second way: for (i, e) in enumerate(nomi): print i, "-", e which one is "better"? is there a more py

Re: idiom for list looping

2009-07-29 Thread David Roberts
To the best of my knowledge the second way is more pythonic - the first is a little too reminiscent of C. A couple of notes: - you don't need the parentheses around "i, e" - if you were going to use the first way it's better to use xrange instead of range for iteration -- David Roberts http://da.v

Re: idiom for list looping

2009-07-29 Thread MRAB
superpollo wrote: hi clp. i want to get from here: nomi = ["one", "two", "three"] to here: 0 - one 1 - two 2 - three i found two ways: first way: for i in range(len(nomi)): print i, "-", nomi[i] or second way: for (i, e) in enumerate(nomi): print i, "-", e which one is "better"?

Re: "Deprecated sets module" with Python 2.6

2009-07-29 Thread Giampaolo Rodola'
What about this? import warnings warnings.simplefilter('ignore', DeprecationWarning) import the_module_causing_the_warning warnings.resetwarnings() --- Giampaolo http://code.google.com/p/pyftpdlib http://code.google.com/p/psutil -- http://mail.python.org/mailman/listinfo/python-list

Re: idiom for list looping

2009-07-29 Thread Xavier Ho
> > superpollo wrote: > >> >> for (i, e) in enumerate(nomi): >>print i, "-", e >> >> Just to be random: print '\n'.join(["%s - %s" % (i, e) for i, e in enumerate(nomi)]) This has one advantage: only print once. So it's slightly faster if you have a list of a large amount. -- http://mail.pyth

Re: idiom for list looping

2009-07-29 Thread MRAB
Xavier Ho wrote: superpollo wrote: for (i, e) in enumerate(nomi): print i, "-", e Just to be random: print '\n'.join(["%s - %s" % (i, e) for i, e in enumerate(nomi)]) This has one advantage: only print once. So it's slightly faster if you have a list of a large amount

Re: idiom for list looping

2009-07-29 Thread Xavier Ho
On Wed, Jul 29, 2009 at 8:52 PM, MRAB wrote: > Slightly shorter: > > print '\n'.join("%s - %s" % p for p in enumerate(nomi)) > > :-) > That's cool. Does that make the "list" a tuple? (not that it matters, I'm just curious!) I just tested for a list of 1000 elements (number in letters from 1 to 1

Re: idiom for list looping

2009-07-29 Thread superpollo
MRAB wrote: Xavier Ho wrote: superpollo wrote: for (i, e) in enumerate(nomi): print i, "-", e Just to be random: print '\n'.join(["%s - %s" % (i, e) for i, e in enumerate(nomi)]) This has one advantage: only print once. So it's slightly faster if you have a list of

idiom for list looping

2009-07-29 Thread Xavier Ho
Ack, sent to the wrong email again. On Wed, Jul 29, 2009 at 9:02 PM, superpollo wrote: > > >>> print '\n'.join("%s - %s" % p for p in enumerate(nomi)) > File "", line 1 >print '\n'.join("%s - %s" % p for p in enumerate(nomi)) >^ > SyntaxError: invalid syn

Re: idiom for list looping

2009-07-29 Thread MRAB
Xavier Ho wrote: On Wed, Jul 29, 2009 at 8:52 PM, MRAB > wrote: Slightly shorter: print '\n'.join("%s - %s" % p for p in enumerate(nomi)) :-) That's cool. Does that make the "list" a tuple? (not that it matters, I'm just curious!) I've just r

Re: idiom for list looping

2009-07-29 Thread Xavier Ho
On Wed, Jul 29, 2009 at 9:17 PM, MRAB wrote: > I've just replaced the list comprehension with a generator expression. > > Oh, and that isn't in Python 2.3 I see. Generators are slightly newer, eh. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Semaphore Techniques

2009-07-29 Thread Nick Craig-Wood
John D Giotta wrote: > I'm looking to run a process with a limit of 3 instances, but each > execution is over a crontab interval. I've been investigating the > threading module and using daemons to limit active thread objects, but > I'm not very successful at grasping the documentation. > >

QFileDialog setFileMode blues

2009-07-29 Thread Rincewind
Heya, I am fairly new to Python and even newer to Qt. The problem is opening a Qt file dialog to select folders only. QFileDialog has a nice and dandy setFileMode() function just for that. The only trouble is that I cannot make it work. Last thing I've tried was something like this: self.

Re: QFileDialog setFileMode blues

2009-07-29 Thread Phil Thompson
On Wed, 29 Jul 2009 04:35:42 -0700 (PDT), Rincewind wrote: > Heya, > > I am fairly new to Python and even newer to Qt. > The problem is opening a Qt file dialog to select folders only. > QFileDialog has a nice and dandy setFileMode() function just for that. > The only trouble is that I cannot mak

Run pyc file without specifying python path ?

2009-07-29 Thread Barak, Ron
Hi, I wanted to make a python byte-code file executable, expecting to be able to run it without specifying "python" on the (Linux bash) command line. So, I wrote the following: [r...@vmlinux1 python]# cat test_pyc.py #!/usr/bin/env python print "hello" [r...@vmlinux1 python]# and made its py

Re: fast video encoding

2009-07-29 Thread Marcus Wanner
On 7/29/2009 4:14 AM, gregorth wrote: Hi all, for a scientific application I need to save a video stream to disc for further post processing. My cam can deliver 8bit grayscale images with resolution 640x480 with a framerate up to 100Hz, this is a data rate of 30MB/s. Writing the data uncompresse

Re: simple splash screen?

2009-07-29 Thread Marcus Wanner
On 7/28/2009 11:58 PM, NighterNet wrote: I am trying to make a simple splash screen from python 3.1.Not sure where to start looking for it. Can any one help? Trying to make a splash screen for python? Or trying to do image processing in python? Marcus -- http://mail.python.org/mailman/listinfo/

Re: Need help in passing a "-c command" argument to the interactive shell.

2009-07-29 Thread Duncan Booth
Bill wrote: > On my windows box I type => c:\x>python -c "import re" > > The result is => c:\x> > > In other words, the Python interactive shell doesn't even open. What > am I doing wrong? > > I did RTFM at http://www.python.org/doc/1.5.2p2/tut/node4.html on > argument passing, but to no avail

Re: about analyze object's stack usage

2009-07-29 Thread Marcus Wanner
On 7/29/2009 3:51 AM, hch wrote: Is there a python script can get a list of how much stack space each function in your program uses? I don't think so. You could try raw reading of the memory from another thread using ctypes and pointers, but that would be madness. ( the program is compiled by g

Particle research opens door for new technology

2009-07-29 Thread Rashid Ali Soomro
Big uses for small particles will be explored at the annual Particle Technology Research Centre Conference at The University of Western Ontario July 9 and 10.more http://0nanotechnology0.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Help with sql and python

2009-07-29 Thread catalinf...@gmail.com
Hello ! I have accont on myphpadmin on my server. I want to create one script in python. This script manage sql task from my sql server . How i make this in a simple way ? Thank you ! -- http://mail.python.org/mailman/listinfo/python-list

Re: Particle research opens door for new technology

2009-07-29 Thread Xavier Ho
Is this a spam? Why did you have to send it 4 times, and it's already in the past (July 9 and 10) ? Ching-Yun "Xavier" Ho, Technical Artist Contact Information Mobile: (+61) 04 3335 4748 Skype ID: SpaXe85 Email: cont...@xavierho.com Website: http://xavierho.com/ -- http://mail.python.org/mailman

Working with platform.system()

2009-07-29 Thread v1d4l0k4
Hi! I want to know how I can get different expected return values by platform.system() method. I want to sniff some systems (Linux, Windows, Mac, BSD, Solaris) and I don't know how I can check them correctly. Could you give me some expected return values that you know? Thanks in advance, Paulo Ri

escaping characters in filenames

2009-07-29 Thread J Kenneth King
I wrote a script to process some files using another program. One thing I noticed was that both os.listdir() and os.path.walk() will return unescaped file names (ie: "My File With Spaces & Stuff" instead of "My\ File\ With\ Spaces\ \&\ Stuff"). I haven't had much success finding a module or reci

how to embed the python interpreter into web App

2009-07-29 Thread Mehndi, Sibtey
Hi All I am trying to embed the python interpreter in to a web app but could not get the way, any one can suggest me how to do this. Thanks, Sibtey Mehdi This e-mail (and any attachments), is confidential and may be privileged. It may be read, copied and used only by intended recipients. Unaut

Re: Semaphore Techniques

2009-07-29 Thread Piet van Oostrum
> Carl Banks (CB) wrote: >CB> On Jul 28, 3:15 pm, John D Giotta wrote: >>> I'm looking to run a process with a limit of 3 instances, but each >>> execution is over a crontab interval. I've been investigating the >>> threading module and using daemons to limit active thread objects, but >>> I

Re: QFileDialog setFileMode blues

2009-07-29 Thread Rincewind
On Jul 29, 12:45 pm, Phil Thompson wrote: > On Wed, 29 Jul 2009 04:35:42 -0700 (PDT), Rincewind > wrote: > > > Heya, > > > I am fairly new to Python and even newer to Qt. > > The problem is opening a Qt file dialog to select folders only. > > QFileDialog has a nice and dandy setFileMode() functio

Re: escaping characters in filenames

2009-07-29 Thread MRAB
J Kenneth King wrote: I wrote a script to process some files using another program. One thing I noticed was that both os.listdir() and os.path.walk() will return unescaped file names (ie: "My File With Spaces & Stuff" instead of "My\ File\ With\ Spaces\ \&\ Stuff"). I haven't had much success f

Re: Compiling Python for uCLinux appliance?

2009-07-29 Thread Diez B. Roggisch
Gilles Ganault wrote: > Hello > > I just got a small appliance based on a Blackfin CPU with 64MB RAM and > 258MB NAND flash. Using the stock software, there's about 30MB of RAM > left. > > Besides C/C++ and shel scripts, I was wondering if it were realistic > to upload a few Python scripts in su

Re: bad certificate error

2009-07-29 Thread jakecjacobson
On Jul 29, 2:08 am, "Gabriel Genellina" wrote: > En Tue, 28 Jul 2009 09:02:40 -0300, Steven D'Aprano   > escribió: > > > > > On Mon, 27 Jul 2009 23:16:39 -0300, Gabriel Genellina wrote: > > >> I don't see the point on "fixing" either the Python script or httplib to > >> accomodate for an invalid

Re: simple splash screen?

2009-07-29 Thread NighterNet
On Jul 29, 5:24 am, Marcus Wanner wrote: > On 7/28/2009 11:58 PM, NighterNet wrote:> I am trying to make a simple splash > screen from python 3.1.Not sure > > where to start looking for it. Can any one help? > > Trying to make a splash screen for python? > Or trying to do image processing in pyth

Clearing an array

2009-07-29 Thread WilsonOfCanada
Hellos, I was wondering if there is any built-in function that clears the array. I was also wondering if this works: arrMoo = ['33', '342', '342'] arrMoo = [] -- http://mail.python.org/mailman/listinfo/python-list

Re: New implementation of re module

2009-07-29 Thread Mike
On Jul 27, 11:34 am, MRAB wrote: > I've been working on a new implementation of the re module. Fabulous! If you're extending/changing the interface, there are a couple of sore points in the current implementation I'd love to see addressed: - findall/finditer doesn't find overlapping matches. S

Very Strange Problem

2009-07-29 Thread Omer Khalid
Hi, I am having a very strange problem with modifying a variable in a list in my program. Here is the code: # a list that contains dictionary objects jobs = [] index=5 for each in range(index): jobs.append({'v':0}) some_function(index): if jobs[index]['v'] == 0:

Re: Clearing an array

2009-07-29 Thread Diez B. Roggisch
WilsonOfCanada wrote: > Hellos, > > I was wondering if there is any built-in function that clears the > array. I was also wondering if this works: > > arrMoo = ['33', '342', '342'] > arrMoo = [] Most of the time, yes. Unless you have something like this, then it won't work: foo = [10]

Re: Clearing an array

2009-07-29 Thread Jason Tackaberry
On Wed, 2009-07-29 at 08:24 -0700, WilsonOfCanada wrote: > I was wondering if there is any built-in function that clears the > array. The proper python term would be "list." You can remove all elements of a list 'l' like so: del l[:] > I was also wondering if this works: > > arrMoo = ['3

Re: python 3 and stringio.seek

2009-07-29 Thread Terry Reedy
Miles Kaufmann wrote: On Jul 28, 2009, at 6:30 AM, Michele Petrazzo wrote: Hi list, I'm trying to port a my library to python 3, but I have a problem with a the stringio.seek: the method not accept anymore a value like pos=-6 mode=1, but the "old" (2.X) version yes... The error: File "/home/

Re: New implementation of re module

2009-07-29 Thread MRAB
Mike wrote: On Jul 27, 11:34 am, MRAB wrote: I've been working on a new implementation of the re module. Fabulous! If you're extending/changing the interface, there are a couple of sore points in the current implementation I'd love to see addressed: - findall/finditer doesn't find overlappi

SEC forms parsing

2009-07-29 Thread mpython
I am looking for any python examples that have written to parse SEC filings (Security Exchange Commission's EDGAR system),or just a pointer to best modules to use. -- http://mail.python.org/mailman/listinfo/python-list

Re: Very Strange Problem

2009-07-29 Thread MRAB
Omer Khalid wrote: Hi, I am having a very strange problem with modifying a variable in a list in my program. Here is the code: # a list that contains dictionary objects jobs = [] index=5 for each in range(index): jobs.append({'v':0}) some_function(index): if jobs[index]['v']

Re: Compiling Python for uCLinux appliance?

2009-07-29 Thread Grant Edwards
On 2009-07-29, Diez B. Roggisch wrote: > Gilles Ganault wrote: > >> Hello >> >> I just got a small appliance based on a Blackfin CPU with 64MB RAM and >> 258MB NAND flash. Using the stock software, there's about 30MB of RAM >> left. >> >> Besides C/C++ and shel scripts, I was wondering if it wer

Re: how to embed the python interpreter into web App (Mehndi, Sibtey)

2009-07-29 Thread Ryniek90
Hi All I am trying to embed the python interpreter in to a web app but could not get the way, any one can suggest me how to do this. Thanks, Sibtey Mehdi This e-mail (and any attachments), is confidential and may be privileged. It may be read, copied and used only by intended reci

Re: Very Strange Problem

2009-07-29 Thread MRAB
Ricardo Aráoz wrote: MRAB wrote: Omer Khalid wrote: Hi, I am having a very strange problem with modifying a variable in a list in my program. Here is the code: # a list that contains dictionary objects jobs = [] index=5 for each in range(index): jobs.append({'v':0}) some_function

Re: bad certificate error

2009-07-29 Thread John Nagle
jakecjacobson wrote: Hi, I am getting the following error when doing a post to REST API, Enter PEM pass phrase: Traceback (most recent call last): File "./ices_catalog_feeder.py", line 193, in ? main(sys.argv[1]) File "./ices_catalog_feeder.py", line 60, in main post2Catalog(catalog

Re: SEC forms parsing

2009-07-29 Thread John Nagle
mpython wrote: I am looking for any python examples that have written to parse SEC filings (Security Exchange Commission's EDGAR system),or just a pointer to best modules to use. I've been doing that in Perl for years. See "www.downside.com". Actually extracting financial statements is

Re: Help with sql and python

2009-07-29 Thread Piet van Oostrum
> "catalinf...@gmail.com" (cc) wrote: >cc> Hello ! >cc> I have accont on myphpadmin on my server. >cc> I want to create one script in python. >cc> This script manage sql task from my sql server . >cc> How i make this in a simple way ? See http://mysql-python.sourceforge.net/MySQLdb.html Thi

Re: New implementation of re module

2009-07-29 Thread Mike
On Jul 29, 10:45 am, MRAB wrote: > Mike wrote: > > - findall/finditer doesn't find overlapping matches.  Sometimes you > > really *do* want to know all possible matches, even if they overlap. > > Perhaps by adding "overlapped=True"? Something like that would be great, yes. > > - split won't spl

Re: open a file in python

2009-07-29 Thread Piet van Oostrum
> jayshree (j) wrote: >>> The Exact Problem is how to use the key containing by .pem file for >>> 'encryption' . can i print the contents of the .pem file I have already answered this question in a previous thread. It is not very helpful if you repeat asking the same or similar questions in

Does underscore has any special built-in meaningin Python ?

2009-07-29 Thread dandi kain
Hello everybody, I have just started learning Python.I heard its simple so I pick a presentation [1] and tried to work on it.But when it comes to underscores leading and trailing an object I dont understand any.I look through the python manual also but that was not helping .I searched some forums a

Re: Print value CLOB via cx_Oracle

2009-07-29 Thread Vincent Vega
On 28 Lip, 20:02, Vincent Vega wrote: > Hi, > > I call function in Oracle database use cx_Oracle. > In standard I define: > > db       = cx_Oracle.connect(username, password, tnsentry) > cursor  = db.cursor() > > I create variable 'y' (result function 'fun_name') and call function > 'fun_name': >

Re: Run pyc file without specifying python path ?

2009-07-29 Thread Dave Angel
Barak, Ron wrote: Hi, I wanted to make a python byte-code file executable, expecting to be able to run it without specifying "python" on the (Linux bash) command line. So, I wrote the following: [r...@vmlinux1 python]# cat test_pyc.py #!/usr/bin/env python print "hello" [r...@vmlinux1 python

Re: Does underscore has any special built-in meaningin Python ?

2009-07-29 Thread Benjamin Kaplan
On Wed, Jul 29, 2009 at 1:59 PM, dandi kain wrote: > > Hello everybody, > I have just started learning Python.I heard its simple so I pick a > presentation [1] and tried to work on it.But when it comes to > underscores leading and trailing an object I dont understand any.I > look through the pytho

Re: Help with sql and python

2009-07-29 Thread Dave Angel
catalinf...@gmail.com wrote: Hello ! I have accont on myphpadmin on my server. I want to create one script in python. This script manage sql task from my sql server . How i make this in a simple way ? Thank you ! It's seldom simple. I'm guessing it's not your server, but is actually a web

Re: simple splash screen?

2009-07-29 Thread Martin P. Hellwig
NighterNet wrote: I am trying to make a simple splash screen from python 3.1.Not sure where to start looking for it. Can any one help? Sure, almost the same as with Python 2 :-) But to be a bit more specific: """Only works if you got Python 3 installed with tkinter""" import tkinter IMAGE

Re: instead of depending on data = array('h') .. write samples 1 by 1 to w = wave.open("wav.wav", "w")

2009-07-29 Thread '2+
o wow .. there's still a lot to learn .. okay .. if i get stucked with the memory usage issue will try this hybrid .. thanx for the example!! it took about 40 min to render 1min of wav so i'll just keep this project like 15 sec oriented and maybe that'll keep me away from the mem trouble and my o

Re: escaping characters in filenames

2009-07-29 Thread Dave Angel
J Kenneth King wrote: I wrote a script to process some files using another program. One thing I noticed was that both os.listdir() and os.path.walk() will return unescaped file names (ie: "My File With Spaces & Stuff" instead of "My\ File\ With\ Spaces\ \&\ Stuff"). I haven't had much success f

Re: Semaphore Techniques

2009-07-29 Thread John D Giotta
I'm working with up to 3 process "session" per server, each process running three threads. I was wishing to tie back the 3 "session"/server to a semaphore, but everything (and everyone) say semaphores are only good per process. -- http://mail.python.org/mailman/listinfo/python-list

Re: Semaphore Techniques

2009-07-29 Thread John D Giotta
That was my original idea. Restricting each process by pid: #bash procs=`ps aux | grep script.pl | grep -v grep | wc -l` if [ $procs -lt 3 ]; then python2.4 script.py config.xml else exit 0 fi -- http://mail.python.org/mailman/listinfo/python-list

Re: Semaphore Techniques

2009-07-29 Thread Christian Heimes
John D Giotta schrieb: > I'm working with up to 3 process "session" per server, each process > running three threads. > I was wishing to tie back the 3 "session"/server to a semaphore, but > everything (and everyone) say semaphores are only good per process. That's not true. Named semaphores are t

Re: Very Strange Problem

2009-07-29 Thread Dave Angel
Omer Khalid wrote: Hi, I am having a very strange problem with modifying a variable in a list in my program. Here is the code: # a list that contains dictionary objects jobs = [] index=5 for each in range(index): jobs.append({'v':0}) some_function(index): if jobs[index]['v'] =

Re: escaping characters in filenames

2009-07-29 Thread Nobody
On Wed, 29 Jul 2009 09:29:55 -0400, J Kenneth King wrote: > I wrote a script to process some files using another program. One thing > I noticed was that both os.listdir() and os.path.walk() will return > unescaped file names (ie: "My File With Spaces & Stuff" instead of "My\ > File\ With\ Spaces\

set variable to looping index?

2009-07-29 Thread Martin
Hi, I am trying to set the return value from a function to a name which I grab from the for loop. I can't work out how I can do this without using an if statement... for f in var1_fn, var2_fn, var3_fn: if f.split('.')[0] == 'var1': var1 = call_some_function(f) . .

Re: 64-bit issues with dictionaries in Python 2.6

2009-07-29 Thread Martin v. Löwis
> Are there any known issues with dictionaries in Python 2.6 (not 2.6.2) > when running on a 64-bit platform? No, none. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Very Strange Problem

2009-07-29 Thread Omer Khalid
Hi Dave, Thanks for your reply. I actually didn't cut and paste my code as it was dispersed in different places, i typed the logic behind my code in the email (and obiviously made some typos, indentations is some thing else) but my real code does not have these problems as my application runs fine

Re: simple splash screen?

2009-07-29 Thread NighterNet
On Jul 29, 11:16 am, "Martin P. Hellwig" wrote: > NighterNet wrote: > > I am trying to make a simple splash screen from python 3.1.Not sure > > where to start looking for it. Can any one help? > > Sure, almost the same as with Python 2 :-) > But to be a bit more specific: > > """Only works if

Re: Very Strange Problem

2009-07-29 Thread Terry Reedy
Omer Khalid wrote: Hi, I am having a very strange problem with modifying a variable in a list in my program. Here is the code: To me, this sentence clearly implies that the code that follows is the code that had the problem. Since the posted code cannot run, it clearly is not. People should

Re: Very Strange Problem

2009-07-29 Thread Dave Angel
Omer Khalid wrote: Hi Dave, Thanks for your reply. I actually didn't cut and paste my code as it was dispersed in different places, i typed the logic behind my code in the email (and obiviously made some typos, indentations is some thing else) but my real code does not have these problems as my

Re: Does underscore has any special built-in meaningin Python ?

2009-07-29 Thread Jan Kaliszewski
29-07-2009 Benjamin Kaplan wrote: On Wed, Jul 29, 2009 at 1:59 PM, dandi kain wrote: [snip What is the functionality of __ or _ , leading or trailing an object , class ot function ? Is it just a naming convention to note special functions and objects , or it really mean someting to Python ?

Re: Does underscore has any special built-in meaningin Python ?

2009-07-29 Thread Terry Reedy
Benjamin Kaplan wrote: On Wed, Jul 29, 2009 at 1:59 PM, dandi kain wrote: Hello everybody, I have just started learning Python.I heard its simple so I pick a presentation [1] and tried to work on it.But when it comes to underscores leading and trailing an object I dont understand any.I look thr

How to "gunzip-iterate" over a file?

2009-07-29 Thread kj
I need to iterate over the lines of *very* large (>1 GB) gzipped files. I would like to do this without having to read the full compressed contents into memory so that I can apply zlib.decompress to these contents. I also would like to avoid having to gunzip the file (i.e. creating an uncompre

Re: How to "gunzip-iterate" over a file?

2009-07-29 Thread Robert Kern
On 2009-07-29 15:05, kj wrote: I need to iterate over the lines of *very* large (>1 GB) gzipped files. I would like to do this without having to read the full compressed contents into memory so that I can apply zlib.decompress to these contents. I also would like to avoid having to gunzip the

Differences Between Arrays and Matrices in Numpy

2009-07-29 Thread Nanime Puloski
What are some differences between arrays and matrices using the Numpy library? When would I want to use arrays instead of matrices and vice versa? -- http://mail.python.org/mailman/listinfo/python-list

Does python have the capability for driver development ?

2009-07-29 Thread MalC0de
hello there, I've a question : I want to know does python have any capability for using Ring0 and kernel functions for driver and device development stuff . if there's such a feature it is very good, and if there something for this kind that you know please refer me to some reference and show me so

delayed sys.exit?

2009-07-29 Thread Dr. Phillip M. Feldman
In the attached http://www.nabble.com/file/p24726902/test.py test.py code, it appears that additional statements execute after the call to sys.exit(0). I'll be grateful if anyone can shed light on why this is happening. Below is a copy of some sample I/O. Note that in the last case I get addit

Re: escaping characters in filenames

2009-07-29 Thread J Kenneth King
Nobody writes: > On Wed, 29 Jul 2009 09:29:55 -0400, J Kenneth King wrote: > >> I wrote a script to process some files using another program. One thing >> I noticed was that both os.listdir() and os.path.walk() will return >> unescaped file names (ie: "My File With Spaces & Stuff" instead of "My

Re: Differences Between Arrays and Matrices in Numpy

2009-07-29 Thread Robert Kern
On 2009-07-29 15:23, Nanime Puloski wrote: What are some differences between arrays and matrices using the Numpy library? When would I want to use arrays instead of matrices and vice versa? You will want to ask numpy questions on the numpy mailing list: http://www.scipy.org/Mailing_Lists An

Re: delayed sys.exit?

2009-07-29 Thread Stephen Hansen
> > In the attached http://www.nabble.com/file/p24726902/test.py test.py > code, > it appears that additional statements execute after the call to > sys.exit(0). > I'll be grateful if anyone can shed light on why this is happening. Below > is a copy of some sample I/O. Note that in the last case

Re: delayed sys.exit?

2009-07-29 Thread MRAB
Dr. Phillip M. Feldman wrote: In the attached http://www.nabble.com/file/p24726902/test.py test.py code, it appears that additional statements execute after the call to sys.exit(0). I'll be grateful if anyone can shed light on why this is happening. Below is a copy of some sample I/O. Note t

Re: delayed sys.exit?

2009-07-29 Thread Peter Otten
Dr. Phillip M. Feldman wrote: > In the attached http://www.nabble.com/file/p24726902/test.py test.py > code, it appears that additional statements execute after the call to > sys.exit(0). >try: > # If the conversion to int fails, nothing is appended to the list: > Runs.append(int

Re: set variable to looping index?

2009-07-29 Thread Peter Otten
Martin wrote: > I am trying to set the return value from a function to a name which I > grab from the for loop. I can't work out how I can do this without > using an if statement... > > for f in var1_fn, var2_fn, var3_fn: > if f.split('.')[0] == 'var1': > var1 = call_some_function(f)

Re: Does python have the capability for driver development ?

2009-07-29 Thread Diez B. Roggisch
MalC0de schrieb: hello there, I've a question : I want to know does python have any capability for using Ring0 and kernel functions for driver and device development stuff . if there's such a feature it is very good, and if there something for this kind that you know please refer me to some refer

Re: simple splash screen?

2009-07-29 Thread Martin P. Hellwig
NighterNet wrote: Thanks it help. Sorry about that, I was just wander what kind of answer and if there are other methods to learn it. Is there a way to position image to the center screen? Yes there is, just start reading from here: http://effbot.org/tkinterbook/ Though because Python 3 has

Re: how to embed the python interpreter into web App (Mehndi, Sibtey)

2009-07-29 Thread André
On Jul 29, 1:11 pm, Ryniek90 wrote: > > Hi All > > > I am trying to embed the python interpreter in to a web app but could > > not get the way, any one can suggest me how to do this. > > > Thanks, > > > Sibtey Mehdi > > > This e-mail (and any attachments), is confidential and may be privileged. >

IDLE Config Problems

2009-07-29 Thread Russ Davis
I am just getting started with Python and have installed v. 2.5.4 Idle version 1.2.4 I can't seem to get the idle to display text. It seems as if the install went fine. I start up the idle and the screen is blank. No text. It seems as if I can type on the screen but I just can't see the ch

Re: set variable to looping index?

2009-07-29 Thread Dave Angel
Martin wrote: Hi, I am trying to set the return value from a function to a name which I grab from the for loop. I can't work out how I can do this without using an if statement... for f in var1_fn, var2_fn, var3_fn: if f.split('.')[0] == 'var1': var1 = call_some_function(f)

Re: set variable to looping index?

2009-07-29 Thread Rhodri James
On Wed, 29 Jul 2009 19:56:28 +0100, Martin wrote: Hi, I am trying to set the return value from a function to a name which I grab from the for loop. I can't work out how I can do this without using an if statement... for f in var1_fn, var2_fn, var3_fn: if f.split('.')[0] == 'var1':

Re: Differences Between Arrays and Matrices in Numpy

2009-07-29 Thread Nobody
On Wed, 29 Jul 2009 16:23:33 -0400, Nanime Puloski wrote: > What are some differences between arrays and matrices using the Numpy > library? Matrices are always two-dimensional, as are slices of them. Matrices override mulitplication and exponentiation to use matrix multiplication rather than ele

Re: set variable to looping index?

2009-07-29 Thread Martin
On Jul 29, 11:02 pm, "Rhodri James" wrote: > On Wed, 29 Jul 2009 19:56:28 +0100, Martin wrote: > > Hi, > > > I am trying to set the return value from a function to a name which I > > grab from the for loop. I can't work out how I can do this without > > using an if statement... > > > for f in var

Re: Does python have the capability for driver development ?

2009-07-29 Thread Nick Craig-Wood
Diez B. Roggisch wrote: > MalC0de schrieb: > > hello there, I've a question : > > I want to know does python have any capability for using Ring0 and > > kernel functions for driver and device development stuff . > > if there's such a feature it is very good, and if there something for > > this ki

Re: set variable to looping index?

2009-07-29 Thread Jan Kaliszewski
30-07-2009 wrote: All I was trying to do was call a function and return the result to an a variable. I could admittedly of just done... var1 = some_function(var1_fn) var2 = some_function(var2_fn) var3 = some_function(var3_fn) where var1_fn, var2_fn, var3_fn are just filenames, e.g. var1_fn =

  1   2   >