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

2009-09-16 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 gagsl-...@yahoo.com.ar wrote: Looks

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

2009-09-16 Thread Gabriel Genellina
En Wed, 16 Sep 2009 03:36:32 -0300, Jason jason.hee...@gmail.com escribió: On Sep 16, 2:39 am, Gabriel Genellina gagsl-...@yahoo.com.ar 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

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

2009-09-16 Thread Steven D'Aprano
On Wed, 16 Sep 2009 03:57:30 -0300, Gabriel Genellina wrote: En Wed, 16 Sep 2009 03:36:32 -0300, Jason jason.hee...@gmail.com escribió: On Sep 16, 2:39 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: Looks like a bug in pysvn. Some class (whatever

Re: str.split() with empty separator

2009-09-16 Thread Hendrik van Rooyen
On Tuesday 15 September 2009 14:50:11 Xavier Ho wrote: On Tue, Sep 15, 2009 at 10:31 PM, Ulrich Eckhardt eckha...@satorlaser.comwrote: 'abc'.split('') gives me a ValueError: empty separator. However, ''.join(['a', 'b', 'c']) gives me 'abc'. Why this asymmetry? I was under the impression

Re: Remove empty strings from list

2009-09-16 Thread Bruno Desthuilliers
Sion Arrowsmith a écrit : Bruno Desthuilliers bruno.42.desthuilli...@websiteburo.invalid wrote: mylist = line.strip().split() will already do the RightThing(tm). So will mylist = line.split() Yeps, it's at least the second time someone reminds me that the call to str.strip is just

Re: python decimals

2009-09-16 Thread Mark Dickinson
On Sep 16, 1:35 am, Andrew Svetlov andrew.svet...@gmail.com wrote: 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 : ( A few random thoughts: If you just want fixed-precision decimal, there

Re: An assessment of the Unicode standard

2009-09-16 Thread Lie Ryan
r wrote: On Sep 15, 4:12 am, Hendrik van Rooyen hend...@microcorp.co.za 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

Re: An assessment of the Unicode standard

2009-09-16 Thread Lie Ryan
r wrote: Not that I agree that it would be a Utopia, whatever the language - more like a nightmare of Orwellian proportions - because the language you get taught first, moulds the way you think. And I know from personal experience that there are concepts that can be succinctly expressed in

Re: An assessment of the Unicode standard

2009-09-16 Thread Lie Ryan
r wrote: You're on a slippery slope when you claim that people deserve whatever mistreatment or misfortune comes their way through mere circumstances of birth. I suggest you step back and actually read your messages again and consider how others might interpret them. Paul: civilizations rise

Re: OT Language wars - was :An assessment of the Unicode standard

2009-09-16 Thread Hendrik van Rooyen
On Tuesday 15 September 2009 18:22:30 Christopher Culver wrote: Hendrik van Rooyen hend...@microcorp.co.za 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

Threading.py Class Syntax and Super

2009-09-16 Thread Casey
Hi, I noticed that the many (if not all) classes in threading.py[1] all inherit from object, yet non of the init methods call super(). I am curious as to why this is the chosen implementation? If the benefit of new-style classes is to support multiple inheritance, then isn't this broken if the

Re: An assessment of the Unicode standard

2009-09-16 Thread Hendrik van Rooyen
On Tuesday 15 September 2009 19:04:10 r wrote: On Sep 15, 4:12 am, Hendrik van Rooyen hend...@microcorp.co.za 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

Re: Class variable inheritance

2009-09-16 Thread Lie Ryan
Terry Reedy wrote: 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'

Re: An assessment of the Unicode standard

2009-09-16 Thread MRAB
Lie Ryan wrote: r wrote: On Sep 15, 4:12 am, Hendrik van Rooyen hend...@microcorp.co.za 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.

Re: Threading.py Class Syntax and Super

2009-09-16 Thread Michele Simionato
On Sep 16, 12:23 pm, Casey casey.mcgi...@gmail.com wrote: Hi, I noticed that the many (if not all) classes in threading.py[1] all inherit from object, yet non of the init methods call super(). I am curious as to why this is the chosen implementation? If the benefit of new-style classes is to

Zipped and pickle

2009-09-16 Thread Thomas Lehmann
How do I implement best to use pickle that way that the file is zipped? -- http://mail.python.org/mailman/listinfo/python-list

Fwd: Re: How to improve this code?

2009-09-16 Thread Hendrik van Rooyen
From a private email, forwarded to the list: -- Forwarded Message -- Subject: Re: How to improve this code? Date: Tuesday 15 September 2009 From: Oltmans rolf.oltm...@gmail.com To: hend...@microcorp.co.za On Sep 15, 1:13 pm, Hendrik van Rooyen hend...@microcorp.co.za wrote:

Re: multiproccess: What is the Dameon flag?

2009-09-16 Thread MRAB
Allen Fowler wrote: 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: Fwd: Re: How to improve this code?

2009-09-16 Thread Thomas Lehmann
otherwise. Given this, I'm just trying to write a method are_elements_present(aList) whose job is to return True if and only if all elements in aList are present in page's HTML. So here is how missingItems = [str(ele) for ele in eleLocators if not selenium.is_element_present(ele)] if

Re: Class variable inheritance

2009-09-16 Thread Duncan Booth
Lie Ryan lie.1...@gmail.com wrote: Terry Reedy wrote: 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

Re: Fwd: Re: How to improve this code?

2009-09-16 Thread Duncan Booth
Hendrik van Rooyen hend...@microcorp.co.za wrote: def are_elements_present(eleLocators): elePresent=False if not eleLocators: return False for ele in eleLocators: if selenium.is_element_present(ele): elePresent=True else:

Re: pyjamas in action?

2009-09-16 Thread lkcl
On Aug 31, 8:35 pm, André andre.robe...@gmail.com wrote: On Aug 31, 4:46 pm, kj no.em...@please.post wrote: At work we want to implement a webapp using Google's GWT, and we're debating whether to use the standard GWT approach with Java, or to tryPyjamas. There's no great love here for

Re: Why use locals()

2009-09-16 Thread Sion Arrowsmith
Gabriel Genellina gagsl-...@yahoo.com.ar wrote: s...@viridian.paintbox escribió: 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]) -

Re: recommendation for webapp testing?

2009-09-16 Thread Simon Brunning
2009/9/16 Schif Schaf schifsc...@gmail.com: 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? http://code.google.com/p/webdriver/ might be worth a look. --

Re: Looking for a pure Python chart drawing module

2009-09-16 Thread Michel Claveau - MVP
Hi! Perso I use a wrapper to RMCHART. There are two versions : DLL COM. I prefer COM. Warning : only on Windows's family. @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Threading.py Class Syntax and Super

2009-09-16 Thread Carl Banks
On Sep 16, 3:23 am, Casey casey.mcgi...@gmail.com wrote: I noticed that the many (if not all) classes in threading.py[1] all inherit from object, yet non of the init methods call super(). I am curious as to why this is the chosen implementation? If the benefit of new-style classes is to

Re: Looking for a pure Python chart drawing module

2009-09-16 Thread Alan G Isaac
Alan G Isaac wrote: There's John Zelle's graphics.py: http://mcsp.wartburg.edu/zelle/python/ provides basic functionality. On 9/16/2009 12:33 AM, John Nagle wrote: The package is a wrapper around Tkinter. It runs Tkinter in a separate thread and sends commands to it. Tkinter is part of

Re: Why use locals()

2009-09-16 Thread steve
On 09/14/2009 08:36 AM, Sean DiZazzo wrote: I have never used a call to locals() in my code. Can you show me a use case where it is valuable and Pythonic? You've received other answers, but just purely from the 'zen' perspective, there is a nice clean yin/yan symmetry about globals() Vs

Re: Looking for a pure Python chart drawing module

2009-09-16 Thread Robin Becker
PS: For those people that sugest use Blt. I use Blt a lot in linux and win32 but it is not port (yet) to TK8.5 so, it do not works with py2.6, and is really painfull to build in win32. Beside that, in order to use Blt, you need an instance of Tk running, ergo a XWindows running, an some times

Re: string interpolation mystery in Python 2.6

2009-09-16 Thread Scott David Daniels
Alan G Isaac wrote: George Brandl explained it to me this way: It's probably best explained with a bit of code: class C(object): ... def __str__(self): return '[str]' ... def __unicode__(self): return '[unicode]' ... %s %s % ('foo', C())

os.execv Overhead

2009-09-16 Thread mark.mcdow...@gmail.com
I have a script that automates running a program X times by preparing the required files and passing the external program right variables. What I am unsure about though is the overhead of: program = externalScript variables = [-i, var1] pid = os.fork() if not

Changing IP's and Connecting to a site

2009-09-16 Thread aditya shukla
Hello Guys' I have a script which i am using to do interaction with a website.Is there a way by which i can connect to the site through different ip's .Say use a proxy or something. Thanks Aditya -- http://mail.python.org/mailman/listinfo/python-list

Re: recommendation for webapp testing?

2009-09-16 Thread Michele Simionato
On Sep 16, 7:00 am, Schif Schaf schifsc...@gmail.com wrote: 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

Re: can python make web applications?

2009-09-16 Thread lkcl
On Aug 23, 3:12 pm, Deep_Feelings doctore...@gmail.com wrote: can python make powerfull database web applications that can replace desktop database applications? e.g: entrprise accounting programs,enterprise human resource management programs ...etc with pyjamas, as mark mentioned previously

Re: os.execv Overhead

2009-09-16 Thread Jim Wilson
On 09/16/2009 11:12 AM, mark.mcdow...@gmail.com wondered about: overhead of [fork/exec]: An alternative might be os.spawn?(), etal. It might run a tiny bit faster because it combines the two operations, but I think you're pretty close to the metal. Jim --

Re: recommendation for webapp testing?

2009-09-16 Thread corey goldberg
I need to do some basic website testing http://seleniumhq.org/ Selenium is a suite of tools to automate web app testing across many platforms. Have a look at Selenium. Specifically, look at Selenium RC. You can write code in Python to drive a web browser and run web tests. -Corey --

Re: python 3.1 unicode question

2009-09-16 Thread Duncan Booth
jeffunit j...@jeffunit.com wrote: That looks like a surrogate escape (See PEP 383) http://www.python.org/dev/peps/pep-0383/. It indicates the wrong encoding was used to decode the filename. That seems likely. How do I set the encoding to something correct to decode the filename?

Non-deprecated equivalent of rfc822.AddressList

2009-09-16 Thread Jason Tackaberry
Hi, Since the rfc822 module was removed in Python 3, and is deprecated in 2.3, I am obviously trying to avoid using it. But I'm having a hard time finding an equivalent to rfc822.AddressList in the email module, which I want to use to parse a _list_ of addresses: addrlist = 'John Doe

Re: can python make web applications?

2009-09-16 Thread Paul Boddie
On 16 Sep, 18:31, lkcl luke.leigh...@googlemail.com wrote: http://pyjs.org/examples/timesheet/output/TimeSheet.html I get this error dialogue message when visiting the above page: TimeSheet undefined list assignment index out of range Along with the following in-page error, once the data has

Re: Looking for a pure Python chart drawing module

2009-09-16 Thread Michel Claveau - MVP
Hi! Tkinter is part of the Python standard library Yes. But... tkinter is a wrapper to tcl/tk, who is written in tcl. Ok, tcl is given with Python (standard library). Therefore, you sentence: 'Are you really ruling out its use for a pure Python solution?' Is well done... ;-) Michel Claveau

(A Possible Solution) Re: preferred way to set encoding for print

2009-09-16 Thread ~flow
On Sep 16, 7:16 am, Mark Tolonen metolone+gm...@gmail.com wrote: Setting PYTHONIOENCODING overrides the encoding used for stdin/stdout/stderr (See the Python help for details), but if your terminal doesn't support the encoding that won't help. thx for these two tips. of course, that was a bit

Re: Python and 3d

2009-09-16 Thread mbaas
On 13 Sep., 13:29, azrael jura.gro...@gmail.com wrote: Has anyone any exipience with python and 3d. I mean, is there a module to deal with popular 3d formats like 3ds, or vrml. is it possible to import into python opengl models and then use it in application for GUI purposes like through WX.

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

2009-09-16 Thread Irmen de Jong
Tim Roberts wrote: Wes McKinney wesmck...@gmail.com 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

Re: Looking for a pure Python chart drawing module

2009-09-16 Thread John Nagle
John Nagle wrote: Ethan Furman wrote: John Nagle wrote: http://home.gna.org/pychart/doc/introduction.html Tried PyChart. ... PyChart generates SVG reasonably well, and needs no external programs when generating SVG. But there's something broken related to font sizes. Larger values

Re: Looking for a pure Python chart drawing module

2009-09-16 Thread Grant Edwards
On 2009-09-16, Alan G Isaac alan.is...@gmail.com wrote: Tkinter is part of the Python standard library: That doesn't mean you can depend on it being available. It doesn't get installed by default on some Linux distros. -- Grant Edwards grante Yow! Wait ... is

Re: python decimals

2009-09-16 Thread Andrew Svetlov
Decimal has good enough API and we need to follow it as lot of our code already operates with Decimal. Maybe with different Context and exception types and limited subset of operations - but switching should be not very hard. Decimal arithmetic is good for as. We need to support several types like

Collection console output

2009-09-16 Thread Esben von Buchwald
Hello Are there any simple ways to collect the data, python prints to the console when running an app? I'm doing som apps for S60 mobile phones and can't see the console, when the UI is running, but i'd like to collect the output, to look for eventual exceptions etc. Cant it be redirected

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

2009-09-16 Thread Wes McKinney
On Sep 16, 3:53 pm, Irmen de Jong irmen.nos...@xs4all.nl wrote: Tim Roberts wrote: Wes McKinney wesmck...@gmail.com 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).

Re: Collection console output

2009-09-16 Thread MRAB
Esben von Buchwald wrote: Hello Are there any simple ways to collect the data, python prints to the console when running an app? I'm doing som apps for S60 mobile phones and can't see the console, when the UI is running, but i'd like to collect the output, to look for eventual exceptions

Debugging with gdb: pystack macro for gdb to show python stack trace

2009-09-16 Thread Timothy Madden
Hello I have an application with several threads that sometimes just freezes. I installed the debug symbols for python interpreter, and the gdb macros, as instructed on the wiki http://wiki.python.org/moin/DebuggingWithGdb so I can debug with gdb. gdb loads many files with python

Re: subprocess + python-daemon - bug/problem?

2009-09-16 Thread Joel Martin
On Sep 8, 5:19 pm, Ben Finney ben+pyt...@benfinney.id.au wrote: Sewar xsew...@gmail.com writes: I looked at other daemon libraries and snippets, it's clearly the bug is in subprocess not python-daemon. Then I found Python bug #1731717 which discusses it. I'm running python-2.6.2 which

Noob Q: subclassing or wrapping file class

2009-09-16 Thread kj
I'm trying to get the hang of Python's OO model, so I set up this conceptually simple problem of creating a new file-like class to read a certain type of file. The data in this type of file consists of multiline chunks separated by lines consisting of a single .. My first crack at it looks

Re: preferred way to set encoding for print

2009-09-16 Thread Terry Reedy
Mark Tolonen wrote: ('utf-8')`, but that has no effect in py3.0.1. also, i cannot set Even if not relevant to your immediate problem, if you can, upgrade to 3.1, with its many important bug fixes. -- http://mail.python.org/mailman/listinfo/python-list

Re: Noob Q: subclassing or wrapping file class

2009-09-16 Thread Steven D'Aprano
On Wed, 16 Sep 2009 21:56:09 +, kj wrote: ... I thought at first that I could achieve this by overriding __getattr__: def __getattr__(self, attribute): return self.fh.__getattr__(attribute) But to my surprise this did not work too well. For example, if I use a GzipFile

Re: Noob Q: subclassing or wrapping file class

2009-09-16 Thread kj
In pan.2009.09.16.22.09...@remove.this.cybersource.com.au Steven D'Aprano ste...@remove.this.cybersource.com.au writes: On Wed, 16 Sep 2009 21:56:09 +, kj wrote: ... I thought at first that I could achieve this by overriding __getattr__: def __getattr__(self, attribute):

Re: subprocess + python-daemon - bug/problem?

2009-09-16 Thread Ben Finney
Joel Martin nos...@martintribe.org writes: I'm running python-2.6.2 which supposedly has the fix for #1731717. However I still still the problem with subprocess after daemonizing. I've narrowed it down to just the setting of the SIGCLD signal. You can reproduce the problem thus (in 2.4.6,

PyQt QCompleter model

2009-09-16 Thread nusch
The following code: strings=[asdad, baasd, casd, caxd] completer = QCompleter(strings) model = completer.model() print model.rowCount() model.stringList().append(test) print model.rowCount() prints 4 before and after appending test to stringList. What should I do to let the model know about

Passing Variables WITHOUT Dynamic URLs

2009-09-16 Thread Victor Subervi
Hi; Search engines don't like dynamic links. I like to pass at least browser information from page to page to make pages display properly. Spiders couldn't care less about asthetics, so that wouldn't matter to them. But passing something like *.com?browser=IE5 trips the spider up. Is there a way

Re: Passing Variables WITHOUT Dynamic URLs

2009-09-16 Thread Rami Chowdhury
I like to pass at least browser information from page to page to make pages display properly. What kind of web framework are you using? Most allow you to access the HTTP headers sent with a request -- in this case, what you'd be after is the 'User-Agent' header. On Wed, 16 Sep 2009

Re: Why use locals()

2009-09-16 Thread Terry Reedy
Sion Arrowsmith wrote: Gabriel Genellina gagsl-...@yahoo.com.ar wrote: s...@viridian.paintbox escribi�: 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(...)

Re: Class variable inheritance

2009-09-16 Thread Terry Reedy
Duncan Booth wrote: Lie Ryan lie.1...@gmail.com wrote: Terry Reedy wrote: 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'

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

2009-09-16 Thread Ben Finney
P.J. Eby p...@telecommunity.com writes: http://docs.python.org/distutils/apiref.html#module-distutils.core - specifically the run_setup() function. (It appears the docs do not have link anchors for individual functions, alas.)

How do I begin debugging a python memory leak?

2009-09-16 Thread Matthew Wilson
I have a web app based on TurboGears 1.0. In the last few days, as traffic and usage has picked up, I noticed that the app went from using 4% of my total memory all the way up to 50%. I suspect I'm loading data from the database and somehow preventing garbage collection. Are there any tools

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

2009-09-16 Thread Terry Reedy
Jason wrote: 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 gagsl-...@yahoo.com.ar

Re: How do I begin debugging a python memory leak?

2009-09-16 Thread Diez B. Roggisch
Matthew Wilson schrieb: I have a web app based on TurboGears 1.0. In the last few days, as traffic and usage has picked up, I noticed that the app went from using 4% of my total memory all the way up to 50%. I suspect I'm loading data from the database and somehow preventing garbage

Re: PyQt QCompleter model

2009-09-16 Thread David Boddie
On Thursday 17 September 2009 01:14, nusch wrote: The following code: strings=[asdad, baasd, casd, caxd] completer = QCompleter(strings) model = completer.model() print model.rowCount() model.stringList().append(test) This may not work as you expect. Although it may actually modify the

checking cell phone minute usage?

2009-09-16 Thread Esmail
Hi, I'm wondering if anyone has written a Python program (or has ideas about how to go about it) that checks your current cell phone minute usage? For verizon I can either log on to a MyVerizon web page (I am not aware of an API for it) or I can text #min from my phone. I don't really care

Re: How do I begin debugging a python memory leak?

2009-09-16 Thread Andrew Svetlov
guppy-pe On Sep 16, 8:10 pm, Matthew Wilson m...@tplus1.com wrote: I have a web app based on TurboGears 1.0.  In the last few days, as traffic and usage has picked up, I noticed that the app went from using 4% of my total memory all the way up to 50%. I suspect I'm loading data from the

Re: Noob Q: subclassing or wrapping file class

2009-09-16 Thread Terry Reedy
kj wrote: I'm trying to get the hang of Python's OO model, so I set up this conceptually simple problem of creating a new file-like class to read a certain type of file. The data in this type of file consists of multiline chunks separated by lines consisting of a single .. My first crack at

Re: recommendation for webapp testing?

2009-09-16 Thread Schif Schaf
On Sep 16, 8:55 am, Simon Brunning si...@brunningonline.net wrote: 2009/9/16 Schif Schaf schifsc...@gmail.com: 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

Re: overrideredirect vs. text entry etc. widget

2009-09-16 Thread kernus
I did, no luck. but I will keep trying..., :P I will let you know if some trick works. Sean DiZazzo wrote: On Sep 15, 10:20 pm, kernus ker...@gmail.com wrote: On Sep 15, 11:42 am, Sean DiZazzo half.ital...@gmail.com wrote: Whats interesting is that if you call overrideredirect from

Re: recommendation for webapp testing?

2009-09-16 Thread Schif Schaf
On Sep 16, 12:19 pm, Michele Simionato michele.simion...@gmail.com wrote: twill is still good. Well, this http://twill.idyll.org/ seems to be the twill website, but it looks pretty out of date. I also found this http://code.google.com/p/twill/ , which is somewhat newer. No activity in the last

Re: recommendation for webapp testing?

2009-09-16 Thread Schif Schaf
After some more searching I found Mechanize (a Python version of Perl's WWW::Mechanize): http://wwwsearch.sourceforge.net/mechanize/ Anyone here tried it? -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess + python-daemon - bug/problem?

2009-09-16 Thread Ben Finney
Ben Finney ben+pyt...@benfinney.id.au writes: I'm not familiar enough with the nuances of the ‘subprocess’ module to know what might be going wrong here. I'd like to know whether it might be a problem in the ‘python-daemon’ library. My test case for this is now:: = #! /usr/bin/python

Re: Noob Q: subclassing or wrapping file class

2009-09-16 Thread Steven D'Aprano
On Wed, 16 Sep 2009 23:06:18 +, kj wrote: Instead of: x.__getattr__('name') write this: getattr(x, 'name') This did the trick. For the record, it's fairly unusual to call double-underscore special methods directly. Any time you think you need to, it's worth a rethink. --

Shebang line problems and python

2009-09-16 Thread Blaine
Hello, Scripts that have #!/usr/bin/python at the top do not parse correctly. Bash treats scripts with that shebang as if they are bash scripts. E.g.: bla...@attila ~/apps/rs-mu $ /usr/sbin/env-update /usr/sbin/env-update: line 6: import: command not found /usr/sbin/env-update: line 8: syntax

Re: Shebang line problems and python

2009-09-16 Thread Chris Rebert
On Wed, Sep 16, 2009 at 8:25 PM, Blaine brlafreni...@gmail.com wrote: Hello, Scripts that have #!/usr/bin/python at the top do not parse correctly. Bash treats scripts with that shebang as if they are bash scripts. E.g.: bla...@attila ~/apps/rs-mu $ /usr/sbin/env-update

Re: Shebang line problems and python

2009-09-16 Thread Rami Chowdhury
Is it possible that python is installed not in /usr/bin but in, say, / usr/local/bin? I'd suggest you try 'which python' to find out where it is. On my OS X, for instance: $ which python /Library/Frameworks/Python.framework/Versions/Current/bin/python - Rami Chowdhury Never

Re: Shebang line problems and python

2009-09-16 Thread Ben Finney
Blaine brlafreni...@gmail.com writes: Scripts that have #!/usr/bin/python at the top do not parse correctly. Bash treats scripts with that shebang as if they are bash scripts. When you run a file as a command, it's not Bash that decides how to run it; the kernel has the job of understanding

Are min() and max() thread-safe?

2009-09-16 Thread Steven D'Aprano
I have two threads, one running min() and the other running max() over the same list. I'm getting some mysterious results which I'm having trouble debugging. Are min() and max() thread-safe, or am I doing something fundamentally silly by having them walk over the same list simultaneously? My

Re: Shebang line problems and python

2009-09-16 Thread Blaine
Chris Rebert, Rami Chowdhury: bla...@attila ~/tmp $ which python /usr/bin/python Ben Finney: bla...@attila ~/tmp $ echo $SHELL /bin/bash bla...@attila ~/tmp $ cat ./shebang-test #!/usr/bin/python import sys sys.stdout.write(Hello, world.\n) bla...@attila ~/tmp $ ./shebang-test ./shebang-test:

Re: Are min() and max() thread-safe?

2009-09-16 Thread Steven D'Aprano
On Thu, 17 Sep 2009 04:33:05 +, Steven D'Aprano wrote: I have two threads, one running min() and the other running max() over the same list. I'm getting some mysterious results which I'm having trouble debugging. Are min() and max() thread-safe, or am I doing something fundamentally silly

Re: Shebang line problems and python

2009-09-16 Thread Steven D'Aprano
On Wed, 16 Sep 2009 21:35:21 -0700, Blaine wrote: bla...@attila ~/tmp $ cat ./shebang-test #!/usr/bin/python import sys sys.stdout.write(Hello, world.\n) bla...@attila ~/tmp $ ./shebang-test ./shebang-test: line 2: import: command not found ./shebang-test: line 3: syntax error near

Re: (A Possible Solution) Re: preferred way to set encoding for print

2009-09-16 Thread Mark Tolonen
~flow wolfgang.l...@gmail.com wrote in message news:643ca91c-b81c-483c-a8af-65c93b593...@r33g2000vbp.googlegroups.com... On Sep 16, 7:16 am, Mark Tolonen metolone+gm...@gmail.com wrote: Setting PYTHONIOENCODING overrides the encoding used for stdin/stdout/stderr (See the Python help for

Re: Shebang line problems and python

2009-09-16 Thread km
assuming that ur on linux/unix and assuming that u have shebang line as #!/usr/bin/python in ur script set permissions like this chmod 755 myscript.py and then run the script as ./myscripy.py OR simply run the python script as python myscript.py at the shell prompt (note that this doesnt need

Re: Are min() and max() thread-safe?

2009-09-16 Thread Miles Kaufmann
On Sep 16, 2009, at 9:33 PM, Steven D'Aprano wrote: I have two threads, one running min() and the other running max() over the same list. I'm getting some mysterious results which I'm having trouble debugging. Are min() and max() thread-safe, or am I doing something fundamentally silly by having

Re: Are min() and max() thread-safe?

2009-09-16 Thread Dj Gilcrease
I dont see anything wrong with it and it works for me on a sequence of 5000 -- http://mail.python.org/mailman/listinfo/python-list

Re: (A Possible Solution) Re: preferred way to set encoding for print

2009-09-16 Thread Miles Kaufmann
On Sep 16, 2009, at 12:39 PM, ~flow wrote: so: how can i tell python, in a configuration or using a setting in sitecustomize.py, or similar, to use utf-8 as a default encoding? [snip Stdout_writer_with_ncrs solution] This should work: sys.stdout = io.TextIOWrapper(sys.stdout.buffer,

Re: weird str error

2009-09-16 Thread daved170
On Sep 15, 6:29 pm, Peter Otten __pete...@web.de wrote: daved170 wrote: Hi everybody, I'm using SPE 0.8.3.c as my python editor. I'm using thestr() function and i got a very odd error. I'm trying to do this: printstr(HI) When i'm writing this line in the shell it prints: HI When it's

Re: Are min() and max() thread-safe?

2009-09-16 Thread Steven D'Aprano
On Wed, 16 Sep 2009 22:08:40 -0700, Miles Kaufmann wrote: On Sep 16, 2009, at 9:33 PM, Steven D'Aprano wrote: I have two threads, one running min() and the other running max() over the same list. I'm getting some mysterious results which I'm having trouble debugging. Are min() and max()

Re: Are min() and max() thread-safe?

2009-09-16 Thread Niklas Norrthon
On 17 Sep, 06:33, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: I have two threads, one running min() and the other running max() over the same list. I'm getting some mysterious results which I'm having trouble debugging. Are min() and max() thread-safe, or am I doing something

Re: Shebang line problems and python

2009-09-16 Thread Blaine
On Sep 16, 10:46 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Wed, 16 Sep 2009 21:35:21 -0700, Blaine wrote: bla...@attila ~/tmp $ cat ./shebang-test #!/usr/bin/python import sys sys.stdout.write(Hello, world.\n) bla...@attila ~/tmp $ ./shebang-test

[issue6879] misstatement in example explanation using raise

2009-09-16 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Yes, that seems a good idea. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6879 ___ ___

[issue6919] Link CRT Statically

2009-09-16 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: This can't possibly work. Extension modules that also link with the CRT will thus end with a separate copy of the CRT global state, causing crashes. -- nosy: +loewis ___ Python tracker

[issue6412] Titlecase as defined in Unicode Case Mappings not followed

2009-09-16 Thread Gabriel Genellina
Changes by Gabriel Genellina gagsl-...@yahoo.com.ar: -- nosy: +gagenellina ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6412 ___ ___

[issue6906] Tkinter sets an unicode environment variable on win32

2009-09-16 Thread Gabriel Genellina
Gabriel Genellina gagsl-...@yahoo.com.ar added the comment: I cannot reproduce it with the python.org version: Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. py import Tkinter py import os py

[issue6920] IDLE 3 crashes on Ctrl+Space with 'utf8' codec can't decode bytes in position 0-1

2009-09-16 Thread Yinon Ehrlich
New submission from Yinon Ehrlich yino...@users.sourceforge.net: on Ubuntu 8.04 - I downloaded the sources, then: ./configure --prefix=$HOME make make install in ~/bin/idle3 when I press Ctrl+Space (according to the Edit menu, should show completions) idle crashes with the following

[issue6895] locale._parse_localename fails when localename does not contain encoding information

2009-09-16 Thread Gabriel Genellina
Gabriel Genellina gagsl-...@yahoo.com.ar added the comment: If you provide a test case the patch has a greater chance of being accepted. -- nosy: +gagenellina ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6895

[issue6880] class needs forward reference

2009-09-16 Thread Gabriel Genellina
Changes by Gabriel Genellina gagsl-...@yahoo.com.ar: -- nosy: +gagenellina ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6880 ___ ___

[issue6880] class needs forward reference

2009-09-16 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Thanks, added a reference in r74818. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6880 ___

  1   2   >