Purpose of delayload in cookielib.FileCookieJar?

2007-07-09 Thread [EMAIL PROTECTED]
What is the reason for delayload=False in the FileCookieJar.__init__ function? It doesn't seem to be used in any of the code that ships with python2.4, and it seems to directly contradict the comment following it """ Cookies are NOT loaded from the named file until either the .loa

Passing a CookieJar instead of a cookieproc to urllib2.build_opener

2007-07-09 Thread [EMAIL PROTECTED]
urllib2.build_opener happily accepts and ignores a FileCookieJar.I had a bug in my code which looked like urllib2.build_opener(func_returning_cookie_jar()) which should have been urllib2.build_opener(HTTPCookieProcessor(func_returning_cookie_jar()) The problem is that the code ran happily w

Re: 2**2**2**2**2 wrong? Bug?

2007-07-09 Thread [EMAIL PROTECTED]
On Jul 9, 11:42?pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Jul 9, 11:21 pm, "Jim Langston" <[EMAIL PROTECTED]> wrote:> In Python 2.5 > on intel, the statement > > 2**2**2**2

Re: trouble controlling vim with subprocess on windows machine

2007-07-10 Thread [EMAIL PROTECTED]
On Jul 10, 4:00 am, agc <[EMAIL PROTECTED]> wrote: > Hi Josiah, > > > >> This recipe for asynchronous communication usingsubprocesscould be > > >> used to write an expect-like tool: > > >>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/44

serializing datetime object

2007-07-10 Thread [EMAIL PROTECTED]
Hi I want to serialize datetime.datetime.now() object . I could convert it to string but how do I get a datetime object back from the string? Any suggestions? thanks mark -- http://mail.python.org/mailman/listinfo/python-list

REALLY!

2007-07-10 Thread [EMAIL PROTECTED]
Is this for reals man! I hope this is not one of those rip-off emails. -- http://mail.python.org/mailman/listinfo/python-list

Re: trouble controlling vim with subprocess on windows machine

2007-07-10 Thread [EMAIL PROTECTED]
On Jul 10, 10:38 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Jul 10, 4:00 am, agc <[EMAIL PROTECTED]> wrote: > > > > > > > Hi Josiah, > > > > >> This recipe for asynchronous communication usingsubprocesscould

Re: Passing a CookieJar instead of a cookieproc to urllib2.build_opener

2007-07-11 Thread [EMAIL PROTECTED]
On Jul 10, 11:10 pm, [EMAIL PROTECTED] (John J. Lee) wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > urllib2.build_opener happily accepts and ignores a FileCookieJar.I > > had a bug in my code which looked like > > > urllib2.build_opener(

Re: binascii.unhexlify ... not clear about usage, and output

2007-07-11 Thread [EMAIL PROTECTED]
On Jul 11, 3:21 am, Vishal <[EMAIL PROTECTED]> wrote: > On May 30, 1:31 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > > > > > > > Vishal wrote: > > > I have a file with a long list of hex characters, and I want to get a > > > file with cor

Re: lists and dictionaries

2007-07-11 Thread [EMAIL PROTECTED]
On Jul 11, 12:08 pm, Ladislav Andel <[EMAIL PROTECTED]> wrote: > Hi, > I have a list of dictionaries. > e.g. > [{'index': 0, 'transport': 'udp', 'service_domain': 'dp0.example.com'}, > {'index': 1, 'tra

Re: binascii.unhexlify ... not clear about usage, and output

2007-07-11 Thread [EMAIL PROTECTED]
On Jul 11, 1:38 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Wed, 11 Jul 2007 10:46:23 -0700, [EMAIL PROTECTED] wrote: > > You can with gmpy: > > >>>> import gmpy > >>>> x = 0x0164 > >>>> s = gmpy.digits(x

atexit, sys.exit, sys.exitfunc, reaching end of source code

2007-07-11 Thread [EMAIL PROTECTED]
Hi, I am playing with the atexit module but I don't find a way to see the difference between a script calling sys.exit() and the interpreting arriving at the end of the source code file. This has a semantic difference for my applications. Is there a way to determine in an exithandler (that is regi

Re: Phoenix-iTorrent: iTunes Bit Torrent client v 0.3 release

2007-07-11 Thread [EMAIL PROTECTED]
On Jul 10, 1:50 pm, "Danyelle Gragsone" <[EMAIL PROTECTED]> wrote: > How is this related to python? Hi Danyelle, Phoenix-iTorrent, as well as its Bit Torrent underpinnings, is written completely in python. Both projects use py2exe and py2app to create native binaries for the

Re: highly einteractive editor for python

2007-07-11 Thread [EMAIL PROTECTED]
On Jul 9, 5:14 pm, "Atul Bhingarde" <[EMAIL PROTECTED]> wrote: > Does anybody know an editor that facilitates, interactive python > development. Where GUI etc developed will be possible to see in real time > mode. > > Thanks > > Atul Have a look at UliPa

Re: Where does str class represent its data?

2007-07-11 Thread [EMAIL PROTECTED]
On Jul 11, 4:21 pm, [EMAIL PROTECTED] wrote: > I'd like to implement a subclass of string that works like this: > > >>>m = MyString('mail') > >>>m == 'fail' > True > >>>m == 'mail' > False > >>>m in

Re: Where does str class represent its data?

2007-07-11 Thread [EMAIL PROTECTED]
On Jul 11, 8:20 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Jul 11, 4:21 pm, [EMAIL PROTECTED] wrote: > > > > > I'd like to implement a subclass of string that works like this: > > > >>>m = MyString('mail') > >

Re: atexit, sys.exit, sys.exitfunc, reaching end of source code

2007-07-12 Thread [EMAIL PROTECTED]
On 12 jul, 01:32, Wojciech Mu a <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I am playing with theatexitmodule but I don't find a way to see the > > difference > > between a script calling sys.exit() and the interpreting > > arriving at the end &

Re: profiling a C++ python extension

2007-07-12 Thread [EMAIL PROTECTED]
Hi! It doesn't suffice to compile the python interpreter with -pg, as the module is loaded via dlopen. I solved the problem for my case compiling an executable with embedded python and the module itself. I would wish, that there would be an easier way. Best regards, Michael -- http://mail.python.

Re: Fastest way to convert a byte of integer into a list

2007-07-13 Thread [EMAIL PROTECTED]
On Jul 13, 5:17 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Jul 12, 5:34 pm, Godzilla <[EMAIL PROTECTED]> wrote: > > > Hello, > > > I'm trying to find a way to convert an integer (8-bits long for > > starters) and converting them to a list, e.g.: &g

Re: 2**2**2**2**2 wrong? Bug?

2007-07-13 Thread [EMAIL PROTECTED]
On Jul 13, 1:20 pm, Wayne Brehaut <[EMAIL PROTECTED]> wrote: > On Mon, 09 Jul 2007 23:51:25 -0700, "[EMAIL PROTECTED]" > > > > > > <[EMAIL PROTECTED]> wrote: > >On Jul 9, 11:42?pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > >> On Jul 9

Re: 2**2**2**2**2 wrong? Bug?

2007-07-13 Thread [EMAIL PROTECTED]
On Jul 13, 2:52 pm, Wayne Brehaut <[EMAIL PROTECTED]> wrote: > On Fri, 13 Jul 2007 11:30:16 -0700, Paul McGuire <[EMAIL PROTECTED]> > wrote: > > > > > > >On Jul 13, 1:20 pm, Wayne Brehaut <[EMAIL PROTECTED]> wrote: > >> On Mon, 09 Jul 2

Re: Python Subprocess module

2007-07-13 Thread [EMAIL PROTECTED]
On Jul 13, 4:15 pm, Dave Sampson <[EMAIL PROTECTED]> wrote: > hey folks, > > A simple question hopefully. despite all my searching I have not found a > satisfactory response. > > The goal. Interact with a command line program. Simple enough, but the > key is INTERACT

Re: Right tool and method to strip off html files (python, sed, awk?)

2007-07-13 Thread [EMAIL PROTECTED]
On Jul 13, 1:57 pm, [EMAIL PROTECTED] wrote: > Hi, > > I'm in the process of refactoring a lot of HTML documents and I'm > using html tidy to do a part of this > work. (clean up, change to xhtml and remove font and center tags) > > Now, Tidy will just do a part of

Re: Right tool and method to strip off html files (python, sed, awk?)

2007-07-13 Thread [EMAIL PROTECTED]
On Jul 13, 7:07 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Jul 13, 1:57 pm, [EMAIL PROTECTED] wrote: > > > > > > > Hi, > > > I'm in the process of refactoring a lot of HTML documents and I'm > > using html tidy to do a

Re: Fastest way to convert a byte of integer into a list

2007-07-14 Thread [EMAIL PROTECTED]
On Jul 14, 5:49?pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Jul 13, 3:46 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > > > > On Jul 13, 5:17 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > > > > On Jul 12, 5:34 pm, Go

Re: questions about functions inside a function

2007-07-16 Thread [EMAIL PROTECTED]
Hi, Duncan Booth wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > >> What I want is, the value of i should be bounded to the anonymous >> function. And the output should like this: >> >> for f in a: >> print f() >> 0 >>

Re: questions about functions inside a function

2007-07-16 Thread [EMAIL PROTECTED]
On Jul 16, 4:49 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: (snipped) > > What I want is, the value of i should be bounded to the anonymous function. > And the output should like this: > > for f in a: > print f() > 0 > 1 > 4 > 9 >

Re: questions about functions inside a function

2007-07-16 Thread [EMAIL PROTECTED]
Duncan Booth wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > >> In order to make sure all variables be larger than 0, I tried to created >> constraint function like this: >> >> cons = [] >> for i in range(N): >> c = la

questions about functions inside a function

2007-07-16 Thread [EMAIL PROTECTED]
I want to create a list of function. Here is my code: In [9]: a = [] In [10]: for i in range(4): : b = lambda : i**2 : a.append(b) : : In [11]: for f in a: : f() : : 9 9 9 9 What I want is, the value of i should be bounded to t

Re: Can a low-level programmer learn OOP?

2007-07-16 Thread [EMAIL PROTECTED]
You are lucky.Our project is a cross-platform cluster computer managment system this system can run on both windows and Linux http://pluster.gf.cs.hit.edu.cn/ I tell you how we solve this problems > > 1. How to most easily learn to write simple PC GUI programs that will > send data to remote embed

Break up list into groups

2007-07-16 Thread [EMAIL PROTECTED]
All, I can't seem to find an answer to this question anywhere, but I'm still looking. My problem is I have a list of values like this: l = [0xF0, 1, 2, 3, 0xF0, 4, 5, 6, 0xF1, 7, 8, 0xF2, 9, 10, 11, 12, 13, 0xF0, 14, 0xF1, 15] A value with bit 0x80 set delineates the start of a new packet of inf

Re: Break up list into groups

2007-07-16 Thread [EMAIL PROTECTED]
On Jul 16, 3:56 pm, marduk <[EMAIL PROTECTED]> wrote: > On Mon, 2007-07-16 at 16:31 -0500, marduk wrote: > > Assuming you meant '0xF0' instead of '0x80' do you mean any value > > >=240 starts a new group? If so: No, I meant 0x80. 0x80 is only the m

Re: Break up list into groups

2007-07-16 Thread [EMAIL PROTECTED]
> Here's an ugly way I wouldn't recommended (using itertools groupby): > > py> from itertools import groupby > py> alist = [0xF0, 1, 2, 3, 0xF0, 4, 5, 6, > ... 0xF1, 7, 8, 0xF2, 9, 10, 11, 12, 13, > ... 0xF0, 14, 0xF1, 15] > py> def doit(alist): > ... i = (list(g) for k,g in gro

Re: 2**2**2**2**2 wrong? Bug?

2007-07-16 Thread [EMAIL PROTECTED]
On Jul 15, 4:28 pm, Wayne Brehaut <[EMAIL PROTECTED]> wrote: > On Fri, 13 Jul 2007 14:32:03 -0700, "[EMAIL PROTECTED]" > <[EMAIL PROTECTED]> wrote: > >On Jul 13, 2:52 pm, Wayne Brehaut <[EMAIL PROTECTED]> wrote: > >> On Fri, 13 Jul 2007 11:30:16 -

Re: 2**2**2**2**2 wrong? Bug?

2007-07-16 Thread [EMAIL PROTECTED]
On Jul 15, 4:37 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Wayne Brehaut wrote: > > On Fri, 13 Jul 2007 14:32:03 -0700, "[EMAIL PROTECTED]" > [...] > > But I digress (but only because provoked!)... > > >>> [for purposes of this argument, at least

Re: trouble controlling vim with subprocess on windows machine

2007-07-16 Thread [EMAIL PROTECTED]
On Jul 16, 7:45 am, Yves Pouplard <[EMAIL PROTECTED]> wrote: > On Mon, 09 Jul 2007 05:30:04 -0500, Nick Craig-Wood > > <[EMAIL PROTECTED]> wrote: > >[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >> I am having trouble contolling vim with subproce

Re: In a dynamic language, why % operator asks user for type info?

2007-07-16 Thread [EMAIL PROTECTED]
On Jul 16, 7:10 pm, Karthik Gurusamy <[EMAIL PROTECTED]> wrote: > Hi, > > The string format operator, %, provides a functionality similar to the > snprintf function in C. In C, the function does not know the type of > each of the argument and hence relies on the embedded %

Re: a=0100; print a ; 64 how to reverse this?

2007-07-17 Thread [EMAIL PROTECTED]
On Jul 17, 7:40 am, mosi <[EMAIL PROTECTED]> wrote: > Thank you, > this is great, > I thought that this should be standard in python 2.4 or 2.5 or in some > standard library (math ???) > Didn`t find anything. You can also look up the gmpy module (not part of standard library

Re: really small values

2007-07-18 Thread [EMAIL PROTECTED]
On Jul 17, 4:13?pm, "Dee Asbury" <[EMAIL PROTECTED]> wrote: > In multiplying a value of xe^-325 with ye^-4, Python is returning zero. How > do I get it to give me back my tiny value? Use the right tool for the right job. >>> import gmpy >>> help(gmpy.mpf)

Re: Embedding/Extending Python in/with C++: non-static members?

2007-07-18 Thread [EMAIL PROTECTED]
On Jul 17, 12:24 pm, dmoore <[EMAIL PROTECTED]> wrote: > (I thought I'd follow up on this post so as not to send unsuspecting > readers down a hopeless path) > > duh! > > I've obviously spent too much time with dynamic languages. The problem > with what I&

UDP broadcast over a specific interface

2007-07-19 Thread [EMAIL PROTECTED]
I am trying to send UDP broadcast packets over a specific interface and I am having trouble specifying the interface: host='192.168.28.255' sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.bind(('',0)) sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) sock.setsockopt(socket.IP

Re: Embedding/Extending Python in/with C++: non-static members?

2007-07-19 Thread [EMAIL PROTECTED]
On Jul 16, 9:45 am, dmoore <[EMAIL PROTECTED]> wrote: > Hi Folks: > > I have a question about the use of static members in Python/C > extensions. Take the simple example from the "Extending and Embedding > the Python Interpreter" docs: > > A simp

Re: UDP broadcast over a specific interface

2007-07-19 Thread [EMAIL PROTECTED]
On Jul 19, 7:09 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Thu, 19 Jul 2007 12:32:02 -, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > >I am trying to send UDP broadcast packets over a specific interface > >and I > >am havi

Re: really small values

2007-07-19 Thread [EMAIL PROTECTED]
On Jul 19, 5:11?pm, Zentrader <[EMAIL PROTECTED]> wrote: > On Jul 17, 2:13 pm, "Dee Asbury" <[EMAIL PROTECTED]> wrote: > > > In multiplying a value of xe^-325 with ye^-4, Python is returning zero. How > > do I get it to give me back my tiny value? > >

Re: class C: vs class C(object):

2007-07-20 Thread [EMAIL PROTECTED]
Aahz wrote: > In article <[EMAIL PROTECTED]>, > James Stroud <[EMAIL PROTECTED]> wrote: > >Aahz wrote: > >> In article <[EMAIL PROTECTED]>, > >> Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >>> > >>>It isn't

Re: Using eggs or py2exe to distribute apps

2007-07-20 Thread [EMAIL PROTECTED]
On Jul 20, 5:39 am, Marcus <[EMAIL PROTECTED]> wrote: > Hi, > > I'm to the stage where I need to deploy the app I built with wxPython. > I've been able to successfully build it w/py2exe into a binary (about > 10MB size in total). > > What I'd like to do

Re: converting 64-bit fixed-point to float

2007-07-21 Thread [EMAIL PROTECTED]
On Jul 20, 5:59 pm, [EMAIL PROTECTED] (John Fisher) wrote: > Hi Group, > > troubles with converting signed 32.32, little-endian, 2's complement > back to floating point. I have been trying to brew it myself. I am > running Python 2.5 on a Mac. Here is the C-code I have been

Re: Future Python Gui?

2007-04-18 Thread [EMAIL PROTECTED]
> On Windows, the easiest way to install Tile is to grab it from > ActiveState's Tcl distribution > (http://www.activestate.com/products/activetcl/) and then place it with > the Tcl/Tk bits that come with Python. The Tcl/Tk build for Windows that > python.org provides doesn't ship with Tile. You'l

Re: Future Python Gui?

2007-04-18 Thread [EMAIL PROTECTED]
> "Tile" has already been mentioned in this thread, and I know > there'll be at least one more follow-up on the subject. Tile > includes a ("native"!) notebook, as well as a combobox, tree- > view, ... http://wiki.tcl.tk/11075>. It seems that Tile does include a "notebook" widget but it's pure Tc

Re: Future Python Gui?

2007-04-18 Thread [EMAIL PROTECTED]
> As I've said often enough on the topic of Web frameworks, picking > winners gives only a temporary victory to those who want to avoid > making decisions. It's better to provide people with a means of making > an informed choice, and it should be realised that people will > approach this choice fr

Re: Future Python Gui?

2007-04-18 Thread [EMAIL PROTECTED]
> The wrapper I maintain works differently, and includes the notebook widget. I've seen the page. You can get to it via Google's cache; just put the url in the box and the one search result returned usually has a "cached" link. However, that file is completely useless without instructions on how

Re: Future Python Gui?

2007-04-19 Thread [EMAIL PROTECTED]
> It shouldn't change at all. I use Frame for Tkinter frames and > Tile.Frame for Tile frames, since a lot of the widgets have the same > names. Here's a sample: > > from Tkinter import * > import Tile Thanks for all the info. I'm a little confused about using both Tkinter and Tile at the same ti

Re: Do other Python GUI toolkits require this?

2007-04-19 Thread [EMAIL PROTECTED]
On Apr 19, 6:54 am, Antoon Pardon <[EMAIL PROTECTED]> wrote: > I don't know how you come to the conclusion that it is a mathematical > absurdity but consider this: If you find that common usage propagates > something that is incorrect, should we just shrug it off or should we &

How to upgrade python from 2.3 to 2.4

2007-04-19 Thread [EMAIL PROTECTED]
Hi, Red hat 4 comes with python 2.3, and I am trying to upgrade to python 2.4. So I download and compile the source of python2.4. But as I run it I get the following error, can you please tell me how to fix it? # /root/src/Python-2.4.4/python ./nov/scripts/stressTestServlet.py ./ nov/scripts/str

How To Find Currently Selected Tile.Notebook Tab?

2007-04-19 Thread [EMAIL PROTECTED]
How can I determine what tab is currently selected in a Tile.Notebook widget? The best suggestion I've been able to find via Google is "mynotebook.index('current')", but that gets an exception from Tcl. Any ideas? -- Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: List of Objects

2007-04-19 Thread [EMAIL PROTECTED]
These methods work. I didn't think I could create a list of objects like that, however, I stand corrected. Thanks for your quick (and helpful) responses! On Apr 19, 11:22 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Thu, 19 Apr 2007 19:58:35 -0700, datamonkey.ryan

Re: How to upgrade python from 2.3 to 2.4

2007-04-20 Thread [EMAIL PROTECTED]
On Apr 20, 3:21 am, Ramashish Baranwal <[EMAIL PROTECTED]> wrote: > On Apr 20, 2:03 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > Hi, > > > Red hat 4 comes with python 2.3, and I am trying to upgrade to python > > 2.4. So I download an

pydoc and imported modules

2007-04-20 Thread [EMAIL PROTECTED]
When I "from foo import *" in my __init__.py, sometimes module foo's docs will be expanded in the pydocs. It seems to depend in what language foo was implemented. For example, if you "from math import *" in your __init__.py, you will see math's members will appear in the resulting pydocs, as thoug

When are immutable tuples *essential*? Why can't you just use lists *everywhere* instead?

2007-04-20 Thread [EMAIL PROTECTED]
Please help me think of an example where immutable tuples are essential. It seems that everywhere a tuple is used one could just as easily use a list instead. chris -- http://mail.python.org/mailman/listinfo/python-list

Re: How To Find Currently Selected Tile.Notebook Tab?

2007-04-20 Thread [EMAIL PROTECTED]
> > How can I determine what tab is currently selected in a Tile.Notebook > > widget? > > > The best suggestion I've been able to find via Google is > > "mynotebook.index('current')", but that gets an exception from Tcl. > > How about > > mynotebook.index.current() No good: AttributeError: 'funct

Re: When are immutable tuples *essential*? Why can't you just use lists *everywhere* instead?

2007-04-20 Thread [EMAIL PROTECTED]
> The article explains that, amongst other things, tuples are faster > than lists, so if you are working with constant values (inmutables) > they are more indicated than lists. Thanks. I thought Python's design wasn't so concerned with optimizations. Adding a new type "just" for optimization re

wx.TextCtrl.SetDefaultStyle not working?

2007-04-20 Thread [EMAIL PROTECTED]
I'm running Python2.5 with wxPython v2.8.3.0 under WinXP and I cannot get the SetDefaultStyle method to work. I'm trying: self.output.SetDefaultStyle(wx.TextAttr(wx.RED)) self.output.AppendText(text) self.output.SetDefaultStyle(wx.TextAttr()) where "self.output" is a Text

function minimization

2007-04-22 Thread [EMAIL PROTECTED]
Is anyone aware of python library that does function minimization a la Minuit (http://wwwasdoc.web.cern.ch/wwwasdoc/minuit/) used by CERN? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: function minimization

2007-04-22 Thread [EMAIL PROTECTED]
On Apr 22, 9:55 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: In the meantime, I found mpfit, but this is not working with python2.5. Any advice? thanks -- http://mail.python.org/mailman/listinfo/python-list

pickled object, read and write..

2007-04-22 Thread [EMAIL PROTECTED]
Hi all. I have to put together some code that reads high scores from a saved file, then gives the user the opportunity to add their name and score to the high scores list, which is then saved. Trouble is, I can't tell the program to read a file that doesn't exist, that generates an error. So I m

Re: recursion depth problem

2007-04-22 Thread [EMAIL PROTECTED]
On Apr 22, 9:13�pm, proctor <[EMAIL PROTECTED]> wrote: > On Apr 22, 7:10 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > > > > > > > On 22 Apr 2007 17:06:18 -0700, proctor <[EMAIL PROTECTED]> declaimed the > > following in comp.lang.python: &

Re: wx.TextCtrl.SetDefaultStyle not working?

2007-04-23 Thread [EMAIL PROTECTED]
> On my platform, styling the text doesn't work for single line > TextCtrl's(which seems kind of stupid), and on Windows I think you are > required to specify wx.TE_RICH2 to style the text. This following > code colors the entered text red for me: That's it! I didn't have the TE_RICH2 option set

os.system('tar -c * | tar -C dst') ##Any other suggestions...

2007-04-24 Thread [EMAIL PROTECTED]
I'm getting the following error: tar: You must specify one of the `-Acdtrux' options Try `tar --help' or `tar --usage' for more information. tar: -: Cannot write: Broken pipe tar: Error is not recoverable: exiting now Any suggestions on a different approach or fix? -List -- http://mail.python.

Re: Tutorial creates confusion about slices

2007-04-24 Thread [EMAIL PROTECTED]
Antoon Pardon wrote: > On 2007-04-24, Michael Bentley <[EMAIL PROTECTED]> wrote: > > > > On Apr 24, 2007, at 6:35 AM, Antoon Pardon wrote: > > > >> People don't read tutorials in a strictly linear fashion. They can > >> continue to later subjects

How to change font colour

2007-04-25 Thread [EMAIL PROTECTED]
I use PIL to write some text to a picture.The text must  be seen wery clearly. I write the text to different pictures but to the same position. As  pictures maybe  different, colour, in the position where I write the text, is also different. Is there a way how to set the font colour so that it

Re: If Dict Contains a particular key

2007-04-25 Thread [EMAIL PROTECTED]
On Apr 24, 1:41 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > Steven Howe wrote: > > Carsten Haese wrote: > >> On Tue, 2007-04-24 at 18:28 +0100, Robert Rawlins - Think Blue wrote: > > >>> Hello Guys, > > >>> I'm Looking to build a quick

Re: PIL and font colour

2007-04-26 Thread [EMAIL PROTECTED]
Steve Thank you for your reply. Is there a way how to find out a complementary colour for an area where I will write the text, so that the text will be  seen clearly?Is there a routine in PIL or in Python somewhere? Thank you for help L. > Johny wrote: > >  I use PIL to write some text to

Re: PIL and font colour.

2007-04-26 Thread [EMAIL PROTECTED]
Steve Thank you for your reply. Is there a way how to find out a complementary colour for an area where I will write the text, so that the text will be seen clearly?Is there a routine in PIL or in Python somewhere? Thank you for help Lad. > > I use PIL to write some text to a pict

Parsing HTML/XML documents

2007-04-26 Thread [EMAIL PROTECTED]
I need to parse real world HTML/XML documents and I found two nice python solution: BeautifulSoup and Tidy. However I found pyXPCOM that is a wrapper for Gecko. So I was thinking Gecko surely handles bad html in a more consistent and error-proof way than BS and Tidy. I'm interested in using Mozil

Re: If Dict Contains a particular key

2007-04-26 Thread [EMAIL PROTECTED]
On Apr 26, 12:47 am, [EMAIL PROTECTED] (Alex Martelli) wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >... > > > > if 'a' in thedict: > > > ... > > > > There's no need for the call to keys(). >

wxPython (Flex)GridSizer Failing

2007-04-27 Thread [EMAIL PROTECTED]
Python v2.5 wxPython v2.8.3.0 I've got an app that has a wx.Panel managed by a FlexGridSizer. There are 5 columns and 6 rows, all with StaticText widgets and all of similar size. Everything works fine until I Clear and re-fill the sizer a few times, then it puts all of the text in the upper-left

Re: Dedicated CPU core for Python?

2007-04-27 Thread [EMAIL PROTECTED]
On Apr 27, 3:14 pm, "Joshua J. Kugler" <[EMAIL PROTECTED]> wrote: > On Thursday 26 April 2007 14:07, Gabriel Genellina wrote: > > > En Thu, 26 Apr 2007 15:54:38 -0300, Joshua J. Kugler > > <[EMAIL PROTECTED]> escribió: > > >> Are you talking a

Re: Beginner Ping program

2007-04-28 Thread [EMAIL PROTECTED]
On Apr 27, 10:54 pm, Linus Cohen <[EMAIL PROTECTED]> wrote: > Hi all, > I'm a newbie to python and programming in general, so I wanted a > simple project to start off. What I'm trying to do here is write a > python command-line ping program, much like the Unix and Windo

How to pass in argument to timeit.Timer

2007-04-28 Thread [EMAIL PROTECTED]
Hi, I have a function in my python like this: def callFunc(line, no): # some code And I want to do a performance test like this: for line in f: for i in range(int(count)): t1 = timeit.Timer("callFunc(line, i)","from __main__ import callFunc") r1 = t1.timeit(

how can I put an Exception as the key of a hash table

2007-04-28 Thread [EMAIL PROTECTED]
I want to keep track of the number of different exception happens in my python program: ErrorHash = {} try: # come code ... except Exception, e: print e errcode = e if (ErrorHash.has_key(errcode)): ErrorFailNo = ErrorHash[errcode]

How to get HTTP error when using urlretrieve()

2007-04-28 Thread [EMAIL PROTECTED]
Hi, I use urlretrieve to retrieve resources from a http server. Can you please tell me how can I get the HTTP error (whenever happens)? And what kind of different exception urlretrieve will throw? e.g. unknown host? connection timeout? HTTP error? Thank you. -- http://mail.python.org/mailman/l

Chart drawing tool in python

2007-04-29 Thread [EMAIL PROTECTED]
Hi, In Perl, there is a GD module to draw custom chart. http://www-128.ibm.com/developerworks/opensource/library/os-perlgdchart/?ca=dgr-lnxw01Perl-GD-Charts Can you please tell me if there is an equivalent library in python? Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Problem with PyQt4

2007-04-30 Thread [EMAIL PROTECTED]
Hi, I am having some serious problems with PyQT4, when i run pyqt script, I always get 'Segmentation fault'. the script is simple: == %less qttest.py from PyQt4 import QtGui, QtCore import sys if __name__ == '__main__': app = QtGui.QApplication(sys.argv) w = Q

Re: Reading Data From an Excel Sheet

2007-04-30 Thread [EMAIL PROTECTED]
On Apr 30, 3:35 am, sagar <[EMAIL PROTECTED]> wrote: > Hi all, >I want a python script which takes in input an EXCEL sheet > and then reads the data in it. > Any code snippets will be fine and this i want this in windows > XP . > >Thanks in Advance

Re: Launching an independent Python program in a cross-platform way (including mac)

2007-04-30 Thread [EMAIL PROTECTED]
I would like to see this as a command along with something to open web pages.. Just one command instead of trying to figure out all the different op systems. look forward to seeing your code https://sourceforge.net/projects/dex-tracker On Apr 30, 9:40 am, André <[EMAIL PROTECTED]> wrote

fix an example of wxwindows listed on rentacoder.com

2007-04-30 Thread [EMAIL PROTECTED]
The code in question is at https://sourceforge.net/projects/dex-tracker I am trying to get rid of the part of the example where you have to use run.py. since I am stuck and it is driving me nuts I have put it up for bid at http://www.rentacoder.com/RentACoder/misc/BidRequests/ShowBidRequest.

Re: How to pass in argument to timeit.Timer

2007-04-30 Thread [EMAIL PROTECTED]
On Apr 28, 3:37 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sat, 28 Apr 2007 15:48:11 -0300, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> escribió: > > > I have a function in my python like this: > > def callFunc(line, no): > > # so

Re: How to pass in argument to timeit.Timer

2007-04-30 Thread [EMAIL PROTECTED]
On Apr 30, 1:24 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Apr 28, 3:37 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > > > > > En Sat, 28 Apr 2007 15:48:11 -0300, [EMAIL PROTECTED] > > <[EMAIL PROTECTED]> escr

Re: Video: Professor of Physics Phd at Cal Tech says: 911 Inside Job

2007-04-30 Thread [EMAIL PROTECTED]
On Apr 24, 10:13 pm, [EMAIL PROTECTED] wrote: > Cal Tech is the ELITE of ELITE in physics. > > If Feynman were alive, he would point his finger straight at the 911 > criminal operators, the yank bastards themselves ... If Feynmann alive were he would be wrighting review cra

Re: Problem with PyQt4

2007-04-30 Thread [EMAIL PROTECTED]
I rebuild them from source now. Hope this can help me. -- http://mail.python.org/mailman/listinfo/python-list

Comparing bitmap images for differences?

2007-05-01 Thread [EMAIL PROTECTED]
I know it's a long shot but does anyone have any pointers to generic algorithms - or, even better, Python code - for comparing images and computing a value for the "difference" between them? What I want to do is to compare two bitmap images (taken from a webcam, so I'll likely be using PIL) and ge

Re: re-importing modules

2007-05-01 Thread [EMAIL PROTECTED]
John Nagle wrote: > Steven D'Aprano wrote: > > I'd hate for reload to disappear, it is great for interactive > > development/debugging, at least under some circumstances. (If you have > > complex and tangled class hierarchies, it might not be powerful enough.) > > > > As for the semantics being awf

Re: Grabbing the output of a long-winded shell call (in GNU/Linux)

2007-05-01 Thread [EMAIL PROTECTED]
On May 1, 2:23 pm, Efrat Regev <[EMAIL PROTECTED]> wrote: > So my question is if there's a way to "grab" the output as it's being > generated. It doesn't matter if the solution is blocking (as opposed to > callback based), since threads can handle thi

How can I get the ascii code of a charter in python?

2007-05-01 Thread [EMAIL PROTECTED]
Hi, a python newbe needs some help, I read the python doc at http://docs.python.org/lib/module-curses.ascii.html I tried Import curses.asciicurses.ascii Print ascii('a') I get an error saying module curses.ascii8 does not exsist. How can I get the ascii code of a charter in python? -Ted -- h

Re: Comparing bitmap images for differences?

2007-05-02 Thread [EMAIL PROTECTED]
On May 1, 3:42 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > With that, you can approach your problem. What is usually done is that a > sequence of background images is sampled & an average is built. Then the > actual image is subtracted from that image, wit

Re: Comparing bitmap images for differences?

2007-05-02 Thread [EMAIL PROTECTED]
On May 1, 7:15 pm, "3c273" <[EMAIL PROTECTED]> wrote: > This might get you started.http://tinyurl.com/7qexl Wow, I thought briefly along those lines but then thought "No, it can't possibly be that easy" :-) It looks like the approach given in that link could

Re: Problem with PyQt4

2007-05-02 Thread [EMAIL PROTECTED]
On Apr 30, 10:32 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > I am having some serious problems with PyQT4, > when i run pyqt script, I always get 'Segmentation fault'. > > the script is simple: > == > %less qt

gpp (conditional compilation)

2007-05-02 Thread [EMAIL PROTECTED]
I'm trying to use the gpp utility (Gnu points to http://en.nothingisreal.com/wiki/GPP) to do conditional compilation in Python, and I'm running into a problem: the same '#' character introduces Python comments and is used by default to introduce #ifdef etc. lines. Here's an example of what I'm tr

Re: gpp (conditional compilation)

2007-05-02 Thread [EMAIL PROTECTED]
(replying to myself because I got four good replies) Wow! That was fast! OK, I'll try out these ideas, and many thanks! Mike Maxwell -- http://mail.python.org/mailman/listinfo/python-list

Re: bitwise shift?

2007-05-02 Thread [EMAIL PROTECTED]
On May 2, 2:24 pm, Tobiah <[EMAIL PROTECTED]> wrote: > John Machin wrote: > > On 26/04/2007 7:10 AM, Sherm Pendley wrote: > > >> Shift left is *not* the same as multiplying by k. It is the same as > >> multi- > >> plying by 2^k. > > > Where

<    23   24   25   26   27   28   29   30   31   32   >