[ANN] Leipzig Python User Group - Meeting, April 8, 2008, 08:00pm

2008-04-07 Thread Mike Müller
=== Leipzig Python User Group === We will meet on Tuesday, April 8 at 8:00 pm at the training center of Python Academy in Leipzig, Germany ( http://www.python-academy.com/center/find.html ). Food and soft drinks are provided. Please send a short confirmation mail to [EMAIL PROTECTED], so we can

ANN: Leo 4.4.8 final

2008-04-07 Thread Edward K Ream
Leo 4.4.8 final is now available at: http://sourceforge.net/project/showfiles.php?group_id=3458package_id=29106 This version features a new ipython plugin that provides a two-way bridge between Leo and IPython. See http://webpages.charter.net/edreamleo/IPythonBridge.html Leo is a text editor,

setuptools_bzr 1.1

2008-04-07 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm happy to announce the setuptools_bzr 1.1 plugin for Python's setuptools. This allows setuptools to find your Python package files kept under the Bazaar revision control system. setuptools_bzr 1.1 should be compatible with Bazaar 1.3. This

Re: how to do load script; run script in a loop in embedded python?

2008-04-07 Thread Gabriel Genellina
En Thu, 03 Apr 2008 20:52:31 -0300, [EMAIL PROTECTED] escribió: Hi, all, I am currently involved in a project that needs to load/run a python script dynamically in a C application. The sample code is as following: PyObject *LoadScript(char *file, char *func) { PyObject *pName,

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

2008-04-07 Thread Stefan Behnel
[EMAIL PROTECTED] schrieb: Hi all, i have an XML file with the following structure:: r1 r2-| r3 | r4 | . | . | constitutes one record. . | . | . | /r4| /r3| /r2| r2 .

Re: Parsing HTML?

2008-04-07 Thread Stefan Behnel
Benjamin wrote: I'm trying to parse an HTML file. I want to retrieve all of the text inside a certain tag that I find with XPath. The DOM seems to make this available with the innerHTML element, but I haven't found a way to do it in Python. import lxml.html as h tree =

Re: html DOM

2008-04-07 Thread Stefan Behnel
Sam the Cat wrote: Is there a package that would allow me the same or similar functionality for modifying html code via the DOM model as I have in JavaScript ? I'd like to parse an html file, then modify it and save the result. I am not trying to do this online, rather I would like to do

Re: How to get an XML DOM while offline?

2008-04-07 Thread Stefan Behnel
william tanksley wrote: I want to parse my iTunes Library xml. All was well, until I unplugged and left for the train (where I get most of my personal projects done). All of a sudden, I discovered that apparently the presence of a DOCTYPE in the iTunes XML makes xml.dom.minidom insist on

Re: Python Data Utils

2008-04-07 Thread Jesse Aldridge
Docstrings go *after* the def statement. Fixed. changing ( to ( and ) to ). Changed. I attempted to take out everything that could be trivially implemented with the standard library. This has left me with... 4 functions in S.py. 1 one of them is used internally, and the others aren't

Getting jabber:iq:last with xmpppy

2008-04-07 Thread georgeencina
Hi, I'm trying to do the following with the xmpppy library: - log on to the google jabber server - get idle time of one specific person on my roster. Idle time means the values of jabber:iq:last. When I do this in pidgin with the xmpp console open, I get the following conversation: (me) iq

Re: How to get an XML DOM while offline?

2008-04-07 Thread Fredrik Lundh
Stefan Behnel wrote: Is there a simpler way to read the iTunes XML? (It's merely a plist, so the format is much simpler than general XML.) Try lxml. Since version 2.0, its parsers will not access the network unless you tell it to do so. http://codespeak.net/lxml which makes it true for

Re: while-loops enter the last time after condition is filled?

2008-04-07 Thread Sumit
On Apr 6, 4:53 am, [EMAIL PROTECTED] wrote: it seems to me from my results that when i use a while-loop it will execute once after the condition is met. Perhaps your condition is wrong. Please provide the code where this occured. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help replacing os.system call with subprocess call

2008-04-07 Thread Matt Nordhoff
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 This is what I am using currently:

Re: Help replacing os.system call with subprocess call

2008-04-07 Thread Matt Nordhoff
Matt Nordhoff wrote: 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 This is what I am using

ldap

2008-04-07 Thread mr . enx
sorry, i'm new with Python. I must do interaction beetween Python and Ldap, and I don't know how do this. Searching on the web I know that exists PythonLdap, but I dont'know if this is best choise or not. Thank's -- http://mail.python.org/mailman/listinfo/python-list

Re: Adherence to PEP 8 for published code (was: ANN: pry unit testing framework)

2008-04-07 Thread Aldo Cortesi
Thus spake Ben Finney ([EMAIL PROTECTED]): PEP 8 only has the force that people grant it. Nevertheless, it's a style guide that's widely accepted in the Python community, and adhering to it in one's code makes it easier to read for the majority, because it reduces the needless inconsistencies

First Python project - comments welcome!

2008-04-07 Thread Paul Scott
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 taken me 5 nights to do (I am working on it at night as PHP,

csv.DictReader and unicode

2008-04-07 Thread Laszlo Nagy
This program fin = codecs.open(fname,r,encoding=UTF-8) eader = csv.DictReader(fin) for values in reader: pass results in: File run.py, line 23, in process_file for values in reader: File /usr/local/lib/python2.5/csv.py, line 83, in next row = self.reader.next()

Re: ldap

2008-04-07 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: sorry, i'm new with Python. I must do interaction beetween Python and Ldap, and I don't know how do this. Searching on the web I know that exists PythonLdap, but I dont'know if this is best choise or not. Who cares? Use it, and see if it's good enough for your

Re: csv.DictReader and unicode

2008-04-07 Thread Laszlo Nagy
Peter Otten wrote: Laszlo Nagy wrote: This program fin = codecs.open(fname,r,encoding=UTF-8) eader = csv.DictReader(fin) for values in reader: pass results in: File run.py, line 23, in process_file for values in reader: File /usr/local/lib/python2.5/csv.py, line 83,

Re: csv.DictReader and unicode

2008-04-07 Thread Peter Otten
Laszlo Nagy wrote: This program fin = codecs.open(fname,r,encoding=UTF-8) eader = csv.DictReader(fin) for values in reader: pass results in: File run.py, line 23, in process_file for values in reader: File /usr/local/lib/python2.5/csv.py, line 83, in next row =

Re: csv.DictReader and unicode

2008-04-07 Thread Jarek Zgoda
Laszlo Nagy napisał(a): This program fin = codecs.open(fname,r,encoding=UTF-8) eader = csv.DictReader(fin) for values in reader: pass results in: File run.py, line 23, in process_file for values in reader: File /usr/local/lib/python2.5/csv.py, line 83, in next row =

Re: ldap

2008-04-07 Thread David Harrison
On 07/04/2008, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: sorry, i'm new with Python. I must do interaction beetween Python and Ldap, and I don't know how do this. Searching on the web I know that exists PythonLdap, but I dont'know if this is best choise or not. Thank's --

Re: Python Data Utils

2008-04-07 Thread John Machin
On Apr 7, 4:22 pm, Jesse Aldridge [EMAIL PROTECTED] wrote: changing ( to ( and ) to ). Changed. But then you introduced more. I attempted to take out everything that could be trivially implemented with the standard library. This has left me with... 4 functions in S.py.  1 one of them

Re: A funnily inconsistent behavior of int and float

2008-04-07 Thread Colin J. Williams
Mark Dickinson wrote: On Apr 6, 1:29 pm, Lie [EMAIL PROTECTED] wrote: I've noticed some oddly inconsistent behavior with int and float: Python 2.5.1 (r251:54863, Mar 7 2008, 03:39:23) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 int('- 345') -345 works,

Re: csv.DictReader and unicode

2008-04-07 Thread Peter Otten
Laszlo Nagy wrote: Read the values as byte strings and decode afterwards. Or monkey-patch: import csv def make_reader(fin, encoding=UTF-8): reader = csv.DictReader(fin) reader.reader = ([col.decode(encoding) for col in row] for row in reader.reader) return reader fin =

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

2008-04-07 Thread bijeshn
What do you mean by written down to a separate file? Do you have a specific format in mind? sorry, it should be extracted into separate files. i.e. if i have an XML file containing 10 million records, i need to split the file to 100 files containing 100,000 records each. i hope this is

Re: Python-by-example - new online guide to Python Standard Library

2008-04-07 Thread Gerard Flanagan
On Apr 3, 8:33 pm, AK [EMAIL PROTECTED] wrote: AK wrote: Hello, I find that I learn easier when I go from specific examples to a more general explanation of function's utility and I made a reference guide that will eventually document all functions, classes and methods in Python's

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

2008-04-07 Thread bijeshn
pls disregard the above post On Apr 7, 3:13 pm, bijeshn [EMAIL PROTECTED] wrote: What do you mean by written down to a separate file? Do you have a specific format in mind? sorry, it should be extracted into separate XML files. i.e. if i have an XML file containing 10 million

Re: First Python project - comments welcome!

2008-04-07 Thread Steve Holden
Paul Scott 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 taken me 5 nights to do (I am working

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

2008-04-07 Thread bijeshn
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..) -- http://mail.python.org/mailman/listinfo/python-list

Re: First Python project - comments welcome!

2008-04-07 Thread Paul Scott
On Mon, 2008-04-07 at 07:05 -0400, Steve Holden wrote: The code looks pretty good to someone that doesn't know Gtk graphics. Err, neither do I, so I guess that means its OK? :) 184: self.wTree2=gtk.glade.XML(globaldir+podder.glade,serverdialogue) could really do with using

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

2008-04-07 Thread Soren
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, some buttons and maybe a text control. I've tried adding a new panel object with the stuff i want to the sizer i'm using for my

Re: while-loops enter the last time after condition is filled?

2008-04-07 Thread [EMAIL PROTECTED]
On 6 avr, 01:53, [EMAIL PROTECTED] wrote: it seems to me from my results that when i use a while-loop it will execute once after the condition is met. ie the conditions is met the code executes one time more and then quits. The problem is obviously in your code, but since you failed to post

Calling CVF-Fortran-dll with ctypes and simple structure

2008-04-07 Thread Michael Schäfer
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 DEMO2L(s) C sample for calling CVF6.6c-DLLs from C vb/vba/python with simple structure

Re: ldap

2008-04-07 Thread Michael Ströder
[EMAIL PROTECTED] wrote: Searching on the web I know that exists PythonLdap, but I dont'know if this is best choise or not. http://python-ldap.sf.net is the most complete implementation I know of. (Being the maintainer I might be biased.) It has the caveat of depending on the OpenLDAP client

Re: First Python project - comments welcome!

2008-04-07 Thread cokofreedom
Just a random check. Is __gsignals__ a builtin type? Else it would probably be better not to include the postfix underscores. Though I might be wrong here. Otherwise seems pretty good and well organised. I hate it when people go comment mad, but you've kept them to the places where an explanation

Dependency Queue

2008-04-07 Thread Carl Banks
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 priority, there is only a

Re: @x.setter property implementation

2008-04-07 Thread Floris Bruynooghe
On Apr 6, 6:41 pm, Daniel Fetchinson [EMAIL PROTECTED] wrote: I found out about the new methods on properties, .setter() and .deleter(), in python 2.6. Obviously that's a very tempting syntax and I don't want to wait for 2.6... It would seem this can be implemented entirely in python

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

2008-04-07 Thread Stefan Behnel
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.ElementTree(element).write(outputfile.xml) and you're done. Stefan --

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

2008-04-07 Thread Iain King
On Apr 7, 12:50 pm, 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, some buttons and maybe a text control. I've tried adding a new panel

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

2008-04-07 Thread Mike Driscoll
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, some buttons and maybe a text control. I've tried adding a new panel object

Re: Is there any way to say ignore case with in?

2008-04-07 Thread Mel
Paul McGuire wrote: On Apr 6, 8:53 am, Martin v. Löwis [EMAIL PROTECTED] wrote: I know I could use:- if lower(string1) in lower(string2): do something but it somehow feels there ought to be an easier (tidier?) way. Take, for example, U+017F, LATIN SMALL LETTER LONG S. It's

Re: Learning curve for new database program with Python?

2008-04-07 Thread Simon Brunning
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. Agreed. What's more, I've found SQL to be the single most transferable skill in IT.. No

Re: Presumably an import is no faster or slower than opening a file?

2008-04-07 Thread tinnews
Paul McGuire [EMAIL PROTECTED] wrote: On Apr 6, 8:41 am, [EMAIL PROTECTED] wrote: I'm trying to minimise the overheads of a small Python utility, I'm not really too fussed about how fast it is but I would like to minimise its loading effect on the system as it could be called lots of

Re: A file iteration question/problem

2008-04-07 Thread tinnews
Arnaud Delobelle [EMAIL PROTECTED] wrote: On Apr 6, 4:40 pm, [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

Re: @x.setter property implementation

2008-04-07 Thread Andrii V. Mishkovskyi
2008/4/7, Floris Bruynooghe [EMAIL PROTECTED]: Have been grepping all over the place and failed to find it. I found the test module for them, but that doesn't get me very far... I think you should take a look at 'descrobject.c' file in 'Objects' directory. -- Wbr, Andrii Mishkovskyi.

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 taken

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, some buttons

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

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

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 that work though? If

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, David Pratt [EMAIL

Re: A file iteration question/problem

2008-04-07 Thread Peter Otten
[EMAIL PROTECTED] wrote: Arnaud Delobelle [EMAIL PROTECTED] wrote: You could use an iterator over the lines of the file: def recfun(lines): for line in lines: # Do stuff if condition: recfun(lines) lines = iter(open(filename)) recfun(lines) Does

Re: Please test Phatch on Windows (was Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL)

2008-04-07 Thread SPE - Stani's Python Editor
Hi Steve, Thanks for the confirmation. It is indeed good news. Feel free to send me privately some screenshots. BTW, I just released Phatch 0.1.3 which is the final version for Ubuntu Hardy. Stani On Mar 31, 3:44 am, Steve Holden [EMAIL PROTECTED] wrote: Stani: You'll be happy to hear that it

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 seems to

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

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 DEMO2L(s)

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 with

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

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

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

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 sit

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

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

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

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

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

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

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

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 way

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 way for

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/', '-cc':

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

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 has taken

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

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 will be

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 be

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 you

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

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, I tried Content-Type:

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

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

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

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?  If you iterate

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 nulls of 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 | |

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 different

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: 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 integer. If

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: 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 equations. Or

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 stdin, line 1, in module ValueError: invalid literal for int() with base 0: '033' [38720 refs]

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.

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

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 float

  1   2   3   >