Re: Where regexs listed for Python language's tokenizer/lexer?

2009-09-11 Thread Miles Kaufmann
On Sep 11, 2009, at 11:10 PM, Chris Seberino wrote: Where regexs listed for Python language's tokenizer/lexer? If I'm not mistaken, the grammar is not sufficient to specify the language you also need to specify the regexs that define the tokens right?..where is that? The Python tokenizati

Where regexs listed for Python language's tokenizer/lexer?

2009-09-11 Thread Chris Seberino
Where regexs listed for Python language's tokenizer/lexer? If I'm not mistaken, the grammar is not sufficient to specify the language you also need to specify the regexs that define the tokens right?..where is that? chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Dataflow programming in Python

2009-09-11 Thread Lie Ryan
Anh Hai Trinh wrote: Hello all, I just want to share with you something that I've worked on recently. It is a library which implements streams -- generalized iterators with a pipelining mechanism and lazy-evaluation to enable data-flow programming in Python. The idea is to be able to take the o

Re: Simple Text Processing

2009-09-11 Thread Steven D'Aprano
On Fri, 11 Sep 2009 21:52:36 -0700, Tim Roberts wrote: > Basically, when you're good with Perl, you start to think of every task > in terms of regular expression matches. When you're good with Python, > you start to think of every task in terms of lists and tuples. Not me -- I think of most such

Re: ImageFont family mojibake

2009-09-11 Thread Lie Ryan
Donn wrote: Python 2.6 PIL Version: 1.1.6-3ubuntu1 libfreetype6 Version: 2.3.9-4ubuntu0.1 Hello, I have a feeling I've asked this in the distant past, but it's recently emerged as a bug in my app so can anyone point me in the right direction? In Fonty Python, when I draw the fa

Re: Turn-based game - experimental economics

2009-09-11 Thread Carl Banks
On Sep 11, 9:44 am, Paolo Crosetto wrote: > In data sabato 05 settembre 2009 21:47:41, Dennis Lee Bieber ha scritto: > > > Much better to just send the token TO the active client (which is > > responsible for returning it at the end of its turn processing) > > Dennis, > > I am finally getting my h

Re: how to return value from button clicked by python

2009-09-11 Thread Tim Roberts
chen tao wrote: > > I have several buttons, I want to realize: when I click first >button, the button will call a function, and the function should >return some parameter value, because I need this value for the other >buttons. >I tried the button.invoke() function, it almost got it...howe

Re: Simple Text Processing

2009-09-11 Thread Tim Roberts
AJAskey wrote: > >Never mind. I guess I had been trying to make it more difficult than >it is. As a note, I can work on something for 10 hours and not figure >it out. But the second I post to a group, then I immediately figure >it out myself. Strange snake this Python... Come sit on the couch

Re: Where find regexs needed to build lexical analyzer for Python source code?

2009-09-11 Thread Hao Lian
Chris Seberino writes with great flourish: > > I'd like to build a lexer aka lexical analyzer aka tokenizer for > Python source code as a learning exercise. > > Where can I find the regexs that define the tokens of Python source? > (I am aware of tokenizer.py but I was hoping there was a web pag

Re: HTTP POST File without cURL

2009-09-11 Thread Tim Roberts
John Giotta wrote: > >Is there a verbose feature for urllib2.urlopen? You have the full source code for the module right in front of you. Bringing up urllib2.py in an editor is quicker than waiting for a newsgroup reply. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://ma

ImageFont family mojibake

2009-09-11 Thread Donn
Python 2.6 PIL Version: 1.1.6-3ubuntu1 libfreetype6 Version: 2.3.9-4ubuntu0.1 Hello, I have a feeling I've asked this in the distant past, but it's recently emerged as a bug in my app so can anyone point me in the right direction? In Fonty Python, when I draw the family name of a f

Re: Podcast catcher in Python

2009-09-11 Thread Chris Rebert
On Fri, Sep 11, 2009 at 7:43 PM, Chuck wrote: > Does anyone know how I should read/download the mp3 file, and how I > should write/save it so that I can play it on a media player such as > Windoze media player?  Excuse my ignorance, but I am a complete noob > at this.  I downloaded the mp3, and I

Re: Podcast catcher in Python

2009-09-11 Thread Chuck
On Sep 11, 9:07 pm, Chuck wrote: > On Sep 11, 8:32 pm, Chris Rebert wrote: > > > > > > > On Fri, Sep 11, 2009 at 11:09 AM, Chuck wrote: > > > On Sep 11, 12:56 pm, Chuck wrote: > > >> On Sep 11, 10:30 am, Falcolas wrote: > > >> > On Sep 11, 8:20 am, Chuck wrote: > > > >> > > Hi all, > > > >> >

Re: Creating a local variable scope.

2009-09-11 Thread Bearophile
Steven D'Aprano: > (3) Create an inner function, then call that. Several people after someone gives this anwer. > My personal opinion is that if you really need a local scope inside a > function, the function is doing too much and should be split up.< I agree. And a way to split a function is

Re: Podcast catcher in Python

2009-09-11 Thread Chuck
On Sep 11, 8:32 pm, Chris Rebert wrote: > On Fri, Sep 11, 2009 at 11:09 AM, Chuck wrote: > > On Sep 11, 12:56 pm, Chuck wrote: > >> On Sep 11, 10:30 am, Falcolas wrote: > >> > On Sep 11, 8:20 am, Chuck wrote: > > >> > > Hi all, > > >> > > I would like to code a simple podcast catcher in Python

Re: Unicode - and MIMEType - Good friday fun.

2009-09-11 Thread bouncy...@gmail.com
How do you suppose it should workand how is it working? what about the outpout difference? -- Sent via Cricket Mobile Email --Original Message-- From: rh0dium To: Date: Fri, 11 Sep 2009 04:33:42 PM -0700 Subject: Unicode - and MIMEType - Good friday fun. Hi Geniuses, Can

Re: Unicode - and MIMEType - Good friday fun.

2009-09-11 Thread Rami Chowdhury
b = unicode(a, "utf-8") [snip] msg = MIMEText(b) I believe this is the problem line -- the MIMEText constructor takes encoded strings rather than unicode objects. Try: msg = MIMEText(a) Or, alternatively msg = MIMEText(b.encode('utf-8')) On Fri, 11 Sep 2009 16:33:42 -0700, rh0dium wr

Re: string interpolation mystery in Python 2.6

2009-09-11 Thread Steven D'Aprano
On Fri, 11 Sep 2009 15:19:05 -0700, Chris Rebert wrote: > On Fri, Sep 11, 2009 at 3:12 PM, Alan G Isaac > wrote: >> Michael Foord came up with a much simpler illustration.  With Python >> 2.6:: [snip] > Sounds like IOError or one of its ancestors defines both __str__() and > __unicode__ () spec

Re: Writing a thread-safe class

2009-09-11 Thread Carl Banks
On Sep 11, 4:26 pm, Timothy Madden wrote: > Hello > > I would like to write a class with methods that can be accessed by many > threads at the same time. > > For this I have a lock attribute in my class obtained with > threading.Lock(), in the constructor, and every method begins by > acquiring th

Re: Podcast catcher in Python

2009-09-11 Thread Chris Rebert
On Fri, Sep 11, 2009 at 11:09 AM, Chuck wrote: > On Sep 11, 12:56 pm, Chuck wrote: >> On Sep 11, 10:30 am, Falcolas wrote: >> > On Sep 11, 8:20 am, Chuck wrote: >> >> > > Hi all, >> >> > > I would like to code a simple podcast catcher in Python merely as an >> > > exercise in internet programmi

Re: Creating a local variable scope.

2009-09-11 Thread Steven D'Aprano
On Fri, 11 Sep 2009 19:36:14 +0200, Johan Grönqvist wrote: > Hi All, > > I find several places in my code where I would like to have a variable > scope that is smaller than the enclosing function/class/module > definition. ... > The essence is that for readability, I want spam and eggs in separat

Re: [Distutils] uses for setup.cfg and extracting data from it

2009-09-11 Thread P.J. Eby
At 08:14 AM 9/12/2009 +1000, Ben Finney wrote: Specifically, I want to programmatically access the metadata that is held in the arguments to the ‘distutils.setup()’ call. Without, as you say, executing any Distutils command. I am not aware of any ‘distutils’ public functions that can do

Re: Unicode - and MIMEType - Good friday fun.

2009-09-11 Thread MRAB
rh0dium wrote: Hi Geniuses, Can anyone please show me the way.. I don't understand why this doesn't work... # encoding: utf-8 from email.MIMEText import MIMEText msg = MIMEText("hi") msg.set_charset('utf-8') print msg.as_string() a = 'Ho\xcc\x82tel Ste\xcc\x81phane ' b = unicode(a, "utf-8")

Unicode - and MIMEType - Good friday fun.

2009-09-11 Thread rh0dium
Hi Geniuses, Can anyone please show me the way.. I don't understand why this doesn't work... # encoding: utf-8 from email.MIMEText import MIMEText msg = MIMEText("hi") msg.set_charset('utf-8') print msg.as_string() a = 'Ho\xcc\x82tel Ste\xcc\x81phane ' b = unicode(a, "utf-8") print b msg =

Writing a thread-safe class

2009-09-11 Thread Timothy Madden
Hello I would like to write a class with methods that can be accessed by many threads at the same time. For this I have a lock attribute in my class obtained with threading.Lock(), in the constructor, and every method begins by acquiring the lock and ends by releasing it My problem is that

Re: Python C/API Problem

2009-09-11 Thread Gabriel Genellina
En Fri, 11 Sep 2009 15:10:45 -0300, Gianfranco Murador escribió: int main(int argc, char *argv[]) { Py_Initialize(); struct _node *node = PyParser_SimpleParseString("from time import time,ctime\n" "print 'Today is',ctim

Re: uses for setup.cfg and extracting data from it

2009-09-11 Thread Ben Finney
"P.J. Eby" writes: > If you're talking about setup.py, all you need to do is use the > distutils functions that allow you to run a setup.py without executing > any of its commands. Specifically, I want to programmatically access the metadata that is held in the arguments to the ‘distutils.setup(

Re: string interpolation mystery in Python 2.6

2009-09-11 Thread Chris Rebert
On Fri, Sep 11, 2009 at 3:12 PM, Alan G Isaac wrote: > Michael Foord came up with a much simpler > illustration.  With Python 2.6:: > >        >>> try: >        ...  open('flooble') >        ... except Exception as e: >        ...  pass >        ... >        >>> e >        IOError(2, 'No such file

Re: string interpolation mystery in Python 2.6

2009-09-11 Thread Alan G Isaac
Michael Foord came up with a much simpler illustration. With Python 2.6:: >>> try: ... open('flooble') ... except Exception as e: ... pass ... >>> e IOError(2, 'No such file or directory') >>> unicode(e) u"(2, 'No such fil

Re: Class variable inheritance

2009-09-11 Thread Terry Reedy
Lie Ryan wrote: Note that when the python interpreter meets this statement: class B(P): def foo(self): print('ab') X = 'f' the compiler sees a class statement -> create a new blank class -> assign P as the new class' parent No, it saves th

Progressive download in urllib2

2009-09-11 Thread Jon
I would like to be able to control the (stop/resume) the download of a large http object when using urllib2:urlopen() in Linux My understanding is that the open reads data until the socket buffers are filled, then waits until data is consumed (urllib2.read()) and fetches more. Is there a way to

Re: looking for a script that automaticly logs into hotmail

2009-09-11 Thread Mart.
On Sep 11, 10:31 pm, mmoalem wrote: > hi there all - trying to find a script wich will log into an hotmail > account - that is for the reason that after a certain amount of > inactivity time a hotmail account is expired and to prevent that from > happening accidentaly a script wich i can schedule

Re: Python server locks up

2009-09-11 Thread Dave Angel
Paul Rubin wrote: sturlamolden writes: Python uses reference counting, not a generational GC like Java. A Python object is destroyed when the refcount drops to 0. The GC only collects cyclic references. If you create none, there are no GC delays (you can in fact safely turn the GC off). Pyt

Re: Creating a local variable scope.

2009-09-11 Thread Carl Banks
On Sep 11, 10:36 am, Johan Grönqvist wrote: > In the other languages I have used I can either use braces (C and > descendants) or use let-bindings (SML, Haskell etc.) to form local scopes. I wouldn't mind a let statement but I don't think the language really suffers for the lack of it. I expect

Re: Mapping in python? Transforming shapefile so that basemap can read them?

2009-09-11 Thread Mart.
On Sep 11, 7:22 pm, C Barr Leigh wrote: > I'm trying to get started with plotting maps in python. I need to read > "shape files" (.shp) and make maps. There seem to be many efforts but > none is complete? I'm looking for suggestions and troubleshooting. > > The basemap package is obviously at an i

Re: Class variable inheritance

2009-09-11 Thread Lie Ryan
HPJ wrote: And by the way, the reason I've come across this problem at all is because I have something like this: class A: class X: n = 'a' x = X() class B(A): class X(A.X): n = 'b' # x = X() The line commented out was originally not there, but I found out I had to add it if I wa

Re: How can I use my modules here?

2009-09-11 Thread Chris Rebert
On Fri, Sep 11, 2009 at 4:48 AM, Albert Hopkins wrote: > On Fri, 2009-09-11 at 02:29 -0700, Chris Rebert wrote: >> For some reason, your Python program is being executed by bash as if >> it were a shell script, which it's not. >> No idea what the cause is though. > > Because the first 2 bytes of t

Re: Creating a local variable scope.

2009-09-11 Thread Terry Reedy
Johan Grönqvist wrote: Hi All, I find several places in my code where I would like to have a variable scope that is smaller than the enclosing function/class/module definition. One representative example would look like: -- spam = { ... } eggs = { ... } ham = (a[eggs], b[spam]) --

Re: Python C/API Problem

2009-09-11 Thread Philip Semanchuk
On Sep 11, 2009, at 2:10 PM, Gianfranco Murador wrote: Hi to all python fans, i'm trying to run this C source file: [code] #include #include #include #include #include int main(int argc, char *argv[]) { Py_Initialize(); struct _node *node = PyParser_SimpleParseString("f

Re: Use python to execute a windows program

2009-09-11 Thread Jerry Hill
On Fri, Sep 11, 2009 at 3:31 PM, Doran, Harold wrote: > Thanks, Jerry. Tried that, as well as various other possible names to no > avail. You'll need to dig into the documentation then, probably starting in one of these two places: http://pywinauto.openqa.org/howto.html http://pywinauto.openqa.or

Re: Extracting patterns after matching a regex

2009-09-11 Thread Mart.
On Sep 9, 4:58 pm, Al Fansome wrote: > Mart. wrote: > > On Sep 8, 4:33 pm, MRAB wrote: > >>Mart. wrote: > >>> On Sep 8, 3:53 pm, MRAB wrote: > Mart. wrote: > > On Sep 8, 3:14 pm, "Andreas Tawn" wrote: > > Hi, > > I need to extract a string after a matching a regular expr

Re: Creating a local variable scope.

2009-09-11 Thread Ethan Furman
Patrick Sabin wrote: Johan Grönqvist schrieb: Hi All, I find several places in my code where I would like to have a variable scope that is smaller than the enclosing function/class/module definition. One representative example would look like: -- spam = { ... } eggs = { ... } ham

RE: Use python to execute a windows program

2009-09-11 Thread Doran, Harold
Thanks, Jerry. Tried that, as well as various other possible names to no avail. > -Original Message- > From: python-list-bounces+hdoran=air@python.org > [mailto:python-list-bounces+hdoran=air@python.org] On > Behalf Of Jerry Hill > Sent: Friday, September 11, 2009 3:09 PM > To:

Problem with queues and gobject event loop

2009-09-11 Thread Roman Kapl
Why does not this snipplet work? - from job import JobQueue import Queue import threading import gobject q=JobQueue() def worker(): print "Worker waiting" q.get() print "Got job!" if __name__ == "__main__": t = threadi

Re: Use python to execute a windows program

2009-09-11 Thread Jerry Hill
On Fri, Sep 11, 2009 at 12:46 PM, Doran, Harold wrote: > I am working with this now. I'm toying with the examples to test out a > few things and learn how this works. I've made some modifications such > that I have the following working (below). This does nothing more than > open a program. > > I

Dataflow programming in Python

2009-09-11 Thread Anh Hai Trinh
Hello all, I just want to share with you something that I've worked on recently. It is a library which implements streams -- generalized iterators with a pipelining mechanism and lazy-evaluation to enable data-flow programming in Python. The idea is to be able to take the output of a function tha

Re: Creating a local variable scope.

2009-09-11 Thread Daniel Stutzbach
2009/9/11 Johan Grönqvist > I find several places in my code where I would like to have a variable > scope that is smaller than the enclosing function/class/module definition. > For what it's worth, there was a relevant proposal on the python-ideas list a few months back: http://mail.python.org

Re: Creating a local variable scope.

2009-09-11 Thread Patrick Sabin
Johan Grönqvist schrieb: Hi All, I find several places in my code where I would like to have a variable scope that is smaller than the enclosing function/class/module definition. One representative example would look like: -- spam = { ... } eggs = { ... } ham = (a[eggs], b[spam])

Mapping in python? Transforming shapefile so that basemap can read them?

2009-09-11 Thread C Barr Leigh
I'm trying to get started with plotting maps in python. I need to read "shape files" (.shp) and make maps. There seem to be many efforts but none is complete? I'm looking for suggestions and troubleshooting. The basemap package is obviously at an impressive stage and comes with some data: http://w

Re: Podcast catcher in Python

2009-09-11 Thread Chuck
On Sep 11, 1:09 pm, Chuck wrote: > On Sep 11, 12:56 pm, Chuck wrote: > > > > > > > On Sep 11, 10:30 am, Falcolas wrote: > > > > On Sep 11, 8:20 am, Chuck wrote: > > > > > Hi all, > > > > > I would like to code a simple podcast catcher in Python merely as an > > > > exercise in internet programm

Where find regexs needed to build lexical analyzer for Python source code?

2009-09-11 Thread Chris Seberino
I'd like to build a lexer aka lexical analyzer aka tokenizer for Python source code as a learning exercise. Where can I find the regexs that define the tokens of Python source? (I am aware of tokenizer.py but I was hoping there was a web page w/ a list somewhere.) cs -- http://mail.python.org/ma

Python C/API Problem

2009-09-11 Thread Gianfranco Murador
Hi to all python fans, i'm trying to run this C source file: [code] #include #include #include #include #include int main(int argc, char *argv[]) { Py_Initialize(); struct _node *node = PyParser_SimpleParseString("from time import time,ctime\n"

Re: Podcast catcher in Python

2009-09-11 Thread Chuck
On Sep 11, 12:56 pm, Chuck wrote: > On Sep 11, 10:30 am, Falcolas wrote: > > > > > > > On Sep 11, 8:20 am, Chuck wrote: > > > > Hi all, > > > > I would like to code a simple podcast catcher in Python merely as an > > > exercise in internet programming.  I am a CS student and new to > > > Python,

Re: how to return value from button clicked by python

2009-09-11 Thread r
On Sep 11, 10:19 am, chen tao wrote: (snip) >     I tried the button.invoke() function, it almost got it...however, > I only want it returns value when the button clicked, but because the > program is in the class _ini_ function, so it always runs once before > I click the button... so don't call

Re: Creating a local variable scope.

2009-09-11 Thread Neal Becker
Johan Grönqvist wrote: > Hi All, > > I find several places in my code where I would like to have a variable > scope that is smaller than the enclosing function/class/module definition. > > One representative example would look like: > > -- > spam = { ... } > eggs = { ... } > > ham = (a

Re: Python server locks up

2009-09-11 Thread Terry Reedy
sturlamolden wrote: On 9 Sep, 22:28, Zac Burns wrote: Theories: Python is resizing the large dictionary Python is garbage collecting Python uses reference counting, not a generational GC like Java. The CPython implementation, that is. Jython, built on top of Java, uses Java's GC. D

Re: Podcast catcher in Python

2009-09-11 Thread Chuck
On Sep 11, 10:30 am, Falcolas wrote: > On Sep 11, 8:20 am, Chuck wrote: > > > Hi all, > > > I would like to code a simple podcast catcher in Python merely as an > > exercise in internet programming.  I am a CS student and new to > > Python, but understand Java fairly well.  I understand how to co

Re: Python server locks up

2009-09-11 Thread Paul Rubin
sturlamolden writes: > Python uses reference counting, not a generational GC like Java. A > Python object is destroyed when the refcount drops to 0. The GC only > collects cyclic references. If you create none, there are no GC delays > (you can in fact safely turn the GC off). Python does not sha

Creating a local variable scope.

2009-09-11 Thread Johan Grönqvist
Hi All, I find several places in my code where I would like to have a variable scope that is smaller than the enclosing function/class/module definition. One representative example would look like: -- spam = { ... } eggs = { ... } ham = (a[eggs], b[spam]) -- The essence is tha

Re: Turn-based game - experimental economics

2009-09-11 Thread Paolo Crosetto
In data sabato 05 settembre 2009 21:47:41, Dennis Lee Bieber ha scritto: > Much better to just send the token TO the active client (which is > responsible for returning it at the end of its turn processing) Dennis, I am finally getting my head round this problem. I do have a further question,

Re: [Guppy-pe-list] An iteration idiom (Was: Re: loading files containing multiple dumps)

2009-09-11 Thread Ethan Furman
Chris Withers wrote: Sverker Nilsson wrote: The __repr__ I use don't have the enclosing <>, granted, maybe I missed this or it wasn't in the docs in 2005 or I didn't think it was important (still don't) but was that really what the complain was about? No, it was about the fact that when I do

Re:

2009-09-11 Thread opengis
Thank you for the response. I have been using urllib2.urlopen("http://www.openlayers.org";), so I can rule out the url being incorrect. Since my original question I can add the following: 1. I am not using a proxy to connect to the internet 2. I added these lines to the script: ...

Re: Problem with the inclusion of new files like lxml, django, numpy, etc.

2009-09-11 Thread Robert Kern
On 2009-09-11 11:39 AM, joy99 wrote: Dear Group, I am trying to download the following files, a) lxml, b) numpy, c) scipy, and d) django. I am trying to include them in C\python26\Lib But they are giving error report, as I am trying to use them by importing. I am using IDLE as GUI, my OS is W

Re: Problem with the inclusion of new files like lxml, django, numpy, etc.

2009-09-11 Thread Diez B. Roggisch
joy99 schrieb: Dear Group, I am trying to download the following files, a) lxml, b) numpy, c) scipy, and d) django. I am trying to include them in C\python26\Lib But they are giving error report, as I am trying to use them by importing. What is an "error report"? Unless you get more specific

Re: Unexpected 411 error response using httplib

2009-09-11 Thread John Gordon
In John Gordon writes: > As you can see, I am including the call to putheader() for Content-Length, > and the debugging output confirms that the header is present in the outgoing > message. > So why am I getting a 411 Length Required error? To follow up my own post, this was happening because

Re: Different results for request() vs putrequest()

2009-09-11 Thread John Gordon
In John Gordon writes: > According to the documentation, these two sections of code should be > equivalent: > conn = httplib.HTTPSConnection(host) > conn.putrequest("POST", url) > conn.putheader("Proxy-Authorization", myProxy) > conn.putheader("Content-Length", "%d" % len(body)) > con

RE: Use python to execute a windows program

2009-09-11 Thread Doran, Harold
I am working with this now. I'm toying with the examples to test out a few things and learn how this works. I've made some modifications such that I have the following working (below). This does nothing more than open a program. I have commented out the portion #app.AM.MenuSelect("File->Open Data

Problem with the inclusion of new files like lxml, django, numpy, etc.

2009-09-11 Thread joy99
Dear Group, I am trying to download the following files, a) lxml, b) numpy, c) scipy, and d) django. I am trying to include them in C\python26\Lib But they are giving error report, as I am trying to use them by importing. I am using IDLE as GUI, my OS is WinXP SP2, and my Python version 2.6. I

Re: Message box always appears on 2nd monitor

2009-09-11 Thread Sean DiZazzo
On Sep 11, 8:27 am, ed wrote: > No matter what I do, the MessageBox always appears on the 2nd monitor. > I've forced all the other widgets to monitor 1. > I thought that creating a class and forcing the position would help, but > it hasn't. > > I'm using Ubuntu Jaunty, python 2.6. > > Any ideas wh

Re: Use python to execute a windows program

2009-09-11 Thread Alan G Isaac
Does the Windows application offer a COM interface? http://oreilly.com/catalog/pythonwin32/chapter/ch12.html http://sourceforge.net/projects/pywin32/ Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

string interpolation mystery in Python 2.6

2009-09-11 Thread Alan G Isaac
MYSTERY: how can "%s"%error be different from "%s"%str(error) in Python 2.6? APOLOGY: I tried to strip this down, but could not find a simple way to reproduce the problem. This way works, however. (There is a discussion on the docutils-develop list.) Although there are several steps, we are ta

Re: How can I use my modules here?

2009-09-11 Thread Diez B. Roggisch
Chris Rebert wrote: > On Fri, Sep 11, 2009 at 2:24 AM, Kermit Mei wrote: >> Hello community! >> >> I write a modules for testing, and my code is like this(under Linux): >> >> >> $ tree >> . >> |-- MyTestModules >> | |-- Test1.py >> | |-- Test2.py >> | `-- __init__.py >> `-- main.py >> >> 1 direct

Re: Multiple inheritance - How to call method_x in InheritedBaseB from method_x in InheritedBaseA?

2009-09-11 Thread Scott David Daniels
The Music Guy wrote: ... def main(): ... class MyMixin(object): This is a mistake. If Mixins inherit from CommonBase as well, no order of class definition can catch you out. If it doesn't, you can get yourself in trouble. def method_x(self, a, b, c): super(MyMixin, self).met

Re: Podcast catcher in Python

2009-09-11 Thread Falcolas
On Sep 11, 8:20 am, Chuck wrote: > Hi all, > > I would like to code a simple podcast catcher in Python merely as an > exercise in internet programming.  I am a CS student and new to > Python, but understand Java fairly well.  I understand how to connect > to a server with urlopen, but then I don't

Re: [Guppy-pe-list] An iteration idiom (Was: Re: loading files containing multiple dumps)

2009-09-11 Thread Chris Withers
Sverker Nilsson wrote: If you just use heap(), and only want total memory not relative to a reference point, you can just use hpy() directly. So rather than: CASE 1: h=hpy() h.heap().dump(...) #other code, the data internal to h is still around h.heap().dump(...) you'd do: CASE 2: hpy().heap

Message box always appears on 2nd monitor

2009-09-11 Thread ed
No matter what I do, the MessageBox always appears on the 2nd monitor. I've forced all the other widgets to monitor 1. I thought that creating a class and forcing the position would help, but it hasn't. I'm using Ubuntu Jaunty, python 2.6. Any ideas what I can do to force widgets to a specific

how to return value from button clicked by python

2009-09-11 Thread chen tao
Hi, I have several buttons, I want to realize: when I click first button, the button will call a function, and the function should return some parameter value, because I need this value for the other buttons. I tried the button.invoke() function, it almost got it...however, I only want it

Re: Use python to execute a windows program

2009-09-11 Thread Simon Brunning
2009/9/11 Doran, Harold : > The way we do this now is a person sits in front of their machine and > proceeds as follows: > > 1) Open windows program > 2) Click file -> open which opens a dialog box > 3) Locate the file (which is a text file) click on it and let the > program run. It might very wel

Use python to execute a windows program

2009-09-11 Thread Doran, Harold
Dear list: My question is conceptual at the moment. Current problem: I have a windows-based program that reads in a file and from that file generates data that is saved to a file. The way we do this now is a person sits in front of their machine and proceeds as follows: 1) Open windows program

Re: Podcast catcher in Python

2009-09-11 Thread Chuck
Also, if anyone could recommend some books that cover this type of programming, I would greatly appreciate it. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Podcast catcher in Python

2009-09-11 Thread Chuck
Hi all, I would like to code a simple podcast catcher in Python merely as an exercise in internet programming. I am a CS student and new to Python, but understand Java fairly well. I understand how to connect to a server with urlopen, but then I don't understand how to download the mp3, or whate

Re: HTTP POST File without cURL

2009-09-11 Thread John Giotta
Is there a verbose feature for urllib2.urlopen? Here is my python snippet for posted the file: req = urllib2.Request(url='https://%s%s' % (host, selector), data=open('test.zip', 'rb').read()) req.add_header('content-type', 'application/zip') req.add_header('Authorization', 'Basic %s' % self.auth)

Re:

2009-09-11 Thread Chris Withers
open...@hushmail.com wrote: fs = cgi.FieldStorage() url = fs.getvalue('url', "http://www.openlayers.org";) try: insert a "print url" here... y = urllib2.urlopen(url) print y.read() This script produces the "failed')>". This is a name lookup failing, whatever you're ending up with

Re: Execution order

2009-09-11 Thread DarkBlue
On Sep 11, 9:34 pm, "Diez B. Roggisch" wrote: > DarkBlue wrote: > > Here is some code from a pyqt4.5.4  application on python 2.6 > > > def findData(self): > > >       self.ui.label.setText('Processing... ') > > >       # here we do something which takes a few seconds > >       self.refreshGrid()

Re: Some issue with easy_install and PIL/Imaging

2009-09-11 Thread Chris Withers
Klein Stéphane wrote: Resume : 1. first question : why PIL package in "pypi" don't work ? Because Fred Lundh have his package distributions unfortunate names that setuptools doesn't like... 2. second question : when I add PIL dependence in my setup.py and I do "python setup.py develop",

Re: Iterating Through Dictionary of Lists

2009-09-11 Thread Stefan Behnel
JB wrote: > I have created a small program that generates a project tree from a > dictionary. The dictionary is of key/value pairs where each key is a > directory, and each value is a list. The list have unique values > corresponding to the key, which is a directory where each value in the > list b

Re: Execution order

2009-09-11 Thread Diez B. Roggisch
DarkBlue wrote: > Here is some code from a pyqt4.5.4 application on python 2.6 > > def findData(self): > > self.ui.label.setText('Processing... ') > > # here we do something which takes a few seconds > self.refreshGrid() > > > > The problem is that the text in the self.ui.

Re: IDE for python similar to visual basic

2009-09-11 Thread Kevin Walzer
On 8/30/09 1:48 PM, r wrote: Hello qwe rty, I remember my first days with GUI programming and thinking to myself; how on earth can i write GUI code without a MS style GUI builder? Not to long after that i was coding up some pretty spectacular GUI's from nothing more than source code and loving

Iterating Through Dictionary of Lists

2009-09-11 Thread JB
I have created a small program that generates a project tree from a dictionary. The dictionary is of key/value pairs where each key is a directory, and each value is a list. The list have unique values corresponding to the key, which is a directory where each value in the list becomes a subdirector

Execution order

2009-09-11 Thread DarkBlue
Here is some code from a pyqt4.5.4 application on python 2.6 def findData(self): self.ui.label.setText('Processing... ') # here we do something which takes a few seconds self.refreshGrid() The problem is that the text in the self.ui.label is only changed on screen after th

Re: Python 3.1 csv with gzip

2009-09-11 Thread Stefan Behnel
dryfish wrote: > Python 3.1.1 doesn't seem to be happy with the use of gzip.open with > csv.reader. > > Using this: > > import gzip, csv, sys > > data = csv.reader(gzip.open(sys.argv[1])) > for row in data: > print(row) > > Will give this: > > Traceback (most recent call last): > File ".

Re: IDE for python similar to visual basic

2009-09-11 Thread David Smith
r wrote: > On Sep 11, 7:08 am, Nobody wrote: > (snip) >> I'm saying that the user understands their workflow and environment better >> than the application's programmers. The user should be able to decide >> which menu items are shown and where, which buttons are shown and where, >> etc. The code

Re: An assessment of the Unicode standard

2009-09-11 Thread r
On Sep 10, 8:43 pm, Jan Claeys wrote: > Maybe we should use a language that has a Turing-complete grammar, so > that even computers can understand & speak it "easily"? Interesting, i do find some things more easily explainable using code, however, code losses the ability to describe abstract ide

Re: IDE for python similar to visual basic

2009-09-11 Thread Brendon Wickham
> > > The interface really should be configurable by the user according to their > needs. The code doesn't need to *know* the position or dimensions of > a widget, or its label or colour or spacing, let alone dictate them. > Perhaps...but the user needs a framework in order to understand the funct

ANN: warehouse Objects in SQLite : y_serial module

2009-09-11 Thread code43
Module download at SourceForge http://yserial.sourceforge.net Serialization + persistance :: in a few lines of code, compress and annotate Python objects into SQLite; then later retrieve them chronologically by keywords without any SQL. Most useful "standard" module for a database to store schema-

Re: IDE for python similar to visual basic

2009-09-11 Thread r
On Sep 11, 7:08 am, Nobody wrote: (snip) > I'm saying that the user understands their workflow and environment better > than the application's programmers. The user should be able to decide > which menu items are shown and where, which buttons are shown and where, > etc. The code doesn't need to k

Re: IDE for python similar to visual basic

2009-09-11 Thread Nobody
On Mon, 07 Sep 2009 18:04:40 -0700, r wrote: >> >It also allows the GUI to be edited by without requiring any programming >> >knowledge. This eliminates the need for the GUI designer to be familiar >> >with the programming language used (or any programming language), and >> >allows customisation b

Re: IDE for python similar to visual basic

2009-09-11 Thread Nobody
On Mon, 07 Sep 2009 23:56:17 +, Albert van der Horst wrote: >>The main advantage of a GUI builder is that it helps prevent you from >>hard-coding the GUI into the program. You could get the same effect by >>coding a UIL/XRC/etc file manually, but a GUI builder tends to force it. > > A GUI bui

Re: Help with cumulative sum

2009-09-11 Thread Giacomo Boffi
Maggie writes: > [...] > else: >print 'The loop is finito' do you know of it.comp.lang.python? -- Sarebbe essere un atto di pieta'. Contro i miei principi.-- whip, in IFMdI -- http://mail.python.org/mailman/listinfo/python-list

Download and save a picture - urllib

2009-09-11 Thread mattia
Hi all, in order to download an image. In order to correctly retrieve the image I need to set the referer and handle cookies. opener = urllib.request.build_opener(urllib.request.HTTPRedirectHandler (), urllib.request.HTTPCookieProcessor()) urllib.request.install_opener(opener) req = urllib.reques

  1   2   >