ANN: CherryPy 3.1.0 beta3 Released

2008-01-13 Thread Christian Wyglendowski
Announcing CherryPy 3.1.0 beta3. The first beta was released about 3 months ago. There was a beta2 release that went largely unannounced in between. Here is a list of some of the changes from beta1 to beta3. Bugfixes: * log.screen now sends error messages to stderr

ANN: CherryPy 3.0.3 Released

2008-01-13 Thread Christian Wyglendowski
Announcing CherryPy 3.0.3. This release fixes two important bugs. 1) Security vulnerability when using file-based sessions (http://www.cherrypy.org/ticket/744). 2) A memory leak (http://www.cherrypy.org/ticket/718). A full log of the changes since 3.0.2 can be found here:

Re: super, decorators and gettattribute

2008-01-13 Thread Marc 'BlackJack' Rintsch
On Sat, 12 Jan 2008 14:23:52 -0800, Richard Szopa wrote: However, I am very surprised to learn that super_object.__getattr__(name)(*args, **kwargs) getattr(super_object, name)(*args, **kwargs) are not equivalent. This is quite odd, at least when with len() and .__len__, str() and

Re: __init__ explanation please

2008-01-13 Thread Daniel Fetchinson
Please keep discussion on the list.. I'm not sure if I understand your question correctly but maybe this will help: If you want code to be run upon creating an instance of your class you would use __init__. Most common examples include setting attributes on the instance and doing

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-13 Thread Martin v. Löwis
It seems to me that filenames are like snapshots of the locales where they originated. On Unix, yes. On Windows, NTFS and VFAT represent file names as Unicode strings always, independent of locale. POSIX file names are byte strings, and there isn't any good support for recording what their

Re: Elementary string-formatting

2008-01-13 Thread Odysseus
In article [EMAIL PROTECTED], John Machin [EMAIL PROTECTED] wrote: snip You obviously haven't tried float(n / m), or you wouldn't be asking. True, it was a very silly idea. Most legible and slowest first: 1. float(n) / float(m) 2. n / float(m) 3. 1.0 * n / m Recommendation: go with

Re: Elementary string-formatting

2008-01-13 Thread Odysseus
In article [EMAIL PROTECTED], Roberto Bonvallet [EMAIL PROTECTED] wrote: Put this at the beginning of your program: from __future__ import division This forces all divisions to yield floating points values: Thanks for the tip. May I assume the div operator will still behave as

Re: Elementary string-formatting

2008-01-13 Thread John Machin
On Jan 13, 8:43 pm, Odysseus [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED], Roberto Bonvallet [EMAIL PROTECTED] wrote: Put this at the beginning of your program: from __future__ import division This forces all divisions to yield floating points values: Thanks for the

Re: Graphics Module

2008-01-13 Thread Gabriel
On 11 ene, 22:51, Mike [EMAIL PROTECTED] wrote: On Jan 11, 3:31 pm, Gabriel [EMAIL PROTECTED] wrote: Hi all ! I'm developing a math program that shows graphics of functions. I would hear suggestions about the way of drawing 2D . Thanks a lot for your answers. - Gabriel - That's

Re: Elementary string-formatting

2008-01-13 Thread Odysseus
In article [EMAIL PROTECTED], Gary Herron [EMAIL PROTECTED] wrote: Odysseus wrote: snip print '%2u %6u %4.2f' % \ (i, wordcounts[i], 100.0 * wordcounts[i] / wordcounts[0]) Using 4.2 is the problem. The first digit (your 4) give the total number of characters to use for the

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-13 Thread Donn
Martin, Thanks, food for thought indeed. On Unix, yes. On Windows, NTFS and VFAT represent file names as Unicode strings always, independent of locale. POSIX file names are byte strings, and there isn't any good support for recording what their encoding is. I get my filenames from two

Re: Elementary string-formatting

2008-01-13 Thread Matt Nordhoff
Odysseus wrote: Hello, group: I've just begun some introductory tutorials in Python. Taking off from the word play exercise at http://www.greenteapress.com/thinkpython/html/book010.html#toc96 I've written a mini-program to tabulate the number of characters in each word in a file. Once

Re: ftplib question (cannot open data connection)

2008-01-13 Thread Laszlo Nagy
BUT: active FTP does not just send the data to the port that was in the random port that was sent to the server... it addresses to the port you sent, but it sends its data response FROM port 20. This means the response looks like a totally unsolicited connection attempt from the

Re: *** AMERICAN BASTARDS DESERVE TO BE RAPED ***

2008-01-13 Thread James Matthews
When did this list become a politics dialog? Please keep on topic Python! Thanks James On Jan 12, 2008 8:07 PM, Joe Riopel [EMAIL PROTECTED] wrote: On Jan 12, 2008 2:00 PM, radiosrfun [EMAIL PROTECTED] wrote: Whether we agree on tactics or not - if it come to a battlefield with the two of

paypal python library

2008-01-13 Thread mobiledreamers
I m trying to program the paypal for accepting payments Aret there python libraries for the same thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: [Kamaelia] TCPClient: How to sense connection failure?

2008-01-13 Thread Bjoern Schliessmann
Michael Sparks wrote: The behaviour you're seeing sounds odd (which is hopefully encouraging :-), but it's not clear from the description whether its a bug in your code or Kamaelia. One question I really have as a result is what version are you using? Oh sorry, it's the versions from MegaPack

Mailinglist/newsgroup gateway

2008-01-13 Thread Jeroen Ruigrok van der Werven
-On [20080112 23:30], Dan Upton ([EMAIL PROTECTED]) wrote: Why was this ever on the Python list (I assume it started as spam), and why on earth has it continued? The Python mailinglist is a gateway to/from comp.lang.python for all I know. So anything idiotic getting posted there might make its

Re: __init__ explanation please

2008-01-13 Thread Jeroen Ruigrok van der Werven
-On [20080113 01:41], Erik Lind ([EMAIL PROTECTED]) wrote: I'm new to Python, and OOP. I've read most of Mark Lutz's book and more online and can write simple modules, but I still don't get when __init__ needs to be used as opposed to creating a class instance by assignment. I personally tend

about sort a list with integer key

2008-01-13 Thread lotrpy
hi, if I want sort each line ,by the last part,of a file, below is the source. from operator import itemgetter content = (line.split() for line in file('foo.txt', 'rb')) for cursor, line in enumerate(sorted(content, key = itemgetter(-1), reverse = True)): print cursor, ' '.join(line) the

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-13 Thread Martin v. Löwis
I have found that os.listdir() does not always return unicode objects when passed a unicode path. Sometimes byte strings are returned in the list, mixed-in with unicodes. Yes. It does so when it fails to decode the byte string according to the file system encoding (which, in turn, bases on

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-13 Thread Donn
Martin, Yes. It does so when it fails to decode the byte string according to the file system encoding (which, in turn, bases on the locale). That's at least one way I can weed-out filenames that are going to give me trouble; if Python itself can't figure out how to decode it, then I can also

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-13 Thread Donn
So on *your* system, today: what encoding are the filenames encoded in? We are not talking about arbitrary files, right, but about font files? What *actual* file names do these font files have? On my system, all font files have ASCII-only file names, even if they are for non-ASCII

Re: about sort a list with integer key

2008-01-13 Thread Fredrik Lundh
lotrpy wrote: key = int(itemgetter(0)) is wrong, key = lambda x:int(x[0]) works. but s.b. told me itemgetter execute more quickly . so you're more interested in speed than in correctness? ;-) operator.itemgetter is a function factory that creates a *function* that fetches the given item

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-13 Thread Martin v. Löwis
I would advise against such a strategy. Instead, you should first understand what the encodings of the file names actually *are*, on a real system, and draw conclusions from that. I don't follow you here. The encoding of file names *on* a real system are (for Linux) byte strings of

Re: Simple List division problem

2008-01-13 Thread thebjorn
On Jan 12, 8:33 pm, Fredrik Lundh [EMAIL PROTECTED] wrote: marcstuart wrote: How do I divide a list into a set group of sublist's- if the list is not evenly dividable ? consider this example: x = [1,2,3,4,5,6,7,8,9,10] y = 3 # number of lists I want to break x into z = y/x

Re: sqlite3 is it in the python default distro?

2008-01-13 Thread Martin Marcher
On Saturday 12 January 2008 21:34 Martin Marcher wrote: a) Is sqlite included in the python default distribution b) In real life can I consider (on linux) that an installation of python includes the sqlite stuff? forgive my that was pebcack. I wasn't reading the docs fully so I thought I need

Re: about sort a list with integer key

2008-01-13 Thread Hrvoje Niksic
lotrpy [EMAIL PROTECTED] writes: if i want sort each line by the first part,(it's a integer, in fact). don't know how to do it with itemgetter. key = int(itemgetter(0)) is wrong, key = lambda x:int(x[0]) works. but s.b. told me itemgetter execute more quickly . Use lambda when it works

Re: __init__ explanation please

2008-01-13 Thread Fredrik Lundh
Erik Lind wrote: I'm new to Python, and OOP. I've read most of Mark Lutz's book and more online and can write simple modules, but I still don't get when __init__ needs to be used as opposed to creating a class instance by assignment. nothing is ever created by plain assignment in Python; to

Re: __init__ explanation please

2008-01-13 Thread Fredrik Lundh
Jeroen Ruigrok van der Werven wrote: I personally tend to see __init__ or __new__ as equivalent to what other languages call a constructor. (And I am sure some people might disagree with that. ;)) given that they do different things, I'm not sure it's that helpful to describe them *both*

Re: super, decorators and gettattribute

2008-01-13 Thread Richard Szopa
On Jan 13, 8:59 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Sat, 12 Jan 2008 14:23:52 -0800, Richard Szopa wrote: However, I am very surprised to learn that super_object.__getattr__(name)(*args, **kwargs) getattr(super_object, name)(*args, **kwargs) are not equivalent.

Re: Magic function

2008-01-13 Thread R�diger Werner
Well as I understand your problem now, you would not like all instances of an specific object that are still alive, but all references to an object (created somewhere, sometimes) in an local context (stack frame), that are accessible from 'that' context ( but also from many others). However in

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-13 Thread Martin v. Löwis
I guess I'm confused by that. I can ls them, so they appear and thus have characters displayed. I can open and cat them and thus the O/S can access them, but I don't know whether their characters are strictly in ascii-limits or drawn from a larger set like unicode. I mean, I have seen

Re: Simple List division problem

2008-01-13 Thread Fredrik Lundh
thebjorn wrote: Eh... oh, forgot that it was pulling requirements out of thin air week on c.l.python. def chop(lst, length): n = len(lst) / length z = [lst[i:i+n] for i in xrange(0, len(lst), n)] if len(z[-1]) n and len(z) 1: z[-2].extend(z.pop(-1)) return z

Re: __init__ explanation please

2008-01-13 Thread Ben Finney
Jeroen Ruigrok van der Werven [EMAIL PROTECTED] writes: -On [20080113 01:41], Erik Lind ([EMAIL PROTECTED]) wrote: I'm new to Python, and OOP. I've read most of Mark Lutz's book and more online and can write simple modules, but I still don't get when __init__ needs to be used as opposed

Re: Simple List division problem

2008-01-13 Thread thebjorn
On Jan 13, 1:05 pm, thebjorn [EMAIL PROTECTED] wrote: On Jan 12, 8:33 pm, Fredrik Lundh [EMAIL PROTECTED] wrote: marcstuart wrote: How do I divide a list into a set group of sublist's- if the list is not evenly dividable ? consider this example: x = [1,2,3,4,5,6,7,8,9,10] y = 3

Re: about sort a list with integer key

2008-01-13 Thread lotrpy
On 1月13日, 下午8时32分, Hrvoje Niksic [EMAIL PROTECTED] wrote: Use lambda when it works better for you, the speed difference is marginal in practice anyway. itemgetter is not (and was never intended to be) a general substitute for functions, as you've discovered. The marginal speed difference

Re: Simple List division problem

2008-01-13 Thread Paul Rubin
thebjorn [EMAIL PROTECTED] writes: Perhaps something like this? def chop(lst, length): from itertools import islice it = iter(lst) z = [list(islice(it, length)) for i in xrange(1 + len(lst) // length)] if len(z) 1: z[-2].extend(z.pop()) # the last item will be

Re: Simple List division problem

2008-01-13 Thread thebjorn
On Jan 13, 2:02 pm, Fredrik Lundh [EMAIL PROTECTED] wrote: thebjorn wrote: Eh... oh, forgot that it was pulling requirements out of thin air week on c.l.python. Well, the OP requirements were to control the number of chunks, not the size of them, so I guess we both got it wrong initially.

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-13 Thread Donn
If you can all ls them, and if the file names come out right, then they'll have the same encoding. Could it not be that the app doing the output (say konsole) could be displaying a filename as best as it can (doing the ignore/replace) trick and using whatever fonts it can reach) and this would

Exceptions - How do you make it work like built-in exceptions?

2008-01-13 Thread Lie
A built-in exceptions, when raised, would print traceback that points out the offending code, like this: Traceback (most recent call last): File F:\dir\code.py, line 43, in module a = 1/0 --- ZeroDivisionError: integer division or modulo by zero a user-made exception, when raised, would

Re: super, decorators and gettattribute

2008-01-13 Thread thebjorn
On Jan 13, 1:51 pm, Richard Szopa [EMAIL PROTECTED] wrote: On Jan 13, 8:59 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Sat, 12 Jan 2008 14:23:52 -0800, Richard Szopa wrote: However, I am very surprised to learn that super_object.__getattr__(name)(*args, **kwargs)

Re: Exceptions - How do you make it work like built-in exceptions?

2008-01-13 Thread Chris
On Jan 13, 4:14 pm, Lie [EMAIL PROTECTED] wrote: A built-in exceptions, when raised, would print traceback that points out the offending code, like this: Traceback (most recent call last): File F:\dir\code.py, line 43, in module a = 1/0 --- ZeroDivisionError: integer division or

i am new guy for this discussion group

2008-01-13 Thread bill.wu
i am new guy to learn python,also for this discussion group, i am chinese. nice to meet you, everyone. -- http://mail.python.org/mailman/listinfo/python-list

wxpython-wx.CheckListBox: changing item bacgkground color

2008-01-13 Thread Massi
Hi everyone! In my application (under windows) I'm using a wx.checklistbox. I would like the background color of an item to become red whenever an EVT_LISTBOX_DCLICK occurs. Is there any simple way to achieve it? Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get user home directory on Windows

2008-01-13 Thread Tim Golden
thebjorn wrote: On Jan 12, 6:50 pm, Giampaolo Rodola' [EMAIL PROTECTED] wrote: Update. I found a way for getting the home directory of the user but it requires to validate the user by providing username+password: def get_homedir(username, password): token = win32security.LogonUser(

Re: How to get user home directory on Windows

2008-01-13 Thread thebjorn
On Jan 12, 6:50 pm, Giampaolo Rodola' [EMAIL PROTECTED] wrote: Update. I found a way for getting the home directory of the user but it requires to validate the user by providing username+password: def get_homedir(username, password): token = win32security.LogonUser( username,

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-13 Thread Martin v. Löwis
Could it not be that the app doing the output (say konsole) could be displaying a filename as best as it can (doing the ignore/replace) trick and using whatever fonts it can reach) and this would disguise the situation? No. It may use replacement characters (i.e. a question mark, or an empty

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-13 Thread Donn
No. It may use replacement characters (i.e. a question mark, or an empty square box), but if you don't see such characters, then the terminal has successfully decoded the file names. Whether it also correctly decoded them is something for you to check (i.e. do they look right?) Okay. So, the

Re: where do my python files go in linux?

2008-01-13 Thread Florian Diesch
Jorgen Bodde [EMAIL PROTECTED] wrote: I am trying to make a debian package. I am following the tutorial by Horst Jens (http://showmedo.com/videos/video?name=linuxJensMakingDebfromSeriesID=37) and it is very informative. However one thing my app has and his doesn't, is multiple python files

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-13 Thread Martin v. Löwis
What happens if there is a filename that cannot be represented in it's entirety? i.e. every character is 'replaced'. Does it simply vanish, or does it appear as ? ? :) The latter. I did open(u\u20ac\u20ac,w) in an UTF-8 locale, then did LANG=C ls, and it gave me ?? (as the two

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-13 Thread Donn
Martin, I want to thank you for your patience, you have been sterling. I have an overview this evening that I did not have this morning. I have started fixing my code and the repairs may not be that extreme after all. I'll hack-on and get it done. I *might* bug you again, but I'll resist at

Re: i am new guy for this discussion group

2008-01-13 Thread [EMAIL PROTECTED]
On Jan 13, 3:03 pm, bill.wu [EMAIL PROTECTED] wrote: i am new guy to learn python,also for this discussion group, i am chinese. nice to meet you, everyone. Hi and welcome onboard. If you're new to programming in general, you may want to join the tutor mailing-list.

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-13 Thread Donn
Well, that didn't take me long... Can you help with this situation? I have a file named MÖgul.pog in this directory: /home/donn/.fontypython/ I set my LANG=C Now, I want to open that file from Python, and I create a path with os.path.join() and an os.listdir() which results in this byte string:

Re: Exceptions - How do you make it work like built-in exceptions?

2008-01-13 Thread Mark Tolonen
Lie [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] A built-in exceptions, when raised, would print traceback that points out the offending code, like this: Traceback (most recent call last): File F:\dir\code.py, line 43, in module a = 1/0 --- ZeroDivisionError: integer

Re: *SPAM*: 06.2/6.0 - Re: Manually installing PIL

2008-01-13 Thread j igisbert.etra-id
Dear Fredik, I have tried to copy PIL folder into my application folder. I am using Tkinter also, and when I want to put an image as label I do: photo1 = Image.open(rMyimage.gif) photo = ImageTk.PhotoImage(photo1) llogo =Label(root, image=photo,bg=white,height=60) And I receive an

time.time or time.clock

2008-01-13 Thread Ron Adam
I'm having some cross platform issues with timing loops. It seems time.time is better for some computers/platforms and time.clock others, but it's not always clear which, so I came up with the following to try to determine which. import time # Determine if time.time is better than

Re: Manually installing PIL

2008-01-13 Thread Fredrik Lundh
j igisbert.etra-id wrote: this. I have download Imaging-1.1.6 source code, and I found PIL folder, but not binary file. If I download windows exe installer, it works great, but I want to install manually for installing it on my PDA as the name implies, the source code distribution

Re: Great Python books for the beginner

2008-01-13 Thread Graeme Glass
On Jan 12, 9:03 am, Landon [EMAIL PROTECTED] wrote: Hi, I'm a freshman in college and I'm going to be taking an intro to programming course next semester which mainly uses Python, so I thought it might be a good time to pick up Python beyond the scope of the class as well. The text book for

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-13 Thread Martin v. Löwis
Now, I want to open that file from Python, and I create a path with os.path.join() and an os.listdir() which results in this byte string: paf = ['/home/donn/.fontypython/M\xc3\x96gul.pog'] I *think* that the situation is impossible because the system cannot resolve the correct filename

Re: LANG, locale, unicode, setup.py and Debian packaging

2008-01-13 Thread Donn
Now you are mixing two important concepts - the *contents* of the file with the *name* of the file. Then I suspect the error may be due to the contents having been written in utf8 from previous runs. Phew! It's bedtime on my end, so I'll try it again when I get a chance during the week.

Re: *SPAM*: 04.6/4.0 - Re: Manually installing PIL

2008-01-13 Thread j igisbert.etra-id
My PDA runs with Windows Mobile 2003 SE could you or someone please explain me what to do? Thanks a lot for your effort. -Original Message- From: Fredrik Lundh [EMAIL PROTECTED] To: python-list@python.org Date: Sun, 13 Jan 2008 21:18:37 +0100 Subject: *SPAM*: 04.6/4.0 - Re:

Slicing wrapped numpy arrays

2008-01-13 Thread Martin Manns
Hi, I have created a class that wraps a numpy array of custom objects. I would like to be able to slice respective objects (without copying the array if possible). I have browsed the doc and found some hints at __getitem__. However, I still do not grasp how to do it. How do I implement

Re: time.time or time.clock

2008-01-13 Thread John Machin
On Jan 14, 7:05 am, Ron Adam [EMAIL PROTECTED] wrote: I'm having some cross platform issues with timing loops. It seems time.time is better for some computers/platforms and time.clock others, but Care to explain why it seems so? it's not always clear which, so I came up with the following to

Re: Slicing wrapped numpy arrays

2008-01-13 Thread Robert Kern
Martin Manns wrote: Hi, I have created a class that wraps a numpy array of custom objects. I would like to be able to slice respective objects (without copying the array if possible). I have browsed the doc and found some hints at __getitem__. However, I still do not grasp how to do it.

Re: time.time or time.clock

2008-01-13 Thread Fredrik Lundh
John Machin wrote: AFAICT that was enough indication for most people to use time.clock on all platforms ... which was unfortunate, given that time.clock() isn't even a proper clock on most Unix systems; it's a low-resolution sample counter that can happily assign all time to a process that

Re: paging in python shell

2008-01-13 Thread Tim Roberts
Alex K [EMAIL PROTECTED] wrote: Does anyone know if the python shell supports paging or if I should look into iPython? Thank you so much. Paging is an overloaded term. What do you mean, exactly? Do you mean something like piping the output into more? The Python shell does that for the help

Re: converting JSON to string

2008-01-13 Thread Gowri
On Jan 12, 2:58 am, Jeroen Ruigrok van der Werven [EMAIL PROTECTED] nomine.org wrote: -On [20080112 08:38], Gowri ([EMAIL PROTECTED]) wrote: Actually, I have one other problem after all this. I see that if I try to construct JSON output as above, it is of the form [{'isbn': u'1-56592-724-9',

Re: Slicing wrapped numpy arrays

2008-01-13 Thread Martin Manns
On Sun, 13 Jan 2008 16:03:16 -0600 Robert Kern [EMAIL PROTECTED] wrote: Martin Manns wrote: Hi, I have created a class that wraps a numpy array of custom objects. I would like to be able to slice respective objects (without copying the array if possible). I have browsed the doc

Re: How to get user home directory on Windows

2008-01-13 Thread Martin P. Hellwig
Giampaolo Rodola' wrote: Hi all, I'm trying to use the pywin32 extension to find out the user's home directory but currently I didn't find a solution yet. What I'd need to do is not getting the home directory of the currently logged in user but something like: get_homedir(frank)

Re: i am new guy for this discussion group

2008-01-13 Thread bill.wu
On Jan 14, 2:03 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Jan 13, 3:03 pm, bill.wu [EMAIL PROTECTED] wrote: i am new guy to learn python,also for this discussion group, i am chinese. nice to meet you, everyone. Hi and welcome onboard. If you're new to programming in general,

Re: import gzip error (please help)

2008-01-13 Thread syahreza.octadian
On Jan 11, 7:14 pm, Fredrik Lundh [EMAIL PROTECTED] wrote: the core zlib library (libz.so) isn't installed on your machine. but in my machine there is file -rwxr-xr-x 1 bin bin48576 Sep 20 2006 /usr/local/lib/ python2.5/lib-dynload/zlib.so if i have to install zlib library

Re: How to get user home directory on Windows

2008-01-13 Thread Tim Golden
Martin P. Hellwig wrote: Giampaolo Rodola' wrote: Hi all, I'm trying to use the pywin32 extension to find out the user's home directory but currently I didn't find a solution yet. What I'd need to do is not getting the home directory of the currently logged in user but something like:

Re: Great Python books for the beginner

2008-01-13 Thread MooJoo
In article [EMAIL PROTECTED], GeneralCody [EMAIL PROTECTED] wrote: On 2008-01-12 08:03:42 +0100, Landon [EMAIL PROTECTED] said: Hi, I'm a freshman in college and I'm going to be taking an intro to programming course next semester which mainly uses Python, so I thought it might be a good

Re: Slicing wrapped numpy arrays

2008-01-13 Thread Robert Kern
Martin Manns wrote: On Sun, 13 Jan 2008 16:03:16 -0600 Robert Kern [EMAIL PROTECTED] wrote: Martin Manns wrote: Hi, I have created a class that wraps a numpy array of custom objects. I would like to be able to slice respective objects (without copying the array if possible). I have

Threaded server

2008-01-13 Thread Giampaolo Rodola'
Hi, I'm trying to run an asynchronous FTP server I wrote into a thread for being able to run a test suite against it. The code below is the threaded FTP server code I'm using: --- snippet --- class FTPd(threading.Thread): def __init__(self): self.active = False

Re: time.time or time.clock

2008-01-13 Thread Ron Adam
John Machin wrote: On Jan 14, 7:05 am, Ron Adam [EMAIL PROTECTED] wrote: I'm having some cross platform issues with timing loops. It seems time.time is better for some computers/platforms and time.clock others, but Care to explain why it seems so? it's not always clear which, so I came

Re: time.time or time.clock

2008-01-13 Thread Ron Adam
Fredrik Lundh wrote: John Machin wrote: AFAICT that was enough indication for most people to use time.clock on all platforms ... which was unfortunate, given that time.clock() isn't even a proper clock on most Unix systems; it's a low-resolution sample counter that can happily assign

(bit)torrent source code help

2008-01-13 Thread Astan Chee
Hi, Im using windows XP and I was wondering if anyone had any experience in compiling (using py2exe) the official bittorrent client ( http://download.bittorrent.com/dl/BitTorrent-5.2.0.tar.gz ) or any bittorrent client open source and written in python. I ask since I am trying to make several

Recieving emails in python

2008-01-13 Thread mobiledreamers
I m trying to create something simple a mailing list similar to yahoo groups I m stumbling at the part where the python recieves messages via say [EMAIL PROTECTED] how to make python recieve emails and process it after that it is straight forward processing in python inserting in db etc --

Re: Recieving emails in python

2008-01-13 Thread mobiledreamers
ok i dont want to write an mta i want to use another mta to recieve emails on say - [EMAIL PROTECTED] so can i start reading the emails to python from that mta How to set this up to read messages from the mta sending out email we are using sendmail so we ll continue using that for now thanks

Re: Recieving emails in python

2008-01-13 Thread Shane Geiger
[EMAIL PROTECTED] wrote: I m trying to create something simple a mailing list similar to yahoo groups I m stumbling at the part where the python recieves messages via say [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] how to make python recieve emails and process it after that it is straight

Re: where do my python files go in linux?

2008-01-13 Thread A.T.Hofkamp
On 2008-01-12, Jorgen Bodde [EMAIL PROTECTED] wrote: Question 1. Where do I put the bulk of python scripts in a normal linux environment? Question 2. Should I use *.pyc rather then *.py files to speed up executing as the user cannot write to /usr/bin or any other dir in the system and

[issue1816] sys.cmd_flags patch

2008-01-13 Thread Christian Heimes
Christian Heimes added the comment: The new patch is using a struct sequence (like the result of os.stat): import sys sys.flags sys.flags (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) dir(sys.flags) ['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', '__ge__',

[issue1550] help('modules') broken by several 3rd party libraries (svn patch attached)

2008-01-13 Thread Ka-Ping Yee
Ka-Ping Yee added the comment: Committed the patch in revision 59939. I'm not clear how it was determined that importing every module was necessary in order to list the modules or scan their synopsis lines (this seems to have happened in revision 45510). This can probably be made more

[issue1367711] Remove usage of UserDict from os.py

2008-01-13 Thread Andrew Dalke
Andrew Dalke added the comment: Ahh, so the bug here that the environ dict should use neither UserDict nor dict, it should implement the core {get,set,del}item and keys and use DictMixin. Martin mentioned that the patch doesn't support setdefault. He didn't note though that the current code

[issue1700288] Armin's method cache optimization updated for Python 2.6

2008-01-13 Thread Georg Brandl
Georg Brandl added the comment: Backed out again in r59940 -- test_ctypes fails in test_incomplete.py. Armin reports that with his original patch on 2.4, this test passes. _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1700288

[issue1700288] Armin's method cache optimization updated for Python 2.6

2008-01-13 Thread Kevin Jacobs
Kevin Jacobs added the comment: All tests passed when I first ported Armin's patch to 2.6. I'll have a chance to look into this later in the week. If anyone gets to it first, please summarize your findings here to avoid duplication of effort. _ Tracker

[issue1472] Small bat files to build docs on Windows

2008-01-13 Thread Georg Brandl
Georg Brandl added the comment: FTR, I'm currently removing all 2.5isms from Sphinx. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1472 __ ___ Python-bugs-list mailing list

[issue1814] Victor Stinner's GMP patch for longs

2008-01-13 Thread Christian Heimes
Christian Heimes added the comment: Why was the mpz module removed from Python 2.4 in the first place? 2.3 has it. I see three way to implement the option: * Let somebody implement a mpz type as a 3rd party extension. * Let somebody implement a mpt type and ship it with the Python core *

[issue1816] sys.cmd_flags patch

2008-01-13 Thread Guido van Rossum
Guido van Rossum added the comment: Can't you use a namedtuple? Then printing it would show the names of the flags... __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1816 __ ___

[issue1816] sys.cmd_flags patch

2008-01-13 Thread Christian Heimes
Christian Heimes added the comment: Guido van Rossum wrote: Can't you use a namedtuple? Then printing it would show the names of the flags... ... and increase the startup costs of Python by loading several additional modules. The collections module imports _collections, operator and keyword.

[issue1816] sys.cmd_flags patch

2008-01-13 Thread Guido van Rossum
Guido van Rossum added the comment: I'd rather see a better repr function for the sequence types. Agreed. It's kind of unfortunate that we have two implementations for the same concept, one in C and one in Python. __ Tracker [EMAIL PROTECTED]

[issue1816] sys.cmd_flags patch

2008-01-13 Thread Christian Heimes
Christian Heimes added the comment: I've coded sys.flags for my per-user site-packages PEP. I could make it a function but the function would be called by site.py on every startup. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1816

[issue1778] SyntaxError.offset sometimes wrong

2008-01-13 Thread Achim Gaedke
Achim Gaedke added the comment: sometimes offset is None... Example: def blub(bla, blub=None, blabla): bla causes: non-default argument follows default argument Added file: http://bugs.python.org/file9150/compile_test.py __ Tracker [EMAIL PROTECTED]

[issue1818] Add named tuple reader to CSV module

2008-01-13 Thread Raymond Hettinger
New submission from Raymond Hettinger: Here's a proof-of-concept patch. If approved, will change from generator form to match the other readers and will add a test suite. The idea corresponds to what is currently done by the dict reader but returns a space and time efficient named tuple

[issue1771] Remove cmp parameter to list.sort() and builtin.sorted()

2008-01-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: Let's do this. It is a nice simplification and makes the sort tools easier to learn and use. -- assignee: - rhettinger resolution: - accepted __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1771

[issue923643] long - byte-string conversion

2008-01-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Unless I'm mistaken, the patch provides only half of the solution: the stringToLong part, but not longToString. I agree this feature is interesting, not for optimization but becomes it avoids using clunky ways (long - hex - bin) to implement something simple.

[issue1816] sys.cmd_flags patch

2008-01-13 Thread Christian Heimes
Christian Heimes added the comment: Does anybody see a problem with this repr slot implementation for structseq? It gives this output: os.stat(.) posix.stat_result st_mode=16832, st_ino=11666571L, st_dev=65025L, st_nlink=20, st_uid=1000, st_gid=1000, st_size=4096L, st_atime=1200261754,

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-01-13 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: _binary_float_to_ratio: Oops, fixed. Rational() now equals 0, but I'd like to postpone Rational('3/2') until there's a demonstrated need. I don't think it's as common a use as int('3'), and there's more than one possible format, so some real world experience

[issue1799] Per user site-packages and setup.py install --user patch

2008-01-13 Thread Christian Heimes
Christian Heimes added the comment: The new patch adds the -s option, checks for getuid() == geteuid() and adds sys.flags (see #1816). Added file: http://bugs.python.org/file9153/trunk_usersite3.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1799

  1   2   >