ANN: PYFS,PSSC,VNC60 for Symbian 3nd

2008-01-20 Thread Michele Andreoli
Hello group, I released new versions of PYFS (remote access to Linux,Windows-S60 via bluetooth), PSSC (webcam and screen-capture S60-Linux,Windows) and VNC60 (access linux-display from your S60). Starting from here: http://mulinux.sunsite.dk/python/projects.html you can find also some flash

Quixote cookies

2008-01-20 Thread [EMAIL PROTECTED]
Hi, guys I'm trying to use cookies in Quixote. This is the code: env = copy(os.environ) req = HTTPRequest(sys.stdin, env) req.response.set_cookie(xxx,666) cc = req.get_cookie(xxx); For some reason it cc is always None. What am I doing wrong? --

Re: Excess whitespace in my soup

2008-01-20 Thread John Machin
Remco Gerlich wrote: Not sure if this is sufficient for what you need, but how about import re re.sub(u'[\s\xa0]+', ' ', s) That should replace all occurances of 1 or more whitespace or \xa0 characters, by a single space. It does indeed, and so does re.sub(u'\s\+', ' ', s) because

Re: Hebrew in idle ans eclipse (Windows)

2008-01-20 Thread iu2
On Jan 17, 10:35 pm, Martin v. Löwis [EMAIL PROTECTED] wrote: import pymssql con = pymssql.connect(host='192.168.13.122',user='sa',password='',database='tempd­b') cur = con.cursor() cur.execute('select firstname, lastname from [users]') lines = cur.fetchall() print lines or

Re: Excess whitespace in my soup

2008-01-20 Thread John Machin
Stefan Behnel wrote: John Machin wrote: On Jan 19, 11:00 pm, Fredrik Lundh [EMAIL PROTECTED] wrote: John Machin wrote: I'm happy enough with reassembling the second item. The problem is in reliably and correctly collapsing the whitespace in each of the above

Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread pythonewbie
Hi all, I am newbie in Python, my wish would be to create python applications for both Linux/Win32. I am stucked on creating a function to get the Python install directory (and site-packages directory) with a 100% reliable method... My goal is to verify if an/several extension(s) are installed

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread Christian Heimes
pythonewbie wrote: I am stucked on creating a function to get the Python install directory (and site-packages directory) with a 100% reliable method... Only one method is 100% reliable: try: import yourextension except ImportError: available = False else: available = True

Re: finding memory leak in edgewall trac 0.11

2008-01-20 Thread rupert.thurner
On Jan 19, 10:31 pm, Christian Heimes [EMAIL PROTECTED] wrote: Jeroen Ruigrok van der Werven wrote: Hi Christian, -On [20080119 16:16], Christian Heimes ([EMAIL PROTECTED]) wrote: I forgot one important point in my reply. The GC module contains some useful methods for debugging. Check

Re: finding memory leak in edgewall trac 0.11

2008-01-20 Thread rupert.thurner
On Jan 20, 12:40 pm, rupert.thurner [EMAIL PROTECTED] wrote: On Jan 19, 10:31 pm, Christian Heimes [EMAIL PROTECTED] wrote: Jeroen Ruigrok van der Werven wrote: Hi Christian, -On [20080119 16:16], Christian Heimes ([EMAIL PROTECTED]) wrote: I forgot one important point in my

Re: convivenza

2008-01-20 Thread Sergio
crxor 666 wrote: Evidentemente equivocherò sul termine potenza di un linguaggio, ma dubito che io possa scrivere un device driver in Python, indipendentemente dalla potenza processore o dall'esistenza di un compilatore Python (ho preso per esempio il Python ma potevo usare molti altri

Re: Okay I got a question regarding Tkinter and Labels

2008-01-20 Thread Fredrik Lundh
Lamonte Harris wrote: Okay I've created a script and basically when I loop through a folder it is supposed to change the Label everytime it updates a file then again it doesn't do nothing but shows the last file edited, whats the best way to loop through files and display that file name in

Re: Memory errors with imaplib

2008-01-20 Thread Fredrik Lundh
Martey wrote: I am trying to use imaplib to download messages, but I keep getting memory errors when I try to download a large message (i.e. one with attachments). Here is my test code (similar to the example in the imaplib documentation): /.../ I am using Mac OS X 10.5 and Python 2.5.1

Re: Efficient processing of large nuumeric data file

2008-01-20 Thread Jorgen Grahn
On Fri, 18 Jan 2008 09:15:58 -0800 (PST), David Sanders [EMAIL PROTECTED] wrote: Hi, I am processing large files of numerical data. Each line is either a single (positive) integer, or a pair of positive integers, where the second represents the number of times that the first number is

Re: I don't understand what is happening in this threading code

2008-01-20 Thread Nir
On Jan 19, 2:43 am, Matthew Wilson [EMAIL PROTECTED] wrote: In this code, I tried to kill my thread object by setting a variable on it to False. Inside the run method of my thread object, it checks a different variable. I've already rewritten this code to use semaphores, but I'm just

Re: finding memory leak in edgewall trac 0.11

2008-01-20 Thread Christian Heimes
rupert.thurner wrote: i forgot to mention that i cannot see any explicit sys._getframe(), or __del__ in the genshi code, while the ones in trac-core seemed to be there in 0.10.4. Does the code keep a reference to a traceback object or an attribute of a traceback object? Christian --

bitmap problem

2008-01-20 Thread Robin Becker
I'm having trouble with defining a completely transparent bitmap for use as a stipple in a canvas import Tkinter Tkinter._default_root.tk.call('image','create', 'bitmap', 'gray0', '-background', '', '-data', '#define gray0_width 1\n#define gray0_height 1\nstatic

Re: writing Python in Emacs

2008-01-20 Thread Jorgen Grahn
[Followup-To: header set to comp.lang.python.] On Sat, 19 Jan 2008 17:51:50 +0100, Terry Jones [EMAIL PROTECTED] wrote: Richard == Richard Szopa [EMAIL PROTECTED] writes: Richard I am a devoted Emacs user and I write a lot in Python. Me too. Richard I need the following features: Richard 1)

Re: Memory errors with imaplib

2008-01-20 Thread Grant Edwards
On 2008-01-20, Fredrik Lundh [EMAIL PROTECTED] wrote: looks like a known bug in imaplib: http://bugs.python.org/issue1389051 In a worst case scenario, you'll need some 13 gigabytes of virtual memory to read a 15 megabyte message... The problem and the one-line soulution have

Re: Core Python Programming . . .

2008-01-20 Thread Jorgen Grahn
On Sat, 19 Jan 2008 08:57:24 -0500, Yu-Xi Lim [EMAIL PROTECTED] wrote: FireNWater wrote: I guess I'm not fully up to speed on what constitutes an IP address. Does the term 'octet' refer to an 8-bit (xFF) number? Yes, it somewhat archaic though. It's more precise than byte, like you say. I

Homework Helper and College Companion Websites

2008-01-20 Thread BJ
In 1996 I started BJ Pinchbeck's Homework Helper at www.bjpinchbeck.com which became quite popular among young students throughout the country. Now that I am 20 years old and attending Drexel University in Philadelphia, Pennsylvania, I decided it was time to start a new site, BJ Pinchbeck's

Re: Bug in __init__?

2008-01-20 Thread Bart Ogryczak
On 2008-01-18, citizen Zbigniew Braniecki testified: It's really a nice pitfall, I can hardly imagine anyone expecting this, AFAIR, it's described in Diving Into Python. It's quiet elegant way of creating cache. def calculate(x,_cache={}): try: return _cache[x]

Re: writing Python in Emacs

2008-01-20 Thread Rob Wolfe
Terry Jones [EMAIL PROTECTED] writes: Richard == Richard Szopa [EMAIL PROTECTED] writes: I don't see Richard's original post, so I reply to Terry. Richard I am a devoted Emacs user and I write a lot in Python. Me too. The good news is that I managed to configure completion for Python in

Re: too long float

2008-01-20 Thread Bart Ogryczak
On 2008-01-18, citizen J. Peng testified: hello, why this happened on my python? a=3.9 a 3.8999 a = 3.9 print a 3.9 bart -- PLEASE DO *NOT* EDIT or poldek will hate you. - packages.dir (PLD) http://candajon.azorragarse.info/ http://azorragarse.candajon.info/ --

Re: Bug in __init__?

2008-01-20 Thread Bart Ogryczak
On 2008-01-18, citizen Zbigniew Braniecki testified: I found a bug in my code today, and spent an hour trying to locate it and then minimize the testcase. Once I did it, I'm still confused about the behavior and I could not find any reference to this behavior in docs. testcase: class

Re: Memory errors with imaplib

2008-01-20 Thread Christian Heimes
Grant Edwards wrote: The problem and the one-line soulution have been known for over two years and it's still an open bug? Nobody was interested to provide a patch. I raised the level of the bug. It's going to be fixed soonish. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: TopSort in Python?

2008-01-20 Thread Mike C. Fletcher
Paddy wrote: ... I searched for dependancy sort, and later dependency sort (cos I couldn't spell). I had convinced that I was using the right term and was flummoxed by the lack of hits. Even today the term topological sort means far less than what it describes: sorting items based on their

Re: Bug in __init__?

2008-01-20 Thread Arnaud Delobelle
On Jan 20, 3:39 pm, Bart Ogryczak [EMAIL PROTECTED] to.invalid wrote: On 2008-01-18, citizen Zbigniew Braniecki testified: It's really a nice pitfall, I can hardly imagine anyone expecting this, AFAIR, it's described in Diving Into Python. Still there seems to be about one message a week

RE: HTTP POST uploading large files

2008-01-20 Thread Brian Smith
Wolfgang Draxinger wrote: The problem is, that videos, by nature are rather big files, however urllib2 wants it's Request objects being prepared beforehand, which would mean to first load the whole file to memory. Try using mmap. Here is some untested code: map = mmap(file.fileno(),

Looping through the gmail dot trick

2008-01-20 Thread Joshua Gilman
So I have a very interesting task ahead of me and it is to loop through an email using the 'gmail dot trick'. Essentially this trick puts periods throughout your email to make it look different. Even though it has periods gmail will replace them all and send it to that email. So [EMAIL PROTECTED]

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread pythonewbie
On 20 jan, 12:20, Christian Heimes [EMAIL PROTECTED] wrote: pythonewbie wrote: I am stucked on creating a function to get the Python install directory (and site-packages directory) with a 100% reliable method... Only one method is 100% reliable: try: import yourextension except

Re: Bug in __init__?

2008-01-20 Thread Bart Ogryczak
On 2008-01-20, citizen Arnaud Delobelle testified: On Jan 20, 3:39 pm, Bart Ogryczak [EMAIL PROTECTED] to.invalid wrote: On 2008-01-18, citizen Zbigniew Braniecki testified: It's really a nice pitfall, I can hardly imagine anyone expecting this, AFAIR, it's described in Diving Into Python.

Re: HTTP POST uploading large files

2008-01-20 Thread Paul Rubin
Wolfgang Draxinger [EMAIL PROTECTED] writes: Am I just blind for some urllib2/httplib feature, or some other library? Or do I really have to fiddle around with sockets myself (I hope not...). I did something like that by just opening a socket and writing the stuff with socket.sendall. It's

Just for fun: Countdown numbers game solver

2008-01-20 Thread dg . google . groups
Ever since I learnt to program I've always loved writing solvers for the Countdown numbers game problem in different languages, and so now I'm wondering what the most elegant solution in Python is. If you don't know the game, it's simple: you're given six randomly chosen positive integers, and a

Re: HTTP POST uploading large files

2008-01-20 Thread Wolfgang Draxinger
Paul Rubin wrote: Wolfgang Draxinger [EMAIL PROTECTED] writes: Am I just blind for some urllib2/httplib feature, or some other library? Or do I really have to fiddle around with sockets myself (I hope not...). I did something like that by just opening a socket and writing the stuff with

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread Diez B. Roggisch
pythonewbie schrieb: On 20 jan, 12:20, Christian Heimes [EMAIL PROTECTED] wrote: pythonewbie wrote: I am stucked on creating a function to get the Python install directory (and site-packages directory) with a 100% reliable method... Only one method is 100% reliable: try: import

Re: bitmap problem

2008-01-20 Thread Robin Becker
Robin Becker wrote: I'm having trouble with defining a completely transparent bitmap for use as a stipple in a canvas ... after a bit of searching I find that stipples cannot be created with the tk image command; for non-standard stipples you need to use a file. -- Robin Becker --

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread Michael L Torrie
pythonewbie wrote: Hi all, I am newbie in Python, my wish would be to create python applications for both Linux/Win32. I am stucked on creating a function to get the Python install directory (and site-packages directory) with a 100% reliable method... My goal is to verify if an/several

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread pythonewbie
On 20 jan, 19:50, Diez B. Roggisch [EMAIL PROTECTED] wrote: pythonewbie schrieb: On 20 jan, 12:20, Christian Heimes [EMAIL PROTECTED] wrote: pythonewbie wrote: I am stucked on creating a function to get the Python install directory (and site-packages directory) with a 100% reliable

py2exe and modules question

2008-01-20 Thread azrael
I'm working on an application and i'm having some questions. I am working with python 2.5, numpy and PIL. does anyone know if there are some problems while compiling the source because of the modules.. It has to be closed source. I didn't try Py2exe but I heard about it. Is there any other and

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread Diez B. Roggisch
pythonewbie schrieb: On 20 jan, 19:50, Diez B. Roggisch [EMAIL PROTECTED] wrote: pythonewbie schrieb: On 20 jan, 12:20, Christian Heimes [EMAIL PROTECTED] wrote: pythonewbie wrote: I am stucked on creating a function to get the Python install directory (and site-packages directory) with a

Re: Just for fun: Countdown numbers game solver

2008-01-20 Thread marek . rocki
Nice challenge! I came up with something like this: def find_repr(target, numbers): org_reprs = dict((number, str(number)) for number in numbers) curr_reprs = org_reprs while target not in curr_reprs: old_reprs, curr_reprs = curr_reprs, {}

Re: Just for fun: Countdown numbers game solver

2008-01-20 Thread Gabriel Genellina
En Sun, 20 Jan 2008 18:06:57 -0200, [EMAIL PROTECTED] escribi�: Nice challenge! I came up with something like this: A nice solution too! -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Looping through the gmail dot trick

2008-01-20 Thread Gabriel Genellina
En Sun, 20 Jan 2008 14:38:06 -0200, Joshua Gilman [EMAIL PROTECTED] escribi�: My task is this: Loop through an email and create as many combinations of periods as possible. So all the combinations for blah would be: b.lah bl.ah bla.h b.l.ah b.la.h bl.a.h I'd use a recursive generator

Re: Looping through the gmail dot trick

2008-01-20 Thread Martin Marcher
On Sunday 20 January 2008 17:38 Joshua Gilman wrote: So I have a very interesting task ahead of me and it is to loop through an email using the 'gmail dot trick'. Essentially this trick puts periods throughout your email to make it look different. Even though it has periods gmail will replace

Re: Just for fun: Countdown numbers game solver

2008-01-20 Thread dg . google . groups
Hi Marek, That's a really nice solution (and ultrafast). Unfortunately I realise I stated the problem imprecisely. You're only allowed to use each number once (otherwise there's a trivial solution for every problem, i.e. x/x + x/x + x/x + ... + x/x repeated y times for target y given any source

Re: Looping through the gmail dot trick

2008-01-20 Thread Neil Hodgson
Martin Marcher: are you saying that when i have 2 gmail addresses [EMAIL PROTECTED] and [EMAIL PROTECTED] they are actually treated the same? That is plain wrong and would break a lot of mail addresses as I have 2 that follow just this pattern and they are delivered correctly! This

Re: Just for fun: Countdown numbers game solver

2008-01-20 Thread Paul Rubin
[EMAIL PROTECTED] writes: Unfortunately I realise I stated the problem imprecisely. You're only allowed to use each number once (otherwise there's a trivial solution for every problem, i.e. x/x + x/x + x/x + ... + x/x repeated y times for target y given any source number x). Trying your

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread Martin v. Löwis
But for different reasons I also want to get the absolute path of Python install directory (not only the executable under Linux) and site-packages directory. The Python install directory is available as sys.prefix. The site-packages directory is sys.prefix+lib/python+x.y+/site-packages (where

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread pythonewbie
On 20 jan, 20:59, Diez B. Roggisch [EMAIL PROTECTED] wrote: pythonewbie schrieb: On 20 jan, 19:50, Diez B. Roggisch [EMAIL PROTECTED] wrote: pythonewbie schrieb: On 20 jan, 12:20, Christian Heimes [EMAIL PROTECTED] wrote: pythonewbie wrote: I am stucked on creating a function to get

Re: Just for fun: Countdown numbers game solver

2008-01-20 Thread Arnaud Delobelle
On Jan 20, 5:41 pm, [EMAIL PROTECTED] wrote: Ever since I learnt to program I've always loved writing solvers for the Countdown numbers game problem in different languages, and so now I'm wondering what the most elegant solution in Python is. If you don't know the game, it's simple: you're

Re: Looping through the gmail dot trick

2008-01-20 Thread Steven D'Aprano
On Sun, 20 Jan 2008 21:13:03 +, Neil Hodgson wrote: Martin Marcher: are you saying that when i have 2 gmail addresses [EMAIL PROTECTED] and [EMAIL PROTECTED] they are actually treated the same? That is plain wrong and would break a lot of mail addresses as I have 2 that follow

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread pythonewbie
On 20 jan, 23:19, Martin v. Löwis [EMAIL PROTECTED] wrote: But for different reasons I also want to get the absolute path of Python install directory (not only the executable under Linux) and site-packages directory. The Python install directory is available as sys.prefix. The

Re: Just for fun: Countdown numbers game solver

2008-01-20 Thread Paul Rubin
[EMAIL PROTECTED] writes: Unfortunately I realise I stated the problem imprecisely. You're only allowed to use each number once (otherwise there's a trivial solution for every problem, i.e. x/x + x/x + x/x + ... + x/x repeated y times for target y given any source number x). Trying your

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread John Machin
On Jan 21, 8:58 am, pythonewbie [EMAIL PROTECTED] wrote: I just would like to know if I would ALWAYS find the install directory in sys.path[6] and site-packages directory in sys.path[7] on any Win32 platform and sys.path[2] and site-packages directory in sys.path[6] on any Linux platform. If

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread pythonewbie
On 20 jan, 23:55, Diez B. Roggisch [EMAIL PROTECTED] wrote: pythonewbie schrieb: On 20 jan, 20:59, Diez B. Roggisch [EMAIL PROTECTED] wrote: pythonewbie schrieb: On 20 jan, 19:50, Diez B. Roggisch [EMAIL PROTECTED] wrote: pythonewbie schrieb: On 20 jan, 12:20, Christian Heimes

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread Diez B. Roggisch
pythonewbie schrieb: On 20 jan, 20:59, Diez B. Roggisch [EMAIL PROTECTED] wrote: pythonewbie schrieb: On 20 jan, 19:50, Diez B. Roggisch [EMAIL PROTECTED] wrote: pythonewbie schrieb: On 20 jan, 12:20, Christian Heimes [EMAIL PROTECTED] wrote: pythonewbie wrote: I am stucked on creating a

RE: Looping through the gmail dot trick

2008-01-20 Thread Delaney, Timothy (Tim)
Steven D'Aprano wrote: Postfix, I think, interpets foo+bar the same as foo. Gmail does the same. It's quite useful - apart from using it to determine which site I signed up to has sent me mail, I also use it so I can have multiple Guild Wars accounts using the same email account e.g. me[EMAIL

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread John Machin
On Jan 21, 11:00 am, pythonewbie [EMAIL PROTECTED] wrote: On 21 jan, 00:09, John Machin [EMAIL PROTECTED] wrote: On Jan 21, 8:58 am, pythonewbie [EMAIL PROTECTED] wrote: I just would like to know if I would ALWAYS find the install directory in sys.path[6] and site-packages directory

Re: Basic inheritance question

2008-01-20 Thread Bjoern Schliessmann
(messed up references?) Lie wrote: Please again, stop taking letters to the words Please don't mix up followups. Regards, Björn -- BOFH excuse #11: magnetic interference from money/credit cards -- http://mail.python.org/mailman/listinfo/python-list

RE: plz help how to print python variable using os.system()

2008-01-20 Thread Delaney, Timothy (Tim)
Grant Edwards wrote: On 2008-01-16, Lutz Horn [EMAIL PROTECTED] wrote: Hi, On Wed, 16 Jan 2008 05:29:08 -0800 (PST), [EMAIL PROTECTED] said: var = /home/anonymous os.system(echo $var) os.system(echo %s % var) Though one wonders why one would do that instead of

Re: Just for fun: Countdown numbers game solver

2008-01-20 Thread Mel
[EMAIL PROTECTED] wrote: Ever since I learnt to program I've always loved writing solvers for the Countdown numbers game problem in different languages, and so now I'm wondering what the most elegant solution in Python is. If you don't know the game, it's simple: you're given six randomly

Re: Basic inheritance question

2008-01-20 Thread Lie
On Jan 16, 9:23 pm, Bjoern Schliessmann usenet- [EMAIL PROTECTED] wrote: Lie wrote: [EMAIL PROTECTED] wrote: I used to systematically use it - like I've always systematically used 'this' in C++ and Java. And that is what reduces readability. IMHO not, IOPHO not. This is the nth time

Re: Memory errors with imaplib

2008-01-20 Thread Grant Edwards
On 2008-01-20, Christian Heimes [EMAIL PROTECTED] wrote: Grant Edwards wrote: The problem and the one-line soulution have been known for over two years and it's still an open bug? Nobody was interested to provide a patch. I raised the level of the bug. It's going to be fixed soonish. If the

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages = extensions mgmt

2008-01-20 Thread pythonewbie
On 21 jan, 00:09, John Machin [EMAIL PROTECTED] wrote: On Jan 21, 8:58 am, pythonewbie [EMAIL PROTECTED] wrote: I just would like to know if I would ALWAYS find the install directory in sys.path[6] and site-packages directory in sys.path[7] on any Win32 platform and sys.path[2] and

Re: Just for fun: Countdown numbers game solver

2008-01-20 Thread Arnaud Delobelle
On Jan 20, 5:41 pm, [EMAIL PROTECTED] wrote: Ever since I learnt to program I've always loved writing solvers for the Countdown numbers game problem in different languages Ok so here's a challenge I just thought of: What is (or are) the set of 6 starting numbers which are such that the

Re: Just for fun: Countdown numbers game solver

2008-01-20 Thread Arnaud Delobelle
On Jan 21, 1:07 am, Arnaud Delobelle [EMAIL PROTECTED] wrote: On Jan 20, 5:41 pm, [EMAIL PROTECTED] wrote: Ever since I learnt to program I've always loved writing solvers for the Countdown numbers game problem in different languages Ok so here's a challenge I just thought of: What is

PyCon 2008 Registration Open!

2008-01-20 Thread David Goodger
I am pleased to announce that PyCon 2008 registration is now open! http://us.pycon.org/2008/registration/ Early-bird registration is open until February 20, so there's one month to register at the low rates. Regular on-line registration will be available from February 21 through March 7.

Re: TopSort in Python?

2008-01-20 Thread Tim Peters
[EMAIL PROTECTED] Thanks for the topsort code. It would be useful in a project I'm working on. Can I use the code for free under public domain? Thanks! If I ran the world, everything I posted to a public place would be public domain. Alas, the last lawyer who typed at me about this insisted

Bittorent client with google talk interface

2008-01-20 Thread Astan Chee
Hi, I dont know where to send this but I'll try here. I recently took the newest version of ABCTorrent and its code and added some features to it that I find very useful. Basically it is like a webUI except it connect to google's google talk and you can issue commands from it. Kinda like a

dynamic type variable

2008-01-20 Thread J. Peng
Python's variable is dynamic type,is it? But why this can't work? 3 + 'a' Traceback (most recent call last): File stdin, line 1, in ? TypeError: unsupported operand type(s) for +: 'int' and 'str' So I see the number 3 can't be converted to string type automacially. --

When is min(a, b) != min(b, a)?

2008-01-20 Thread Albert Hopkins
This issue may have been referred to in news:[EMAIL PROTECTED] but I didn't entirely understand the explanation. Basically I have this: a = float(6) b = float('nan') min(a, b) 6.0 min(b, a) nan max(a, b) 6.0 max(b, a) nan Before I did not know

auto import

2008-01-20 Thread alf
Hi, is there any way to tweak __import__ so it imports module with another arbitrary selected module included? For instance I have my mylibs.py module. Then when I import a oneofhundredssmallmodules.py module from other place the mylibs.py is automatically imported without a explicit import.

Re: dynamic type variable

2008-01-20 Thread Gabriel Genellina
En Mon, 21 Jan 2008 00:37:36 -0200, J. Peng [EMAIL PROTECTED] escribi�: Python's variable is dynamic type,is it? No. Python has objects, and names that refer to those objects. Objects have a type, which can't change once the object is created. But a name may refer to different objects of

Re: Just for fun: Countdown numbers game solver

2008-01-20 Thread Terry Jones
Here's a solution that doesn't use any copying of lists in for recursion. It also eliminates a bunch of trivially equivalent solutions. The countdown function is 37 lines of non-comment code. Sample (RPN) output below. Terry from operator import * def countdown(target, nums, numsAvail, value,

problem with 'global'

2008-01-20 Thread oyster
why the following 2 prg give different results? a.py is ok, but b.py is 'undefiend a' I am using Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 #a.py def run(): if 1==2:# note, it always False global a a=1 run() a

Re: Just for fun: Countdown numbers game solver

2008-01-20 Thread Paul Rubin
Terry Jones [EMAIL PROTECTED] writes: Here's a solution that doesn't use any copying of lists in for recursion. It also eliminates a bunch of trivially equivalent solutions. The countdown function is 37 lines of non-comment code. Sample (RPN) output below. Nice, I realized after I posted my

Is there a portable way to tell if data is available on a pipe?

2008-01-20 Thread John Nagle
I need some way to find out if a pipe has data available for a read without blocking if it does not. select, unfortunately, doesn't work on pipes on Windows. I think there's something proposed for Python 3000, but that's not useful now. I'd like to avoid having a thread to

Re: object scope

2008-01-20 Thread J. Peng
J. Peng 写道: Please see the code below,what's the scope for object name? I thought it should be located in the while block, but it seems not really,it can be accessed out of while (the db[name] statement).Thanks in advance. sorry the before code seems be disordered,re-posted it. db = {}

Re: dynamic type variable

2008-01-20 Thread Paddy
On Jan 21, 2:37 am, J. Peng [EMAIL PROTECTED] wrote: Python's variable is dynamic type,is it? But why this can't work? 3 + 'a' Traceback (most recent call last): File stdin, line 1, in ? TypeError: unsupported operand type(s) for +: 'int' and 'str' So I see the number 3 can't be

Our Bosch hid kit is $45/pc

2008-01-20 Thread housinghouse
We supply nice quality Bosch Hid Kit and Siemens Hid KitWe have Promotion now...Our HID KIT is $45/pc..Please contact us as soon as possibleOur website is www.housinghouse.comOur email is [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: When is min(a, b) != min(b, a)?

2008-01-20 Thread Bonjour
'NaN' means Not a number. according to Python semantics, if you try to compare it with any other float numbers, it should return FALSE. just like 1.0 'abc' False Since it always return FALSE, it is not a surprise for your question. If you wish to get infinitive number, you'd use 'inf' or

object scope

2008-01-20 Thread J. Peng
Please see the code below,what's the scope for object name? I thought it should be located in the while block, but it seems not really,it can be accessed out of while (the db[name] statement).Thanks in advance. db = {} def newuser(): prompt = 'login desired: ' while 1: name = raw_input(prompt)

Re: problem with 'global'

2008-01-20 Thread Mel
oyster wrote: why the following 2 prg give different results? a.py is ok, but b.py is 'undefiend a' I am using Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 #a.py def run(): if 1==2:# note, it always False global a

Re: When is min(a, b) != min(b, a)?

2008-01-20 Thread Bonjour
'NaN' means Not a number. according to Python semantics, if you try to compare it with any other float numbers, it should return FALSE. just like: 1.0 'abc' False Since it always return FALSE, it is not a surprise for your question. If you wish to get infinitive number, you'd use

Re: When is min(a, b) != min(b, a)?

2008-01-20 Thread Paddy
On Jan 21, 3:15 am, Albert Hopkins [EMAIL PROTECTED] wrote: This issue may have been referred to in news:[EMAIL PROTECTED] but I didn't entirely understand the explanation. Basically I have this: a = float(6) b = float('nan') min(a, b) 6.0 min(b, a) nan

Re: object scope

2008-01-20 Thread George Sakkis
On Jan 21, 12:16 am, J. Peng [EMAIL PROTECTED] wrote: Dennis Lee Bieber 写道: The scope of name is the entire function; lacking a global name statement, AND being on the left side of an assignment, it is a function local name. Thank you. Does python have so-called 'block scope' object?

Re: Iterate through slots

2008-01-20 Thread Gabriel Genellina
En Tue, 15 Jan 2008 16:35:52 -0200, Jared Grubb [EMAIL PROTECTED] escribi�: How can I iterate through the slots of a class, including those it inherits from parent classes? class C(object): __slots__ = ['a'] class D(C): __slots__ = ['b'] Iterate over all the class hierarchy

newbie doubt ..numpy array

2008-01-20 Thread nodrogbrown
if this is too silly a qn pls forgive I was learning numpy.ndarrays thru the tutorial. myarr=numpy.array( [ [10, 20, 30, 40],[1,2,3,4],[5,6,7,8] ] ) if i want to access the element 3 i can do it by myarr[1, 2] but then myarr[1][2] will also give the same result..is there any reason why two

Re: Just for fun: Countdown numbers game solver

2008-01-20 Thread Arnaud Delobelle
On Jan 21, 3:19 am, Terry Jones [EMAIL PROTECTED] wrote: Here's a solution that doesn't use any copying of lists in for recursion. It also eliminates a bunch of trivially equivalent solutions. The countdown function is 37 lines of non-comment code.  Sample (RPN) output below. Terry [snip

Re: paging in python shell

2008-01-20 Thread Gabriel Genellina
En Mon, 14 Jan 2008 21:05:38 -0200, Ben Finney [EMAIL PROTECTED] escribi�: To my knowledge there's nothing in the default Python shell that enables what the OP is asking for. There are other Python shells, e.g. Idle, ipython, or a Python window inside Emacs, that may be better suited. Yes,

Re: When is min(a, b) != min(b, a)?

2008-01-20 Thread Albert Hopkins
On Sun, 20 Jan 2008 20:16:18 -0800, Paddy wrote: I am definitely NOT a floating point expert, but I did find this: http://en.wikipedia.org/wiki/IEEE_754r#min_and_max P.S. What platform /Compiler are you using for Python? Linux with GCC 4 -a --

Re: Just for fun: Countdown numbers game solver

2008-01-20 Thread Paul Rubin
Arnaud Delobelle [EMAIL PROTECTED] writes: After a quick glance at your code it seems to me that you can only have solutions of the type: (num, num, op, num, op, num, op, num, op, num, op) this omits many possible solutions (see the one above). Here's my latest, which I think is

Re: Sorting a list depending of the indexes of another sorted list

2008-01-20 Thread babui
On 21 ene, 08:41, Santiago Romero [EMAIL PROTECTED] wrote: Hi ... I have the following DNS MX records info: domain.com preference 10 host mx1.domain.com preference 30 host anotherhost.domain.com preference 20 host mx2.domain.com And finally ... do you think there is a better python

eucledian dist calculations

2008-01-20 Thread nodrogbrown
hi i am using python to do some image data calculations..I use the following numpy.ndarrays ,(i have given their shapes and ranks) weights=ndarray :shape(100,30),ndim=2 will have vals like 2458121847.49 (of type 'numpy.float64') input_weight=ndarray :shape(30,),ndim=1 (similar to above but

Sorting a list depending of the indexes of another sorted list

2008-01-20 Thread Santiago Romero
Hi ... I have the following DNS MX records info: domain.com preference 10 host mx1.domain.com preference 30 host anotherhost.domain.com preference 20 host mx2.domain.com I'm storing this info in 2 lists: preferences = [10, 30, 20] hosts = [ mx1.domain.com, anotherhost.domain.com,

How to use py2exe ...

2008-01-20 Thread Santiago Romero
Hi... I'm a Linux user, and I would like some windows-friends to test a game I'm writing with python+pygame without they needing to install python, pygame, and so on. I've heard about py2exe and pygame2exe, but I'm not sure on how to use them to create: a.- standalone exe files with a

Re: object scope

2008-01-20 Thread J. Peng
Dennis Lee Bieber 写道: The scope of name is the entire function; lacking a global name statement, AND being on the left side of an assignment, it is a function local name. Thank you. Does python have so-called 'block scope' object? or if you can,please show me the doc for python's object

Re: Looping through the gmail dot trick

2008-01-20 Thread Martin Vilcans
On Jan 20, 2008 8:58 PM, Martin Marcher [EMAIL PROTECTED] wrote: are you saying that when i have 2 gmail addresses [EMAIL PROTECTED] and [EMAIL PROTECTED] they are actually treated the same? That is plain wrong and would break a lot of mail addresses as I have 2 that follow just this

Re: object scope

2008-01-20 Thread Gabriel Genellina
En Mon, 21 Jan 2008 03:16:37 -0200, J. Peng [EMAIL PROTECTED] escribió: Dennis Lee Bieber 写道: The scope of name is the entire function; lacking a global name statement, AND being on the left side of an assignment, it is a function local name. Thank you. Does python have so-called

[issue1659] Tests needing network flag?

2008-01-20 Thread Georg Brandl
Georg Brandl added the comment: Sorry, I was being unclear. I grepped through Lib/test for skip_expected and couldn't find a location where e.g. the newly set test_urllib2.skip_expected would be accessed. regrtest.py only accesses this attribute on the two modules I named.

  1   2   3   >