Re: How to check something is in a list with rich-comparison objects?

2009-09-15 Thread Gabriel Genellina
En Wed, 16 Sep 2009 03:36:32 -0300, Jason escribió: On Sep 16, 2:39 am, "Gabriel Genellina" wrote: Looks like a bug in pysvn. Some class (whatever pysvn.wc_notify_action.status_completed is) is not well written. When compared against something unknown, it should return NotImplemented i

Re: How to check something is in a list with rich-comparison objects?

2009-09-15 Thread Jason
I will raise this with pysvn, if I can ever find their issue reporting system. In the meantime, I suppose I can only do this by traversing the list with a loop and catching exceptions. Ugly, but seems to be the only way. On Sep 16, 2:39 am, "Gabriel Genellina" wrote: > Looks like a bug in pysvn.

Re: socket.MSG_WAITALL flag broken on Windows XP in Python 2.5.4?

2009-09-15 Thread Tim Roberts
Wes McKinney wrote: > >I noticed the flag socket.MSG_WAITALL seems to have crept its way into >Python 2.5 on Windows (it's in 2.5.4, but not in 2.5.1, not sure about >intermediate releases). I do not think Windows supports it. It seems >to cause some problems in some libraries (like Pyro) that use

Re: Looking for a pure Python chart drawing module

2009-09-15 Thread Grant Edwards
On 2009-09-15, John Nagle wrote: > Tried PyChart. Set up for PNG file format. Got the error > "Exception: Ghostscript not found."This thing just creates > PostScript, then pumps it through GhostScript (anybody remember that?) Remember it? It's an actively maintained program and I use

Re: overrideredirect vs. text entry etc. widget

2009-09-15 Thread kernus
On Sep 15, 11:42 am, Sean DiZazzo wrote: > > Whats interesting is that if you call overrideredirect from a button > command, it works as expected.  Well, at least the text entry field ^so, Sean, you know how to *click this magic button in the programming way*? > behaves for me on

Re: preferred way to set encoding for print

2009-09-15 Thread Mark Tolonen
"_wolf" wrote in message news:22991c72-d00f-45cd-9bf7-0b80fc431...@k26g2000vbp.googlegroups.com... hi folks, i am doing my first steps in the wonderful world of python 3. some things are good. some things have to be relearned. some things drive me crazy. sadly, i'm working on a windows box.

Re: Retrieve url's of all jpegs at a web page URL

2009-09-15 Thread Paul McGuire
On Sep 15, 11:32 pm, Stefan Behnel wrote: > Also untested: > >         from lxml import html > >         doc = html.parse(page_url) >         doc.make_links_absolute(page_url) > >         urls = [ img.src for img in doc.xpath('//img') ] > > Then use e.g. urllib2 to save the images. Looks similar

Re: python 3.1 unicode question

2009-09-15 Thread Chris Rebert
On Tue, Sep 15, 2009 at 9:48 PM, jeffunit wrote: > At 09:25 PM 9/15/2009, Mark Tolonen wrote: >> >> "jeffunit" wrote in message >> news:20090915144123964.ljka6...@cdptpa-omta01.mail.rr.com... >>> >>> I wrote a program that diffs files and prints out matching file names. >>> I will be executing th

recommendation for webapp testing?

2009-09-15 Thread Schif Schaf
Hi, I need to do some basic website testing (log into account, add item to cart, fill out and submit forms, check out, etc.). What modules would be good to use for webapp testing like this? >From a bit of searching, it looks like twill was used for this, but it hasn't been updated in some time. -

Re: python 3.1 unicode question

2009-09-15 Thread jeffunit
At 09:25 PM 9/15/2009, Mark Tolonen wrote: "jeffunit" wrote in message news:20090915144123964.ljka6...@cdptpa-omta01.mail.rr.com... I wrote a program that diffs files and prints out matching file names. I will be executing the output with sh, to delete select files. Most of the files names are

Re: Looking for a pure Python chart drawing module

2009-09-15 Thread John Nagle
Ethan Furman wrote: John Nagle wrote: http://home.gna.org/pychart/doc/introduction.html Tried PyChart. Set up for PNG file format. Got the error "Exception: Ghostscript not found."This thing just creates PostScript, then pumps it through GhostScript (anybody remember that?) to get oth

Re: Retrieve url's of all jpegs at a web page URL

2009-09-15 Thread Stefan Behnel
Chris Rebert wrote: > page_url = "http://the.url.here"; > > with urllib.urlopen(page_url) as f: > soup = BeautifulSoup(f.read()) > for img_tag in soup.findAll("img"): > relative_url = img_tag.src > img_url = make_absolute(relative_url, page_url) > save_image_from_url(img_url) > >

Re: multiproccess: What is the Dameon flag?

2009-09-15 Thread Allen Fowler
> > > > What is the Daemon flag and when/why would I want to use it? > > > From the documentation: "When a process exits, it attempts to terminate > all of its daemonic child processes.". > > Sometimes you want the main process to wait for its worker processes to > terminate before terminating

Re: Looking for a pure Python chart drawing module

2009-09-15 Thread John Nagle
Alan G Isaac wrote: There's John Zelle's graphics.py: http://mcsp.wartburg.edu/zelle/python/ provides basic functionality. "The package is a wrapper around Tkinter". It runs Tkinter in a separate thread and sends commands to it. Pmw.Blt http://heim.ifi.uio.no/~hpl/Pmw.Blt/doc/reference.h

Re: python 3.1 unicode question

2009-09-15 Thread Mark Tolonen
"jeffunit" wrote in message news:20090915144123964.ljka6...@cdptpa-omta01.mail.rr.com... I wrote a program that diffs files and prints out matching file names. I will be executing the output with sh, to delete select files. Most of the files names are plain ascii, but about 10% of them have un

Re: Looking for a pure Python chart drawing module

2009-09-15 Thread John Nagle
gerlos wrote: John Nagle ha scritto: I'm looking for something that can draw simple bar and pie charts in Python. I'm trying to find a Python package, not a wrapper for some C library, as this has to run on both Windows and Linux and version clashes are a problem. Did you look at matplotlib

Re: unpacking vars from list of tuples

2009-09-15 Thread Ross
Thanks Tim, That's actually the stuff I was trying to remember. my_list = [name for _, name, _ in k] I recalled using some underscores for nice dense unnamed variable unpacking before, but couldn't recall the process. Thanks for that. Ross. On 15-Sep-09, at 6:33 PM, Tim Chase wrote:

Re: Looking for a pure Python chart drawing module

2009-09-15 Thread Alan G Isaac
There's John Zelle's graphics.py: http://mcsp.wartburg.edu/zelle/python/ provides basic functionality. Pmw.Blt http://heim.ifi.uio.no/~hpl/Pmw.Blt/doc/reference.html pygooglechart You suggested this needs a browser, but not so, you can download the PNGs and use the default viewer to display them

Re: Fwd: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Russell Jackson
I received a reply from the help group that suggested I added a call to flush in there, and that fixed it. The working code looks like this: def setpassword(user): password = "passworD\n" try: cmd = ' passwd {0}'.format(user) pipe = Popen(p4 + cmd, shell=True, stdin=PIPE, st

Re: Fwd: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Chris Rebert
On Tue, Sep 15, 2009 at 4:58 PM, Russell Jackson wrote: > I just get an errorlevel from the executable when I read stdout, but I can't > tell what is going on because, of course, I can't tell what Popen is > actually doing. I never see the prompt from the executable that I would > expect to see wh

Re: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Russell Jackson
Yes, I don't think the problem is that isn't running the command, I think it is just that I don't know how to communicate with it in the way that I need to in order to make this work. I have tried finding examples of working with Popen, but they are few and far between. I am not sure what was wrong

Re: python decimals

2009-09-15 Thread Andrew Svetlov
It only reflects the fact what comp.lang.python replicated by several web sites. Unfortunately looks like there are no link to library implements that : ( On Sep 15, 5:17 pm, Terry Reedy wrote: > Mark Dickinson wrote: > > On Sep 15, 2:27 am, Andrew Svetlov wrote: > >> Is there some kind of pytho

Re: VTK install

2009-09-15 Thread Gabriel Genellina
En Tue, 15 Sep 2009 19:35:23 -0300, Gib escribió: On Sep 16, 12:28 am, Francesco Bochicchio wrote: On Sep 15, 6:29 am, Gib wrote: > Since VTK appears to be installed, I'm guessing that either the path > setting is wrong, or python is not using PYTHONPATH.  How can I check > that PYTHONPATH i

Re: Application Packages

2009-09-15 Thread Dj Gilcrease
when looking up namespace-packages I found pkgutil which lets me add a myapp.user package with the following in its __init__.py and nothing else import os, os.path from pkgutil import extend_path homedir = os.environ.get('HOME') or os.environ.get('USERPROFILE') __path__ = extend_path([os.path.abs

Re: multiproccess: What is the Dameon flag?

2009-09-15 Thread MRAB
Allen Fowler wrote: Hello, What is the Daemon flag and when/why would I want to use it? From the documentation: "When a process exits, it attempts to terminate all of its daemonic child processes.". Sometimes you want the main process to wait for its worker processes to terminate before termi

Re: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Chris Rebert
On Tue, Sep 15, 2009 at 5:07 PM, Chris Rebert wrote: > On Tue, Sep 15, 2009 at 4:01 PM, Russell Jackson > wrote: > >> Attempted code in Python 3: (Doesn't work either) > >>         cmd = ' passwd {0}'.format(user) >>         pipe = Popen(p4 + cmd, shell=True, stdin=PIPE, stdout=PIPE, >> stderr=

socket.MSG_WAITALL flag broken on Windows XP in Python 2.5.4?

2009-09-15 Thread Wes McKinney
I noticed the flag socket.MSG_WAITALL seems to have crept its way into Python 2.5 on Windows (it's in 2.5.4, but not in 2.5.1, not sure about intermediate releases). I do not think Windows supports it. It seems to cause some problems in some libraries (like Pyro) that use it if it's available in th

Re: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Chris Rebert
On Tue, Sep 15, 2009 at 4:01 PM, Russell Jackson wrote: > Attempted code in Python 3: (Doesn't work either) >         cmd = ' passwd {0}'.format(user) >         pipe = Popen(p4 + cmd, shell=True, stdin=PIPE, stdout=PIPE, > stderr=PIPE, universal_newlines=True) You're not specifying the command

Re: Fwd: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Russell Jackson
I just get an errorlevel from the executable when I read stdout, but I can't tell what is going on because, of course, I can't tell what Popen is actually doing. I never see the prompt from the executable that I would expect to see when I read stdout. I originally had the function like this: def s

Re: subprocess woes

2009-09-15 Thread kj
In Chris Rebert writes: >On Tue, Sep 15, 2009 at 12:26 PM, kj wrote: >> I'm trying to write a function, sort_data, that takes as argument >> the path to a file, and sorts it in place, leaving the last "sentinel" >> line in its original position (i.e. at the end). =C2=A0Here's what I >> have (o

Re: Retrieve url's of all jpegs at a web page URL

2009-09-15 Thread Chris Rebert
On Tue, Sep 15, 2009 at 7:28 AM, grimmus wrote: > Hi, > > I would like to achieve something like Facebook has when you post a > link. It shows images located at the URL you entered so you can choose > what one to display as a summary. > > I was thinking i could loop through the html of a page with

Re: Looking for a pure Python chart drawing module

2009-09-15 Thread gerlos
John Nagle ha scritto: > I'm looking for something that can draw simple bar and pie charts > in Python. I'm trying to find a Python package, not a wrapper for > some C library, as this has to run on both Windows and Linux > and version clashes are a problem. > Did you look at matplotlib? In the

Re: subprocess woes

2009-09-15 Thread Chris Rebert
On Tue, Sep 15, 2009 at 12:26 PM, kj wrote: > I'm trying to write a function, sort_data, that takes as argument > the path to a file, and sorts it in place, leaving the last "sentinel" > line in its original position (i.e. at the end).  Here's what I > have (omitting most error-checking code): > >

multiproccess: What is the Dameon flag?

2009-09-15 Thread Allen Fowler
Hello, What is the Daemon flag and when/why would I want to use it? Thank you, AF -- http://mail.python.org/mailman/listinfo/python-list

Re: Fwd: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Rhodri James
On Wed, 16 Sep 2009 00:01:17 +0100, Russell Jackson wrote: Hi, I have the following code that works fine in Python 2.x, but I can't seem to get it to work in Python 3 with Popen. Can you please tell me how to get the same functionality out of Python 3? The gist of what I doing is in the

Re: subprocess woes

2009-09-15 Thread kj
Upon re-reading my post I realize that I left out some important details. In kj writes: >I'm trying to write a function, sort_data, that takes as argument >the path to a file, and sorts it in place, leaving the last "sentinel" >line in its original position (i.e. at the end). I neglected to

Re: subprocess woes

2009-09-15 Thread kj
In Mike Driscoll writes: >On Sep 15, 2:26=A0pm, kj wrote: >> I'm trying to write a function, sort_data, that takes as argument >> the path to a file, and sorts it in place, leaving the last "sentinel" >> line in its original position (i.e. at the end). =A0Here's what I >> have (omitting most e

Fwd: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Russell Jackson
Hi, I have the following code that works fine in Python 2.x, but I can't seem to get it to work in Python 3 with Popen. Can you please tell me how to get the same functionality out of Python 3? The gist of what I doing is in the setpassword function. I have tried numerous ways to get this to work,

Re: Remove empty strings from list

2009-09-15 Thread Rhodri James
On Tue, 15 Sep 2009 02:55:13 +0100, Chris Rebert wrote: On Mon, Sep 14, 2009 at 6:49 PM, Helvin wrote: Hi, Sorry I did not want to bother the group, but I really do not understand this seeming trivial problem. I am reading from a textfile, where each line has 2 values, with spaces before and

Re: LinkedIn Messages, 9/15/2009

2009-09-15 Thread Rhodri James
On Tue, 15 Sep 2009 14:39:04 +0100, LinkedIn Communication wrote: LinkedIn [snippety snip] Methinks the spam filter needs updating. -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Application Packages

2009-09-15 Thread Diez B. Roggisch
Dj Gilcrease schrieb: Say I have an application that lives in /usr/local/myapp it comes with some default plugins that live in /usr/local/myapp/plugins and I allow users to have plugins that would live in ~/myapp/plugins Is there a way to map ~/myapp to a user package so I could do "from user.pl

Re: Looking for a pure Python chart drawing module

2009-09-15 Thread Ethan Furman
John Nagle wrote: http://home.gna.org/pychart/doc/introduction.html Tried PyChart. Set up for PNG file format. Got the error "Exception: Ghostscript not found."This thing just creates PostScript, then pumps it through GhostScript (anybody remember that?) to get other formats. And does

Re: MayaVi install

2009-09-15 Thread Gib
On Sep 16, 3:45 am, Robert Kern wrote: > On 2009-09-14 23:07 PM, Gib wrote: > > > I am trying to follow the instructions for installing MayaVi  given on > > the Enthought site: > >http://code.enthought.com/projects/mayavi/docs/development/html/mayav... > > I'm following the step-by-step instructio

Re: VTK install

2009-09-15 Thread Gib
On Sep 16, 12:28 am, Francesco Bochicchio wrote: > On Sep 15, 6:29 am, Gib wrote: > > > As part of the MayaVi install, I need to install VTK.   > > ... > > > Since VTK appears to be installed, I'm guessing that either the path > > setting is wrong, or python is not using PYTHONPATH.  How can I ch

Re: unpacking vars from list of tuples

2009-09-15 Thread Ross
On Sep 15, 6:00 pm, Andre Engels wrote: > On Tue, Sep 15, 2009 at 11:51 PM, Ross wrote: > > I'm inexperienced with some of the fancy list slicing syntaxes where > > python shines. > > > If I have a list of tuples: > > >   k=[("a", "bob", "c"), ("p", "joe", "d"), ("x", "mary", "z")] > > > and I wa

Re: unpacking vars from list of tuples

2009-09-15 Thread Tim Chase
If I have a list of tuples: k=[("a", "bob", "c"), ("p", "joe", "d"), ("x", "mary", "z")] and I want to pull the middle element out of each tuple to make a new list: myList = ["bob", "joe", "mary"] is there some compact way to do that? I can imagine the obvious one of myList = [] for a in

Re: Why use "locals()"

2009-09-15 Thread Carl Banks
On Sep 15, 11:41 am, "Gabriel Genellina" wrote: > En Tue, 15 Sep 2009 11:18:35 -0300, Sion Arrowsmith   > escribió: > > > Sean DiZazzo   wrote: > > What I'm not clear about is under what circumstances locals() does > > not produce the same result as vars() . > > py> help(vars) > Help on built-in

Re: unpacking vars from list of tuples

2009-09-15 Thread Wolfram Hinderer
On 15 Sep., 23:51, Ross wrote: > If I have a list of tuples: > >    k=[("a", "bob", "c"), ("p", "joe", "d"), ("x", "mary", "z")] > > and I want to pull the middle element out of each tuple to make a new > list: > > myList = ["bob", "joe", "mary"] if a tuple is OK: zip(*k)[1] -- http://mail.pyth

Re: unpacking vars from list of tuples

2009-09-15 Thread Andre Engels
On Tue, Sep 15, 2009 at 11:51 PM, Ross wrote: > I'm inexperienced with some of the fancy list slicing syntaxes where > python shines. > > If I have a list of tuples: > >   k=[("a", "bob", "c"), ("p", "joe", "d"), ("x", "mary", "z")] > > and I want to pull the middle element out of each tuple to ma

Re: unpacking vars from list of tuples

2009-09-15 Thread Chris Rebert
On Tue, Sep 15, 2009 at 2:51 PM, Ross wrote: > I'm inexperienced with some of the fancy list slicing syntaxes where > python shines. > > If I have a list of tuples: > >   k=[("a", "bob", "c"), ("p", "joe", "d"), ("x", "mary", "z")] > > and I want to pull the middle element out of each tuple to mak

unpacking vars from list of tuples

2009-09-15 Thread Ross
I'm inexperienced with some of the fancy list slicing syntaxes where python shines. If I have a list of tuples: k=[("a", "bob", "c"), ("p", "joe", "d"), ("x", "mary", "z")] and I want to pull the middle element out of each tuple to make a new list: myList = ["bob", "joe", "mary"] is there s

Application Packages

2009-09-15 Thread Dj Gilcrease
Say I have an application that lives in /usr/local/myapp it comes with some default plugins that live in /usr/local/myapp/plugins and I allow users to have plugins that would live in ~/myapp/plugins Is there a way to map ~/myapp to a user package so I could do "from user.plugins import *" or bette

Re: Looking for a pure Python chart drawing module

2009-09-15 Thread John Nagle
John Nagle wrote: I'm looking for something that can draw simple bar and pie charts in Python. I'm trying to find a Python package, not a wrapper for some C library, as this has to run on both Windows and Linux and version clashes are a problem. Here's the list from the Python wiki at "http://w

Re: python decimals

2009-09-15 Thread Terry Reedy
Mark Dickinson wrote: On Sep 15, 2:27 am, Andrew Svetlov wrote: Is there some kind of python binding for decNumber library? Standard decimal.Decimal is good enough, but very slow. My current project toughly coupled with 'currency' operations and we have performance problems related to decimal c

Re: An assessment of the Unicode standard

2009-09-15 Thread Terry Reedy
Christopher Culver wrote: Robin Becker writes: well allegedly, "the medium is the message" so we also need to take account of language in addition to the meaning of communications. I don't believe all languages are equivalent in the meanings that they can encode or convey. Our mathematics is he

Re: subprocess woes

2009-09-15 Thread Christian Heimes
Mike Driscoll wrote: > You can use cStringIO to create a "file-like" object in memory: > > http://docs.python.org/library/stringio.html No, you can't with subprocess. The underlying operating system API requires a file descriptor of a real file. Christian -- http://mail.python.org/mailman/list

Re: subprocess woes

2009-09-15 Thread Mike Driscoll
On Sep 15, 2:26 pm, kj wrote: > I'm trying to write a function, sort_data, that takes as argument > the path to a file, and sorts it in place, leaving the last "sentinel" > line in its original position (i.e. at the end).  Here's what I > have (omitting most error-checking code): > > def sort_data

Re: ActiveState Python 2.5 doesn't work via ssh?

2009-09-15 Thread TerryP
On Sep 15, 7:20 pm, Grant Edwards wrote: > Does anybody have any idea why Active State Python 2.5 works > fine from a normal Cygwin shell window, but hangs when I try to > start it when I'm ssh'd into the machine? > Mixing normal Windows and Cygwin programs can sometimes yield odd results. The on

Upcoming Python/Django Classes

2009-09-15 Thread Steve Holden
Holden Web is please to announce a public "Introduction to Python" class, near Washington DC, on October 13-15, presented by Steve Holden. This is followed, on Friday October 16, by a one-day "Django Master Class" presented by Jacob Kaplan-Moss. Further details are available from http://holden

Re: KeyBoard interrupt and Redirection operator

2009-09-15 Thread Dave Angel
aditya shukla wrote: Hello Guys, I have a program which i use like this scraps.py arg1 arg2 > filename. I am using the redirection operator to direct the output to the filename .The scenario here is that I want to print a message as long as the program is running and as generate an error messag

subprocess woes

2009-09-15 Thread kj
I'm trying to write a function, sort_data, that takes as argument the path to a file, and sorts it in place, leaving the last "sentinel" line in its original position (i.e. at the end). Here's what I have (omitting most error-checking code): def sort_data(path, sentinel='.\n'): tmp_fd, tmp

Re: Looking for a pure Python chart drawing module

2009-09-15 Thread ici
On Sep 15, 8:25 pm, John Nagle wrote: > I'm looking for something that can draw simple bar and pie charts > in Python.  I'm trying to find a Python package, not a wrapper for > some C library, as this has to run on both Windows and Linux > and version clashes are a problem. > > Here's the list fro

ActiveState Python 2.5 doesn't work via ssh?

2009-09-15 Thread Grant Edwards
Does anybody have any idea why Active State Python 2.5 works fine from a normal Cygwin shell window, but hangs when I try to start it when I'm ssh'd into the machine? -- Grant Edwards grante Yow! I don't know WHY I at s

Re: KeyBoard interrupt and Redirection operator

2009-09-15 Thread Gary Herron
aditya shukla wrote: Hello Guys, I have a program which i use like this scraps.py arg1 arg2 > filename. I am using the redirection operator to direct the output to the filename .The scenario here is that I want to print a message as long as the program is running and as generate an error me

Re: KeyBoard interrupt and Redirection operator

2009-09-15 Thread Gabriel Genellina
En Tue, 15 Sep 2009 15:10:48 -0300, aditya shukla escribió: I have a program which i use like this scraps.py arg1 arg2 > filename. I am using the redirection operator to direct the output to the filename .The scenario here is that I want to print a message as long as the program is runn

Re: Why use "locals()"

2009-09-15 Thread Gabriel Genellina
En Tue, 15 Sep 2009 11:18:35 -0300, Sion Arrowsmith escribió: Sean DiZazzo wrote: What I'm not clear about is under what circumstances locals() does not produce the same result as vars() . py> help(vars) Help on built-in function vars in module __builtin__: vars(...) vars([object])

Trouble with MySQLdb

2009-09-15 Thread Chris
I'm receiving the following error: Traceback (most recent call last): File "db.py", line 189, in rows = db.get("SELECT * FROM survey") File "db.py", line 55, in get self.sql(query) File "db.py", line 47, in sql return self.cursor.execute(query) File "build/bdist.linux-i686/e

Re: How to check something is in a list with rich-comparison objects?

2009-09-15 Thread Gabriel Genellina
En Tue, 15 Sep 2009 11:18:33 -0300, Jason escribió: Comparing a string to the enumerations in pysvn gives me an attribute error, because they've overloaded the rich compare methods: import pysvn "string" in [pysvn.wc_notify_action.status_completed, "string"] Traceback (most recent call las

KeyBoard interrupt and Redirection operator

2009-09-15 Thread aditya shukla
Hello Guys, I have a program which i use like this scraps.py arg1 arg2 > filename. I am using the redirection operator to direct the output to the filename .The scenario here is that I want to print a message as long as the program is running and as generate an error message and exit as I use a k

Re: Looking for a pure Python chart drawing module

2009-09-15 Thread Vlastimil Brom
2009/9/15 John Nagle : > I'm looking for something that can draw simple bar and pie charts > in Python.  I'm trying to find a Python package, not a wrapper for > some C library, as this has to run on both Windows and Linux > and version clashes are a problem. > > Here's the list from the Python wik

Looking for a pure Python chart drawing module

2009-09-15 Thread John Nagle
I'm looking for something that can draw simple bar and pie charts in Python. I'm trying to find a Python package, not a wrapper for some C library, as this has to run on both Windows and Linux and version clashes are a problem. Here's the list from the Python wiki at "http://wiki.python.org/moin

Re: How to improve this code?

2009-09-15 Thread Andreas Waldenburger
On Mon, 14 Sep 2009 18:33:17 -0700 (PDT) André wrote: > Here's an example using sets: > > >>> def is_present(list_1, list_2): > ...if set(list_1).intersection(set(list_2)): > ... return True > ...return False > ... Not that it matters, but I'd probably write: def is_present(test,

Re: An assessment of the Unicode standard

2009-09-15 Thread r
On Sep 15, 4:12 am, Hendrik van Rooyen wrote: (snip) > When a language lacks a word for a concept like "window", then (I > believe  :-) ), it kind of puts a crimp in the style of thinking that a > person will do, growing up with only that language. Are you telling us people using a language that

Re: An assessment of the Unicode standard

2009-09-15 Thread Hyuga
On Sep 14, 5:05 am, Christopher Culver wrote: > Hyuga writes: > > I just wanted to add, in defense of the Chinese written language > > ... that I think it would make a fairly good candidate for use at > > least as a universal *written* language.  Particularly simplified > > Chinese since, well, i

Re: Re: How to improve this code?

2009-09-15 Thread Dave Angel
Oltmans wrote: On Sep 15, 1:13 pm, Hendrik van Rooyen wrote: (i) a True if All the elements in match are in aList, else False? (ii) a True if any one or more of the members of match are in aList? (iii) Something else? That's a good question because I failed miserably in explainin

Re: weird str error

2009-09-15 Thread Dave Angel
daved170 wrote: Hi everybody, I'm using SPE 0.8.3.c as my python editor. I'm using the str() function and i got a very odd error. I'm trying to do this: print str("HI") When i'm writing this line in the shell it prints: HI When it's in my code (it's the only line) i'm getting the following error

Re: weird str error

2009-09-15 Thread Peter Otten
daved170 wrote: > Hi everybody, > I'm using SPE 0.8.3.c as my python editor. > I'm using the str() function and i got a very odd error. > > I'm trying to do this: print str("HI") > When i'm writing this line in the shell it prints: HI > When it's in my code (it's the only line) i'm getting the fo

Re: str.split() with empty separator

2009-09-15 Thread MRAB
Vlastimil Brom wrote: 2009/9/15 Ulrich Eckhardt : Hi! "'abc'.split('')" gives me a "ValueError: empty separator". However, "''.join(['a', 'b', 'c'])" gives me "'abc'". Why this asymmetry? I was under the impression that the two would be complementary. Uli maybe it isn't quite obvious, what

Re: An assessment of the Unicode standard

2009-09-15 Thread Christopher Culver
Hendrik van Rooyen writes: > 2) Is about as useful as stating that any Turing complete language and > processor pair is capable of solving any computable problem, given enough > time. So why are we not all programming in brainfuck? Except the amount of circumlocution one language might happen t

Re: How to improve this code?

2009-09-15 Thread Tim Golden
Tim Golden wrote: Unless I'm missing something, (and I didn't bother to read the original code so I may be) that's a subset test: set (searchList) <= set (searchList) (cough) or, rather: set (searchList) <= set (sourceList) TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: How to improve this code?

2009-09-15 Thread Tim Golden
Sol Toure wrote: def are_elements_present(sourceList, searchList):for e in searchList: if e not in sourceList: return False return True Using set: def are_elements_present(sourceList, searchList): return len(set(sourceList).intersection(set(searchList

Re: How to improve this code?

2009-09-15 Thread Sol Toure
def are_elements_present(sourceList, searchList):for e in searchList: if e not in sourceList: return False return True Using set: def are_elements_present(sourceList, searchList): return len(set(sourceList).intersection(set(searchList)) == len(searchLis

Re: cx_Oracle problem

2009-09-15 Thread Squid
On Sep 15, 9:45 am, Squid wrote: > It's time for another round of "stump-the-geek". (thats what we call > it in my office) > > If actual code is needed I can provide but lets start off small for > this one... > > I've got a Python script that uses cx_Oracle to access an Oracle DB. > running the sc

cx_Oracle problem

2009-09-15 Thread Squid
It's time for another round of "stump-the-geek". (thats what we call it in my office) If actual code is needed I can provide but lets start off small for this one... I've got a Python script that uses cx_Oracle to access an Oracle DB. running the script from command line runs perfect running the

Re: PyQT Qthread stuck main app

2009-09-15 Thread Dave Angel
daved170 wrote: On Sep 15, 2:54 pm, David Boddie wrote: On Tue Sep 15 12:59:35 CEST 2009, daved170 wrote: my problem is that when start is pusshed the entire window stuck and it's impossible to push the STOP button and even when it looks like it's been pushed it actually don't do anyt

Re: MayaVi install

2009-09-15 Thread Robert Kern
On 2009-09-14 23:07 PM, Gib wrote: I am trying to follow the instructions for installing MayaVi given on the Enthought site: http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/installation.html I'm following the step-by-step instructions to install with eggs under Windows. W

Re: overrideredirect vs. text entry etc. widget

2009-09-15 Thread Sean DiZazzo
On Sep 14, 10:43 pm, kernus wrote: > I just googled this post: > > http://mail.python.org/pipermail/python-list/2006-September/575832.html > > something like: > > from Tkinter import * > > root = Tk() > Entry(root).pack() > Button(root, text='Quit', command=sys.exit).pack() > root.overrideredirect

Re: Incremental project based programming guide

2009-09-15 Thread John Haggerty
On Tue, Sep 15, 2009 at 2:22 AM, Hendrik van Rooyen wrote: > On Tuesday 15 September 2009 04:43:46 bouncy...@gmail.com wrote: > > I was wondering if anyone had actually designed their programming text > > around incremental parts of a project and then taken the results of the > > project at each

Re: How to improve this code?

2009-09-15 Thread Oltmans
On Sep 15, 1:13 pm, Hendrik van Rooyen wrote: > > (i) a True if All the elements in match are in aList, else False? > (ii) a True if any one or more of the members of match are in aList? > (iii) Something else? That's a good question because I failed miserably in explaining my problem clearl

Re: Python and flash charts

2009-09-15 Thread Benjamin Kaplan
On Tue, Sep 15, 2009 at 10:06 AM, Massi wrote: > > Hi everyone, I'm trying to incorporate in my script flash charts like > those of yahoo finance (for example this: > http://it.finance.yahoo.com/echarts?s=^DJI#symbol=^DJI;range=1d), > possibly using wxpython. Does anybody have any idea on how to d

weird str error

2009-09-15 Thread daved170
Hi everybody, I'm using SPE 0.8.3.c as my python editor. I'm using the str() function and i got a very odd error. I'm trying to do this: print str("HI") When i'm writing this line in the shell it prints: HI When it's in my code (it's the only line) i'm getting the following error: file "c:\Python

python 3.1 unicode question

2009-09-15 Thread jeffunit
I wrote a program that diffs files and prints out matching file names. I will be executing the output with sh, to delete select files. Most of the files names are plain ascii, but about 10% of them have unicode characters in them. When I try to print the string containing the name, I get an excep

Retrieve url's of all jpegs at a web page URL

2009-09-15 Thread grimmus
Hi, I would like to achieve something like Facebook has when you post a link. It shows images located at the URL you entered so you can choose what one to display as a summary. I was thinking i could loop through the html of a page with a regex and store all the jpeg url's in an array. Then, i co

Re: Why use "locals()"

2009-09-15 Thread Sion Arrowsmith
Sean DiZazzo wrote: >> def print_item(item): >>      description = textwrap.fill(item.description, 40) >>      short = item.description.split('\n', 1)[0] >>      code = str(item.id).zfill(6) >>      print "%(code)s %(short)s\n%(description)s\n" % locals() > >I see the use of that, but according t

How to check something is in a list with rich-comparison objects?

2009-09-15 Thread Jason
Comparing a string to the enumerations in pysvn gives me an attribute error, because they've overloaded the rich compare methods: >>> import pysvn >>> "string" in [pysvn.wc_notify_action.status_completed, "string"] Traceback (most recent call last): File "", line 1, in AttributeError: expecting

Re: Remove empty strings from list

2009-09-15 Thread Sion Arrowsmith
Bruno Desthuilliers wrote: > >> mylist = line.strip().split() > >will already do the RightThing(tm). So will mylist = line.split() -- \S under construction -- http://mail.python.org/mailman/listinfo/python-list

Python and flash charts

2009-09-15 Thread Massi
Hi everyone, I'm trying to incorporate in my script flash charts like those of yahoo finance (for example this: http://it.finance.yahoo.com/echarts?s=^DJI#symbol=^DJI;range=1d), possibly using wxpython. Does anybody have any idea on how to do that? Thanks in advance. -- http://mail.python.org/mail

Re: PyQT Qthread stuck main app

2009-09-15 Thread daved170
On Sep 15, 2:54 pm, David Boddie wrote: > On Tue Sep 15 12:59:35 CEST 2009, daved170 wrote: > > > my problem is that when start is pusshed the entire window stuck and > > it's impossible to push the STOP button and even when it looks like > > it's been pushed it actually don't do anything. > > > a

Re: str.split() with empty separator

2009-09-15 Thread Vlastimil Brom
2009/9/15 Ulrich Eckhardt : > Hi! > > "'abc'.split('')" gives me a "ValueError: empty separator". > However, "''.join(['a', 'b', 'c'])" gives me "'abc'". > > Why this asymmetry? I was under the impression that the two would be > complementary. > > Uli > maybe it isn't quite obvious, what the behav

ANN: FuncDesigner 0.15 - free Python-written framework with automatic differentiation

2009-09-15 Thread dmitrey
FuncDesigner is cross-platform (Windows, Linux, Mac OS etc) Python- written framework with automatic differentiation (http:// en.wikipedia.org/wiki/Automatic_differentiation). License BSD allows to use it in both open- and closed-code soft. It has been extracted from OpenOpt framework as a stand-al

  1   2   >