Re: lambda closure question

2005-02-22 Thread Karl Anderson
Ted Lilley [EMAIL PROTECTED] writes: What I want to do is pre-load functions with arguments by iterating through a list like so: class myclass: ...pass def func(self, arg): ...print arg mylist = [my, sample, list] for item in mylist: ...setattr(myclass, item, lamdba self:

Re: MatPlotLib.MatLab troubles (how to install/run matplotlib.PyLab?)

2005-02-22 Thread Dr. Colombes
John Hunter wrote: Colombes == Colombes [EMAIL PROTECTED] writes: Colombes matplotlib.matlab deprecated, please import Colombes matplotlib.pylab or simply pylab instead. See Colombes http://matplotlib.sf.net/matplotlib_to_pylab.py for a Colombes script which explains this

python tutorial/projects

2005-02-22 Thread Danny
Does anyone know of a good python tutorial? I was also looking for some non-trivial projects to do in python. Basically I would like to claim on my resume, that I know python, with out bad karma. Danny -- http://mail.python.org/mailman/listinfo/python-list

Re: intersection of 2 list of pairs

2005-02-22 Thread John Machin
[EMAIL PROTECTED] wrote: The use of frozenset can okay when sub-sequences are longer, but for this problem it's slow, and anyway there are situations of repeated data like this that have to be considered: Not just for frozenset; this has to be considered whatever the representation.

Re: searching pdf files for certain info

2005-02-22 Thread Kartic
rbt said the following on 2/22/2005 8:53 AM: Not really a Python question... but here goes: Is there a way to read the content of a PDF file and decode it with Python? I'd like to read PDF's, decode them, and then search the data for certain strings. Thanks, rbt Hi, Try pdftotext which is part

Re: newbie help for mod_python

2005-02-22 Thread Brian Beck
Jochen Kaechelin wrote: I run debian sid and apache2 with libapache2-mod-python2.3 and I added these lines Directory /var/www AddHandler mod_python .py PythonDebug On /Directory in a virtualhost container. Were those the only lines you added? You also should have actually loaded the module

Re: python tutorial/projects

2005-02-22 Thread Steve Juranich
I think the tutorial offered at www.python.org/tut/tut.html is as good a starting place as any. I wouldn't be able to suggest a non-trivial project without knowing more about your background. Can you do a flashcard program? recipe organizer? [EMAIL PROTECTED] client? (I think you see where this

Re: python tutorial/projects

2005-02-22 Thread Tom Willis
I found this one helpful http://diveintopython.org/ and this one http://ibiblio.org/obp/thinkCS/python/english/ Just found this one http://hetland.org/python/instant-python and this page has links to many more. http://www.python.org/doc/Intros.html And because I'm a huge Bruce Eckel fan.

Re: python tutorial/projects

2005-02-22 Thread Andrew Thomson
On Tue, 2005-02-22 at 15:23 -0800, Danny wrote: Does anyone know of a good python tutorial? I found this one most helpful. http://www.ibiblio.org/obp/thinkCSpy/ ajt. I was also looking for some non-trivial projects to do in python. Basically I would like to claim on my resume, that I

Re: Can I get message filename from a Maildir mailbox stream?

2005-02-22 Thread Noah
This didn't work. I'm using the standard Python 2.3.4 library mailbox.Maildir. I got an error that message instance has no attribute 'fp'. I ended up not using mailbox.Maildir at all. It occured to me that since Maildir style mailboxes is just a collection of files that it was simpler to write a

Re: python tutorial/projects

2005-02-22 Thread Tom Willis
You know, I hate doing this I just remembered the Bruce Eckel book is a direct transaltion from THinking In Patterns for Java. And as such the example python code within the chapters is not even valid Python. If you're new to the language you'll get confused with the use of private and

Writting to specific location in a file

2005-02-22 Thread artixan
I have a database result set in a Python list. Each row is a tuple. data = [(a_field,b_field,c_field,d_field,x_field,y_field,z_field)] I need to loop thru this data and write each row to a text file. f = open('out.txt','w') for row in data: f.writelines(row) My chanllenge is that each

Re: python tutorial/projects

2005-02-22 Thread Leif B. Kristensen
Danny skrev: Does anyone know of a good python tutorial? I was also looking for some non-trivial projects to do in python. There's a lot of projects on Sourceforge that are written in Python, where you're free to study the code and maybe participate, if you've got what it takes. Basically

Re: Writting to specific location in a file

2005-02-22 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: My chanllenge is that each field needs to have a exact specific position in the output file. For instance a_field needs to start at position 2 in the line, b_fields at position 18 and so on, for all the fields on each line. You can use string formatting operations: row =

compatbility of .pyc files

2005-02-22 Thread Blair Hall
I have a requirement to prevent 'accidental' tampering with some software written in Python. If I ensure that all of the modules concerned are compiled into .pyc's, and remove the .py's to another location, then I should be safe until the next upgrade of the Python interpretter. My questions: Are

Re: searching pdf files for certain info

2005-02-22 Thread Tom Willis
Well sporadic spaces in strings would cause problems would it not? an example The String: Patient Face Sheet---pdftotext---P a tie n t Face Sheet I'm just curious if you see anything like that, since I really have no clue about ps or pdf etc...but I have a strong desire to replace a really

Re: searching pdf files for certain info

2005-02-22 Thread rbt
Tom Willis wrote: Well sporadic spaces in strings would cause problems would it not? an example The String: Patient Face Sheet---pdftotext---P a tie n t Face Sheet I'm just curious if you see anything like that, since I really have no clue about ps or pdf etc...but I have a strong desire to

Re: Comm. between Python and PHP

2005-02-22 Thread Noah
It wasn't quite clear, but I assume that you want a PHP script that can call on the Python daemon and not have the daemon make calls to a PHP script. You could use xml-rpc which is built into Python as of version 2.2: http://docs.python.org/lib/module-xmlrpclib.html On the PHP side xmlrpc is

Re: searching pdf files for certain info

2005-02-22 Thread Tom Willis
Ah that makes sense. I only see the behavior in pdftotext. ps2ascii doesn't give me the layout , which for my purposes, I certainly need. Thanks for the info, Looks like I'll keep searching for that silver bullet.:( On Tue, 22 Feb 2005 20:07:50 -0500, rbt [EMAIL PROTECTED] wrote: Tom Willis

RE: Dealing with config files what's the options

2005-02-22 Thread Tony Meyer
How are the expert pythoneers dealing with config files? [...] You can just import ConfigParser, or look at the various alternatives: http://www.python.org/moin/ConfigParserShootout =Tony.Meyer -- http://mail.python.org/mailman/listinfo/python-list

Re: compatbility of .pyc files

2005-02-22 Thread Martin v. Löwis
Blair Hall wrote: Are the .pyc's usable without recompilation between 'minor' releases of the interpretter (e.g., 2.3.1 - 2.3.2 - etc)? Yes. I presume that the .pyc's are NOT compatible across more major releases (e.g., 2.3.x - 2.4.x)? Correct. Is there a hard and fast rule about compatibility

Re: compatbility of .pyc files

2005-02-22 Thread Jeremy Bowers
On Wed, 23 Feb 2005 13:31:12 +1300, Blair Hall wrote: I have a requirement to prevent 'accidental' tampering with some software written in Python. If I ensure that all of the modules concerned are compiled into .pyc's, and remove the .py's to another location, then I should be safe until the

Re: Style guide for subclassing built-in types?

2005-02-22 Thread janeaustine50
Jane Austine wrote: Please see the following code: class rev_wrap(object): def __init__(self,l): self.l=l def __getitem__(self,i): return self.l[-i-1] class rev_subclass(list): def __getitem__(self,i): return

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-22 Thread Markus Wankus
George Sakkis wrote: Ilias Lazaridis [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Nick Vargish wrote: You can excuse yourself from this one and stop replying to comments, but you don't get to unilaterally declare a discussion over. [...] The discussion is over. At least the in-topic

Re: Dealing with config files what's the options

2005-02-22 Thread Tom Willis
Thanks, I'm not too keen on the ini layout. But it's good to know it's there. On Wed, 23 Feb 2005 14:50:27 +1300, Tony Meyer [EMAIL PROTECTED] wrote: How are the expert pythoneers dealing with config files? [...] You can just import ConfigParser, or look at the various alternatives:

user interface for python

2005-02-22 Thread Raghul
Hi, Which of the UI I can used for my program that I can use both in windows and in Linux. Is it possible for me to use Wxpython for my program so that it can run on both the windows and linux machine? Will it be platform independent? -- http://mail.python.org/mailman/listinfo/python-list

progress bar controls in status.py

2005-02-22 Thread mirandacascade
O/S - Windows XP Home with Service Pack 2 Vsn of Python: 2.4 (from ActiveState) This question is with regard to the progress bar controls that are in the file status.py. On my workstation, status.py is located in the: c:\python24\lib\site-packages\pythonwin\pywin\dialogs\ folder. The only

Weekly Python Patch/Bug Summary

2005-02-22 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 308 open (+10) / 2755 closed ( +1) / 3063 total (+11) Bugs: 838 open (+15) / 4834 closed ( +5) / 5672 total (+20) RFE : 168 open ( +0) / 148 closed ( +4) / 316 total ( +4) New / Reopened Patches __ do not

RE: reading only new messages in imaplib

2005-02-22 Thread Tony Meyer
Is it posssible to read only the new messages or unread messages using imaplib in python? If it is possible pls specify the module or give a sample code. This will print out the first 20 chars of each undeleted message. You should be able to figure out how to do what you want from it.

Re: On eval and its substitution of globals

2005-02-22 Thread Paddy
I have had no reply so on revisiting this I thought I would re-submit it and point out that there is a question way down at the end :-) Thanks. = Original Post = Hi, I got tripped up on the way eval works with respect to modules and so wrote a test. It seems that a function carries

Re: user interface for python

2005-02-22 Thread helmi03
Yes, wxpython is cross-platform. I also suggest pygtk for another toolkit. -- http://mail.python.org/mailman/listinfo/python-list

Re: PythonCard and Py2Exe

2005-02-22 Thread It's me
It's: from PythonCard.components import radiogroup not just: from PythonCard import radiogroup PipedreamerGrey [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm trying to create a standalone version (.exe) of PythonCard's Custdb sample using Py2Exe version 0.5.0.

Re: basic tkinter/Windows question

2005-02-22 Thread Vincent Wehren
Paul Rubin wrote: I find myself having to write some code on Windows :-(. To alleviate the pain, at least I get to use Python for some of it. I'm trying to write a simple application, say eggs.py. It pops a tkinter gui and lets the user do some stuff. The system has Python installed so I don't

Re: basic tkinter/Windows question

2005-02-22 Thread Martin Franklin
Paul Rubin wrote: I find myself having to write some code on Windows :-(. To alleviate the pain, at least I get to use Python for some of it. I'm trying to write a simple application, say eggs.py. It pops a tkinter gui and lets the user do some stuff. The system has Python installed so I don't

Re: Comm. between Python and PHP

2005-02-22 Thread Nick Craig-Wood
Peter Hansen [EMAIL PROTECTED] wrote: Nils Emil P. Larsen wrote: What is the easiest way to make my threaded Python daemon communicate with a PHP-script running from Apache2 on localhost? Easiest of course depends on lots of things, and mostly on specifics that you haven't told us, and

unicode(obj, errors='foo') raises TypeError - bug?

2005-02-22 Thread Mike Brown
This works as expected (this is on an ASCII terminal): unicode('asdf\xff', errors='replace') u'asdf\ufffd' This does not work as I expect it to: class C: ... def __str__(self): ... return 'asdf\xff' ... o = C() unicode(o, errors='replace') Traceback (most recent call last): File

LC_ALL and os.listdir()

2005-02-22 Thread Kenneth Pronovici
I have some confusion regarding the relationship between locale, os.listdir() and unicode pathnames. I'm running Python 2.3.5 on a Debian system. If it matters, all of the files I'm dealing with are on an ext3 filesystem. The real code this problem comes from takes a configured set of

Re: A few q's on python files.

2005-02-22 Thread Tim Roberts
Joseph Quigley [EMAIL PROTECTED] wrote: i'm new to python (by a week) but am learning fast (that's what I like about python--it's simplicity). I got disgusted with C and C++ (i was learning) probably because of a bad copy of Visual C++ 6.0 that gave me errors. I find that very hard to believe.

Re: unicode(obj, errors='foo') raises TypeError - bug?

2005-02-22 Thread Steven Bethard
Mike Brown wrote: class C: ... def __str__(self): ... return 'asdf\xff' ... o = C() unicode(o, errors='replace') Traceback (most recent call last): File stdin, line 1, in ? TypeError: coercing to Unicode: need string or buffer, instance found [snip] What am I doing wrong? Is this a bug in

Re: Comm. between Python and PHP

2005-02-22 Thread Tim Roberts
Nils Emil P. Larsen [EMAIL PROTECTED] wrote: Hello I'm building a daemon in Python. It will measure and control some physical devices on a serial bus. Since it is a daemon, it will never terminate and I can't interfere with the regulation of the devices by using command line parameters. I want

Re: how to interrupt time.sleep ?

2005-02-22 Thread Thomas Heller
BOOGIEMAN [EMAIL PROTECTED] writes: I have line time.sleep(60) in my code How do I cancel waiting 60 seconds if I want to continue with program imediately ? Like Press some button if you don't want to wait If it can't be canceled what's the other solution to wait certain time/or press

<    1   2