Re: Translating keywords

2008-04-07 Thread Gabriel Genellina
En Tue, 08 Apr 2008 03:28:54 -0300, Arnaud Delobelle <[EMAIL PROTECTED]> escribió: > On Apr 8, 6:47 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > [...] >> Although I would use ∀ and ∃ as aliases for all() >> and exists() :) > > I mean all() and any() of course Yes, I thought about that usag

Re: Translating keywords

2008-04-07 Thread Gabriel Genellina
En Tue, 08 Apr 2008 03:03:13 -0300, Torsten Bronger <[EMAIL PROTECTED]> escribió: > Gabriel Genellina writes: >> >> Python 3 allows for unicode identifiers, but I don'k know any >> plans for using unicode keywords too. Looks funny: >> >> ∀ x ∈ values: >> if x ∉ forbidden ∧ x ≠ y: >> print(

Re: Translating keywords

2008-04-07 Thread Arnaud Delobelle
On Apr 8, 6:47 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: [...] > Although I would use ∀ and ∃ as aliases for all() > and exists() :) I mean all() and any() of course -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning curve for new database program with Python?

2008-04-07 Thread CM
On Apr 7, 1:19 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On 7 avr, 07:34, CM <[EMAIL PROTECTED]> wrote: > > > > > On Apr 5, 11:50 am, Jetus <[EMAIL PROTECTED]> wrote: > > > > I have a need for a database program. I downloaded the db2 from ibm, > > > and reviewed some of the documentation

Re: Translating keywords

2008-04-07 Thread Torsten Bronger
Hallöchen! Gabriel Genellina writes: > [...] > > Python 3 allows for unicode identifiers, but I don'k know any > plans for using unicode keywords too. Looks funny: > > ∀ x ∈ values: > if x ∉ forbidden ∧ x ≠ y: > print(x, Γ(x), √(x)) > print(∑(values)) > near = λ a,b,ε=0.01: a-ε ≤ b ≤ a+ε A

Re: reading dictionary's (key,value) from file

2008-04-07 Thread Raymond Hettinger
On Apr 7, 9:38 am, [EMAIL PROTECTED] wrote: > Folks, > Is it possible to read hash values from txt file. > I have script which sets options. Hash table has key set to option, > and values are option values. > > Way we have it, we set options in a different file (*.txt), and we > read from that file

Re: Translating keywords

2008-04-07 Thread Arnaud Delobelle
On Apr 8, 3:47 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > Python 3 allows for unicode identifiers, but I don'k know any plans for   > using unicode keywords too. Looks funny: > > ∀ x ∈ values: >    if x ∉ forbidden ∧ x ≠ y: >      print(x, Γ(x), √(x)) > print(∑(values)) > near = λ a,b,ε=0

Re: Welcome to the "Python-list" mailing list

2008-04-07 Thread Paul McGuire
On Apr 7, 9:54 am, Steve Holden <[EMAIL PROTECTED]> wrote: > Ronn Ross wrote: > > This is my first post and I'm new to Python. How would someone go about > > adding keywords to Python? It would be great to add support for > > Esperanto keywords in the language instead of English being the only > >

Re: A file iteration question/problem

2008-04-07 Thread Arnaud Delobelle
On Apr 7, 11:40 pm, John Nagle <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I want to iterate through the lines of a file in a recursive function > > so I can't use:- > > >     f = open(listfile, 'r') > >     for ln in f: > > > because when the function calls itself it won't see any mo

Re: ImportError: No module named MySQLdb

2008-04-07 Thread syed mehdi
Thanks Gabriel, it worked after installing MySQL (database engine). Regards Syed On Tue, Apr 8, 2008 at 10:23 AM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Tue, 08 Apr 2008 00:35:29 -0300, syed mehdi <[EMAIL PROTECTED]> > escribió: > > > I have been working in python from some time now, >

Re: Newbie: How to pass a dictionary to a function?

2008-04-07 Thread Gabriel Genellina
En Tue, 08 Apr 2008 01:57:47 -0300, Jason Scheirer <[EMAIL PROTECTED]> escribió: > You want to > return s, t > NOT return (s, t) -- this implicitly only returns ONE item To avoid confusing the poor newbie: No, they're absolutely the same thing, in both cases you're returning a tuple with two

Re: Newbie: How to pass a dictionary to a function?

2008-04-07 Thread Gabriel Genellina
En Tue, 08 Apr 2008 00:54:09 -0300, BonusOnus <[EMAIL PROTECTED]> escribió: > How do I pass a dictionary to a function as an argument? The indentation is lost, so it's not easy to check your program. > # Say I have a function foo... Original: def foo(arg=[]). An empty list isn't a good defaul

Re: Newbie: How to pass a dictionary to a function?

2008-04-07 Thread Brian
Plus you probably don't want to set [] as default argument and then try to access it like a dictionary; you'll get an exception if you ever call just foo(), with no argument. On Tue, Apr 8, 2008 at 12:57 AM, Jason Scheirer <[EMAIL PROTECTED]> wrote: > On Apr 7, 8:54 pm, BonusOnus <[EMAIL PROTECTE

Re: Newbie: How to pass a dictionary to a function?

2008-04-07 Thread Jason Scheirer
On Apr 7, 8:54 pm, BonusOnus <[EMAIL PROTECTED]> wrote: > How do I pass a dictionary to a function as an argument? > > # Say I have a function foo... > def foo (arg=[]): > x = arg['name'] > y = arg['len'] > > s = len (x) > > t = s + y > > return (s, t) > > # The dictionary: > > dict = {} > dict['na

Re: ImportError: No module named MySQLdb

2008-04-07 Thread Gabriel Genellina
En Tue, 08 Apr 2008 00:35:29 -0300, syed mehdi <[EMAIL PROTECTED]> escribió: > I have been working in python from some time now, > while writing a python script i used: import MySQLdb in my script to do > some > database related operations. > When i tried to execute the same script on another

Re: Translating keywords

2008-04-07 Thread Terry Reedy
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | En Mon, 07 Apr 2008 14:59:08 -0300, Terry Reedy <[EMAIL PROTECTED]> | escribió: | > If you want other-language keywords, you should either use a translator | > processor or an editor that will do keyword substitutio

Re: read large zip file

2008-04-07 Thread Gabriel Genellina
En Tue, 08 Apr 2008 00:10:01 -0300, John Nagle <[EMAIL PROTECTED]> escribió: > Gabriel Genellina wrote: >> En Sun, 06 Apr 2008 19:20:31 -0300, Brian Blais <[EMAIL PROTECTED]> >> escribió: >> >>> I need to read a series of large zipfiles (which only contain one >>> large text file), and I noticed

Re: guide through python interpreter source code

2008-04-07 Thread Terry Reedy
"Avi Kohn" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Are there documents,books, articles that can introduce me to the python | source code base ? This has been asked before. The general answer has been to look at the code. Perhaps you can find some of the more specific an

Re: splitting an XML file on the basis on basis of XML tags

2008-04-07 Thread bijeshn
On Apr 7, 5:34 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote: > bijeshn wrote: > > the extracted files are to be XML too. ijust need to extract it raw > > (tags and data just like it is in the parent XML file..) > > Ah, so then replace the "print tostring()" line in my example by > >     ET.ElementTr

Re: Newbie: How to pass a dictionary to a function?

2008-04-07 Thread Dan Bishop
On Apr 7, 10:54 pm, BonusOnus <[EMAIL PROTECTED]> wrote: > How do I pass a dictionary to a function as an argument? The same way you pass any other argument. > # Say I have a function foo... > def foo (arg=[]): It's generally a bad idea to use [] as a default argument. > x = arg['name'] > y = a

Re: Newbie: How to pass a dictionary to a function?

2008-04-07 Thread Matt Nordhoff
BonusOnus wrote: > How do I pass a dictionary to a function as an argument? > > > # Say I have a function foo... > def foo (arg=[]): > x = arg['name'] > y = arg['len'] > > s = len (x) > > t = s + y > > return (s, t) I assume you actually indented the body of the function? > # The dictionary:

Re: Adding Images To MySQL

2008-04-07 Thread Gabriel Genellina
En Mon, 07 Apr 2008 15:17:26 -0300, Victor Subervi <[EMAIL PROTECTED]> escribió: >> sql = "insert into PRODUCTS (PRODID, NAME, DESCRIPTION) " \ >> "values (%s,%s,%s);" >> cursor.execute(sql, (prodid, prodname, description)) >> >> and it works fine. >> >> Note that execute has t

Re: Newbie: How to pass a dictionary to a function?

2008-04-07 Thread Ricky Zhou
On 2008-04-07 08:54:09 PM, BonusOnus wrote: > How do I pass a dictionary to a function as an argument? > > > # Say I have a function foo... > def foo (arg=[]): Try: def foo(arg={}): Thanks, Ricky pgpXEZLwP4mLj.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-l

Newbie: How to pass a dictionary to a function?

2008-04-07 Thread BonusOnus
How do I pass a dictionary to a function as an argument? # Say I have a function foo... def foo (arg=[]): x = arg['name'] y = arg['len'] s = len (x) t = s + y return (s, t) # The dictionary: dict = {} dict['name'] = 'Joe Shmoe' dict['len'] = 44 # I try to pass the dictionary as an argument

ImportError: No module named MySQLdb

2008-04-07 Thread syed mehdi
Hi Guys, I have been working in python from some time now, while writing a python script i used: import MySQLdb in my script to do some database related operations. When i tried to execute the same script on another system it gave me an error as: "ImportError: No module named MySQLdb" though mysqld

Re: Help replacing os.system call with subprocess call

2008-04-07 Thread David Pratt
Hi Matt. My apologies, I was away a good part of the day and evening today. Here are the numbers for the different methods: original os.system call: 29.685759 s buffered stdout call:213.370982 s (with 1mb buffer) direct to stdout call:33.378756 s The second method worked great and is e

guide through python interpreter source code

2008-04-07 Thread Avi Kohn
Are there documents,books, articles that can introduce me to the python source code base ? Thank you! Avi -- http://mail.python.org/mailman/listinfo/python-list

Re: read large zip file

2008-04-07 Thread John Nagle
Gabriel Genellina wrote: > En Sun, 06 Apr 2008 19:20:31 -0300, Brian Blais <[EMAIL PROTECTED]> > escribió: > >> I need to read a series of large zipfiles (which only contain one >> large text file), and I noticed that the zipfile module: >> >> 1) has a read method which isn't an iterator, and ret

python, Mysql_python, storm problem

2008-04-07 Thread paul Batoum.
I am actually tryng to build a database apps in python + storm which use MySQLdb 1.2.2 i actually want the auto reconnect feature of storm, which just need to change the False param of raw_connect to True in storm/databases/mysql.py so far nothing really difficult but from there i got quite a weir

Re: Translating keywords

2008-04-07 Thread Gabriel Genellina
En Mon, 07 Apr 2008 14:59:08 -0300, Terry Reedy <[EMAIL PROTECTED]> escribió: > "Ronn Ross" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | This is my first post and I'm new to Python. How would someone go about > | adding keywords to Python? It would be great to add support for

Re: pyAmazon

2008-04-07 Thread steve
I noticed it's happening at the line that does the parsing: dom = minidom.parse(usock), in pyaws/ecs.py I'll look into how to turn off the outputting. On Apr 7, 4:20 pm, steve <[EMAIL PROTECTED]> wrote: > Anyone familiar with pyAmazon ( the latest for AWS 4

Re: A funnily inconsistent behavior of int and float

2008-04-07 Thread Terry Reedy
"Mark Dickinson" <[EMAIL PROTECTED]> wrote in message | Excellent! | It looks to me as though this covers everything. I'm tempted to | quibble about exact wordings, but probably the most productive thing to do | would be just to submit this to bugs.python.org and then let Georg Brandl | work his

Re: A funnily inconsistent behavior of int and float

2008-04-07 Thread Mark Dickinson
On Apr 7, 4:59 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Mark Dickinson" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > Thank you for the corrections. Here is my revised proposal: > > int([number | string[, radix]) > ... Excellent! It looks to me as though this covers e

Re: popen pipe limit

2008-04-07 Thread Gabriel Genellina
En Mon, 07 Apr 2008 20:52:54 -0300, skunkwerk <[EMAIL PROTECTED]> escribió: > I'm getting errors when reading from/writing to pipes that are fairly > large in size. To bypass this, I wanted to redirect output to a file > in the subprocess.Popen function, but couldn't get it to work (even > afte

Re: Recursively Backup Directories

2008-04-07 Thread Aahz
In article <[EMAIL PROTECTED]>, Jorgen Grahn <[EMAIL PROTECTED]> wrote: > >I believe it is better to write a script which drives a widely known >and well-tested copying utility. On Unix these include tar, cpio and >rsync -- don't know which ones are common under DOS (xcopy?) Just use pax (I haven

Re: troll poll

2008-04-07 Thread Aahz
In article <[EMAIL PROTECTED]>, alex23 <[EMAIL PROTECTED]> wrote: >(Aahz) wrote: >> alex23 wrote: >>> >>>The usual >>>response to complaining about the lack of a killfile for Google Groups >>>has been "use a decent client", but as I'm constantly moving between >>>machines having a consistent app f

Re: Data structure recommendation?

2008-04-07 Thread Paul McGuire
On Apr 7, 3:58 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > > I believe the best way to implement this would be a binary search > (bisect?) on the actual times, which would be O(log N). bisect is definitely the way to go. You should take care with floating point precision, though. One way to do

popen pipe limit

2008-04-07 Thread skunkwerk
I'm getting errors when reading from/writing to pipes that are fairly large in size. To bypass this, I wanted to redirect output to a file in the subprocess.Popen function, but couldn't get it to work (even after setting Shell=True). I tried adding ">","temp.sql" after the password field but mysq

Re: A funnily inconsistent behavior of int and float

2008-04-07 Thread Colin J. Williams
Terry Reedy wrote: > "Mark Dickinson" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | On Apr 7, 6:43 am, "Colin J. Williams" <[EMAIL PROTECTED]> wrote: > | > This is good but the documentation for > | > 3.0 is missing the syntax documentation > | > from 2.5 > | > | Is > | > | >

pyAmazon

2008-04-07 Thread steve
Anyone familiar with pyAmazon ( the latest for AWS 4.0 ), who knows why the ItemSearch echo's the XML that is retrieved ? My statement is products = ecs.ItemSearch("Duma Key", SearchIndex='Books') And the "products" list is populated okay, however before my script ends ( executing script on DOS c

Re: Orphaned child processes

2008-04-07 Thread Donn Cave
In article <[EMAIL PROTECTED]>, John Nagle <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I'm using the Python processing module. I've just run into a problem > > though. Actually, it's a more general problem that isn't specific to > > this module, but to the handling of Unix (Linux pr

Re: Dependency Queue

2008-04-07 Thread Carl Banks
On Apr 7, 1:13 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Carl Banks" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | I'm looking for any information about a certain kind of dynamic data > | structure. Not knowing if it has some well-known name that I could > | have Google

playing around with python

2008-04-07 Thread Ronn Ross
Hello all, I downloaded the source for version 2.5.2 and I played around and made some changes, but now I don't know how to compile on my machine to test them. Can someone tell me how to compile it to run on my machine? I'm trying to get familiar with it before I volunteer. Also, I'm running Unbun

Re: A file iteration question/problem

2008-04-07 Thread John Nagle
[EMAIL PROTECTED] wrote: > I want to iterate through the lines of a file in a recursive function > so I can't use:- > > f = open(listfile, 'r') > for ln in f: > > because when the function calls itself it won't see any more lines in > the file. E.g. more fully I want to do somthing like:

playing around with python

2008-04-07 Thread Ronn Ross
Hello, I download the source for -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with smtplib and py2exe

2008-04-07 Thread Terry Reedy
"Kevin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Hi everyone, | | I'm running Python 2.5.1 on an XP-Pro platform, with all the updates | (SP2, etc) installed. I have a program (send_file.py) that sends a | file to a service provider, using an ftp connection. The program | wo

Re: Data structure recommendation?

2008-04-07 Thread Charles Mason
If you can imply a partial order on your ranges then you can get O(n lg n) random access using a heap data structure. You'll have to implement your own heap, but heap search is easy to implement (it's Heapify that might require a little thinking). This will only work, of course, if your ranges ar

Re: A funnily inconsistent behavior of int and float

2008-04-07 Thread Lie
On Apr 8, 2:15 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: (snip) > 2. Replace text with: > Convert a number or string to an integer.  If no arguments are given, > return 0.  If a number is given, return number.__int__().  Conversion of > floating point numbers to integers truncates towards zero.

Re: A funnily inconsistent behavior of int and float

2008-04-07 Thread Terry Reedy
"Mark Dickinson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Thank you for the corrections. Here is my revised proposal: int([number | string[, radix]) Convert a number or string to an integer. If no arguments are given, return 0. If a number is given, return number.__int__().

Re: Data structure recommendation?

2008-04-07 Thread Steve Holden
Steven Clark wrote: > Hi all- > > I'm looking for a data structure that is a bit like a dictionary or a > hash map. In particular, I want a mapping of floats to objects. > However, I want to map a RANGE of floats to an object. > > This will be used for timestamped storage / lookup, where the floa

Re: Data structure recommendation?

2008-04-07 Thread Martin v. Löwis
> I know that foo.get() will be called many times for each foo.put(). Is > there any way to achieve O(1) performance for foo.get(), maybe via > some kind of hash function? Or is the best thing to use some kind of > binary search? If you know something about the density of the input values, O(1) is

Data structure recommendation?

2008-04-07 Thread Steven Clark
Hi all- I'm looking for a data structure that is a bit like a dictionary or a hash map. In particular, I want a mapping of floats to objects. However, I want to map a RANGE of floats to an object. This will be used for timestamped storage / lookup, where the float represents the timestamp. get(x)

Re: Mathematical Python Library

2008-04-07 Thread Jaap Spies
Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >> On Mon, 7 Apr 2008 09:05:57 -0700 (PDT), mc <[EMAIL PROTECTED]> >> declaimed the following in comp.lang.python: >> >>> I'm looking for a library which can do mathematical stuff like >>> solving

Re: reading dictionary's (key,value) from file

2008-04-07 Thread Terry Reedy
You can use execfile (or exec, in 3.0) function to execute code in a file in the present context. -- http://mail.python.org/mailman/listinfo/python-list

Re: A funnily inconsistent behavior of int and float

2008-04-07 Thread Mark Dickinson
On Apr 7, 3:53 pm, Mark Dickinson <[EMAIL PROTECTED]> wrote: > The only base 0 versus base 10 difference I could find was the > following: > > >>> int('033', 0) > > Traceback (most recent call last): > File "", line 1, in > ValueError: invalid literal for int() with base 0: '033' > [38720 refs]>

Re: A funnily inconsistent behavior of int and float

2008-04-07 Thread Mark Dickinson
On Apr 7, 3:15 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > > My suggestions: > 1. Change signature to: int([number | string[, radix]). > This makes it clear that radix can only follow a string without having to > say so in the text. > > 2. Replace text with: > Convert a number or string to an in

Problem with smtplib and py2exe

2008-04-07 Thread Kevin
Hi everyone, I'm running Python 2.5.1 on an XP-Pro platform, with all the updates (SP2, etc) installed. I have a program (send_file.py) that sends a file to a service provider, using an ftp connection. The program works properly, and I've created an 'exe' of it, using py2exe. It was distrubuted

Re: reading dictionary's (key,value) from file

2008-04-07 Thread ankitks . mital
On Apr 7, 11:55 am, Robert Bossy <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Folks, > > Is it possible to read hash values from txt file. > > I have script which sets options. Hash table has key set to option, > > and values are option values. > > > Way we have it, we set options in a

Re: A funnily inconsistent behavior of int and float

2008-04-07 Thread Terry Reedy
"Mark Dickinson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Apr 7, 6:43 am, "Colin J. Williams" <[EMAIL PROTECTED]> wrote: | > This is good but the documentation for | > 3.0 is missing the syntax documentation | > from 2.5 | | Is | | http://docs.python.org/dev/3.0/reference

Re: Mathematical Python Library

2008-04-07 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >On Mon, 7 Apr 2008 09:05:57 -0700 (PDT), mc <[EMAIL PROTECTED]> >declaimed the following in comp.lang.python: > >> I'm looking for a library which can do mathematical stuff like >> solving equations. Or calculation the

Re: A file iteration question/problem

2008-04-07 Thread Arnaud Delobelle
On Apr 7, 2:09 pm, [EMAIL PROTECTED] wrote: > Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > > def recfun(lines): > >     for line in lines: > >         # Do stuff > >         if condition: > >             recfun(lines) > > > lines = iter(open(filename)) > > recfun(lines) > > Does that work though?

Re: Tips for load balancing multiple Python apps on dual/quad core processors?

2008-04-07 Thread Steve Holden
Malcolm Greene wrote: > I'm looking for tips on how to load balance running multiple Python > applications in multi-CPU environments. My understanding is that Python > applications and their threads are limited to a specific CPU. > > Background: I have a Python utility that processes email message

Re: Tips for load balancing multiple Python apps on dual/quad core processors?

2008-04-07 Thread Paul Rubin
"Malcolm Greene" <[EMAIL PROTECTED]> writes: > Is there a cross-platform way to monitor CPU load? Cross-platform: not that I know of. Linux: /proc/loadav (load average), /proc/cpuinfo (to figure out number of cpu's). You want the load average and # of cpu's to be about equal, i.e. all cpu's

Re: Tips for load balancing multiple Python apps on dual/quad core processors?

2008-04-07 Thread Jeffrey Froman
Malcolm Greene wrote: > I'm looking for tips on how to load balance running multiple Python > applications in multi-CPU environments. My understanding is that Python > applications and their threads are limited to a specific CPU. > > Background: I have a Python utility that processes email messag

Re: Orphaned child processes

2008-04-07 Thread John Nagle
[EMAIL PROTECTED] wrote: > I'm using the Python processing module. I've just run into a problem > though. Actually, it's a more general problem that isn't specific to > this module, but to the handling of Unix (Linux processes) in general. > Suppose for instance that for some reason or another, aft

Re: Adding Images To MySQL

2008-04-07 Thread Victor Subervi
in line... On 4/5/08, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > En Sat, 05 Apr 2008 11:32:00 -0300, Victor Subervi > <[EMAIL PROTECTED]> escribió: > > >> * *- You say Content-Type: image/jpeg but you emit HTML code. You're > >> lucky > > if you see any > > > >> * *text at all. > > > > Well,

Tips for load balancing multiple Python apps on dual/quad core processors?

2008-04-07 Thread Malcolm Greene
I'm looking for tips on how to load balance running multiple Python applications in multi-CPU environments. My understanding is that Python applications and their threads are limited to a specific CPU. Background: I have a Python utility that processes email messages. I suspect there's a lot of id

Re: Welcome to the "Python-list" mailing list

2008-04-07 Thread Terry Reedy
"Ronn Ross" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | This is my first post and I'm new to Python. How would someone go about | adding keywords to Python? It would be great to add support for Esperanto | keywords in the language instead of English being the only option. If yo

Re: Learning curve for new database program with Python?

2008-04-07 Thread [EMAIL PROTECTED]
On 5 avr, 17:50, Jetus <[EMAIL PROTECTED]> wrote: > I have a need for a database program. I downloaded the db2 from ibm, > and reviewed some of the documentation. > > My question is, what is the easiest program for me to try to learn. I > will be creating a database of about 25,000 records, it will

Re: Learning curve for new database program with Python?

2008-04-07 Thread [EMAIL PROTECTED]
On 7 avr, 07:34, CM <[EMAIL PROTECTED]> wrote: > On Apr 5, 11:50 am, Jetus <[EMAIL PROTECTED]> wrote: > > > I have a need for a database program. I downloaded the db2 from ibm, > > and reviewed some of the documentation. > > > My question is, what is the easiest program for me to try to learn. I >

Re: First Python project - comments welcome!

2008-04-07 Thread Paul Scott
On Mon, 2008-04-07 at 09:56 -0700, Lie wrote: > I don't know if it was just me, but I can't just scan through your > code briefly to know what it is about (as is with any non-trivial > codes), only after looking through the website's Roadmap I realized > it's something to do with audio and recordi

Re: Dependency Queue

2008-04-07 Thread Terry Reedy
"Carl Banks" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | I'm looking for any information about a certain kind of dynamic data | structure. Not knowing if it has some well-known name that I could | have Googled, I'll just call it a dependency queue. It's like a | priority queue

Re: First Python project - comments welcome!

2008-04-07 Thread Lie
On Apr 7, 3:03 pm, Paul Scott <[EMAIL PROTECTED]> wrote: > I have started, and made some progress (OK it works, but needs some > love) on my first real Python application. > > http://cvs2.uwc.ac.za/trac/python_tools/browser/podder > > I would love some feedback on what I have done. In total this ha

Re: reading dictionary's (key,value) from file

2008-04-07 Thread Robert Bossy
[EMAIL PROTECTED] wrote: > Folks, > Is it possible to read hash values from txt file. > I have script which sets options. Hash table has key set to option, > and values are option values. > > Way we have it, we set options in a different file (*.txt), and we > read from that file. > Is there easy w

Re: reading dictionary's (key,value) from file

2008-04-07 Thread Jeffrey Froman
[EMAIL PROTECTED] wrote: > so this is what my option files look like: > > 1opt.txt > { '-cc': '12', > '-I': r'/my/path/work/'} You can turn these strings read from text files into actual dictionaries using eval: >>> d = eval("{ '-cc': '12', '-I': r'/my/path/work/'}") >>> d {'-I': '/my/path/work

pylirc question: clearing the queue

2008-04-07 Thread jesse . k . rosenthal
Hi all, Is there a way in the pylirc module to either (a) get it to stop listening for a period of time, or (b) clear the queue of any stored up commands? I have a script that starts mplayer, and I use my remote while I'm running mplayer. The shell script waits (subrpocess.Popen.wait()) for the mp

Re: reading dictionary's (key,value) from file

2008-04-07 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Folks, > Is it possible to read hash values from txt file. > I have script which sets options. Hash table has key set to option, > and values are option values. > > Way we have it, we set options in a different file (*.txt), and we > read from that file. > Is there easy

reading dictionary's (key,value) from file

2008-04-07 Thread ankitks . mital
Folks, Is it possible to read hash values from txt file. I have script which sets options. Hash table has key set to option, and values are option values. Way we have it, we set options in a different file (*.txt), and we read from that file. Is there easy way for just reading file and setting opt

Re: Mathematical Python Library

2008-04-07 Thread Rob Clewley
The closest thing so far is probably going to be a combination of the numpy, scipy, and sympy libraries. The latter is the one with the most functionality for solving equations algebraically, but is also the least mature package at the moment. The first two also provide the basic tools for calculat

Re: Learning curve for new database program with Python?

2008-04-07 Thread M.-A. Lemburg
On 2008-04-07 15:30, Greg Lindstrom wrote: > On Sun, Apr 6, 2008 at 2:31 AM, John Nagle <[EMAIL PROTECTED]> wrote: >> Basic SQL isn't that hard. Learn CREATE, SELECT, INSERT, >> UPDATE, and DELETE syntax. That's enough for most simple >> applications. > > And then learn more advanced SQL:

Mathematical Python Library

2008-04-07 Thread mc
I'm looking for a library which can do mathematical stuff like solving equations. Or calculation the nulls of a function and so on. Does anyone know one? Thanks in advance! -- http://mail.python.org/mailman/listinfo/python-list

WORLD TOURSIM WORLD TRAVEL WORLD PACKAGE

2008-04-07 Thread TAJMAHAL TEMPLE
Freee... Freee Fr http://sai-tourism-package.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Help replacing os.system call with subprocess call

2008-04-07 Thread David Pratt
Hi Matt. Many thanks. Sorry I had not seen your second post. I'll give this a try and time the completion to compare the differences and post back later today to show os.system, buffered imput and using a file directly for stdout. Regards, David Matt Nordhoff wrote: > David Pratt wrote: >> Hi

Re: Python Data Utils

2008-04-07 Thread Jesse Aldridge
> But then you introduced more. oops. old habits... > mxTextTools. This looks cool, so does the associated book - "Text Processing in Python". I'll look into them. > def normalise_whitespace(s): >     return ' '.join(s.split()) Ok, fixed. > a.replace('\xA0', ' ') in there somewhere. Added.

Re: Welcome to the "Python-list" mailing list

2008-04-07 Thread Steve Holden
Ronn Ross wrote: > This is my first post and I'm new to Python. How would someone go about > adding keywords to Python? It would be great to add support for > Esperanto keywords in the language instead of English being the only > option. > Unfortunately the resulting language would no longer b

Re: Welcome to the "Python-list" mailing list

2008-04-07 Thread Ronn Ross
This is my first post and I'm new to Python. How would someone go about adding keywords to Python? It would be great to add support for Esperanto keywords in the language instead of English being the only option. thx -- http://mail.python.org/mailman/listinfo/python-list

Re: Adherence to PEP 8 for published code

2008-04-07 Thread Ben Finney
Aldo Cortesi <[EMAIL PROTECTED]> writes: > This is getting silly. Agreed. > Let's recap. You are upset Not at all. -- \ "We spend the first twelve months of our children's lives | `\ teaching them to walk and talk and the next twelve years | _o__)telling them to

Orphaned child processes

2008-04-07 Thread rocco . rossi
I'm using the Python processing module. I've just run into a problem though. Actually, it's a more general problem that isn't specific to this module, but to the handling of Unix (Linux processes) in general. Suppose for instance that for some reason or another, after forking several child processe

Getting a value from a nested dictionary

2008-04-07 Thread Cunningham, Dan
Hi, My name is Dan and I'm a newb to python (and programming. Please forgive) I am trying to get a value from a nested dictionary. I would like to pass in a parameter from a conf file, then compare it to a value in the dictionary, and verify that it is a valid value. (The SSL_MODE Portion of th

Re: Calling CVF-Fortran-dll with ctypes and simple structure

2008-04-07 Thread Gabriel Genellina
En Mon, 07 Apr 2008 09:19:03 -0300, Michael Schäfer <[EMAIL PROTECTED]> escribió: > Hi all, > > I deal with the old problem passing characters from python to a > fortran dll build with CFV6.6c. > I reduced our complex structure to a simple one. Here is the Fortran > code: > > SUBROUTINE D

Re: Help replacing os.system call with subprocess call

2008-04-07 Thread Matt Nordhoff
David Pratt wrote: > Hi David and Matt. I appreciate your help which has got me moving > forward again so many thanks for your reply. I have been using > subprocess.Popen a fair bit but this was the first time I had to use > subprocess to capture large file output. The trouble I was having was > wi

Python-URL! - weekly Python news and links (Apr 7)

2008-04-07 Thread Gabriel Genellina
QOTW: "Describing [Python] as a 'scripting language' is like describing a fully-equipped professional kitchen as 'a left-over warming room'." - Steven D'Aprano "[S]ocial measures are the only thing that *can* properly deal with these issues [in this case, naming conflicts, functionality non-parti

Re: Dependency Queue

2008-04-07 Thread Stefan Behnel
Carl Banks wrote: > I'm looking for any information about a certain kind of dynamic data > structure. Not knowing if it has some well-known name that I could > have Googled, I'll just call it a dependency queue. It's like a > priority queue except instead of a strict ordering of items by > priori

Re: A funnily inconsistent behavior of int and float

2008-04-07 Thread Mark Dickinson
On Apr 7, 6:43 am, "Colin J. Williams" <[EMAIL PROTECTED]> wrote: > This is good but the documentation for > 3.0 is missing the syntax documentation > from 2.5 Is http://docs.python.org/dev/3.0/reference/lexical_analysis.html#integer-literals the documentation that you're looking for? But it se

Re: Help replacing os.system call with subprocess call

2008-04-07 Thread Gabriel Genellina
>> David Pratt wrote: >>> Hi. I am trying to replace a system call with a subprocess call. I have >>> tried subprocess.Popen and subprocess.call with but have not been >>> successful. The command line would be: >>> >>> svnadmin dump /my/repository > svndump.db En Mon, 07 Apr 2008 10:38:47 -0300, D

Re: A file iteration question/problem

2008-04-07 Thread Gabriel Genellina
En Mon, 07 Apr 2008 10:09:13 -0300, <[EMAIL PROTECTED]> escribió: > Arnaud Delobelle <[EMAIL PROTECTED]> wrote: >> def recfun(lines): >> for line in lines: >> # Do stuff >> if condition: >> recfun(lines) >> >> lines = iter(open(filename)) >> recfun(lines) >> > Does

Re: Help replacing os.system call with subprocess call

2008-04-07 Thread David Pratt
Hi David and Matt. I appreciate your help which has got me moving forward again so many thanks for your reply. I have been using subprocess.Popen a fair bit but this was the first time I had to use subprocess to capture large file output. The trouble I was having was with the process would just

Re: Learning curve for new database program with Python?

2008-04-07 Thread Greg Lindstrom
On Sun, Apr 6, 2008 at 2:31 AM, John Nagle <[EMAIL PROTECTED]> wrote: > > Basic SQL isn't that hard. Learn CREATE, SELECT, INSERT, > UPDATE, and DELETE syntax. That's enough for most simple > applications. And then learn more advanced SQL: joins, nested selects, pivot tables and stored pro

Re: Wxpython. Is it possible to change layout in a running application? Selfmade listbox

2008-04-07 Thread SPE - Stani's Python Editor
On Apr 7, 2:54 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On Apr 7, 6:50 am, Soren <[EMAIL PROTECTED]> wrote: > > Hi, > > > Id like to make my own special listbox.. I want to able (at the push > > of a button) to add another item to my special listbox... each item is > > a panel with a label, s

Re: First Python project - comments welcome!

2008-04-07 Thread [EMAIL PROTECTED]
On 7 avr, 10:03, Paul Scott <[EMAIL PROTECTED]> wrote: > I have started, and made some progress (OK it works, but needs some > love) on my first real Python application. > > http://cvs2.uwc.ac.za/trac/python_tools/browser/podder > > I would love some feedback on what I have done. In total this has

  1   2   >