ANN: Release 1.9.1 of SimPy (Simulation in Python) package

2008-03-18 Thread kgmuller
We announce the availability of SimPy version 1.9.1. This is an important bug-fix release of SimPy 1.9 which any user of SimPy 1.9 should download. SimPy 1.9.1 can be downloaded from http://sourceforge.net/project/showfiles.php?group_id=62366 . The SimPy homepage is at

Colorado Python training in May

2008-03-18 Thread lutz
Python author and trainer Mark Lutz will be teaching another 3-day Python class at a conference center in Longmont, Colorado, on May 14-16, 2008. This is a public training session open to individual enrollments, and covers the same topics as the 3-day onsite sessions that Mark teaches, with

Re: writing to a binary file without intervening spaces

2008-03-18 Thread Larry
On Mar 18, 1:32 pm, Paul Rubin http://[EMAIL PROTECTED] wrote: Larry [EMAIL PROTECTED] writes: It seems to me that Python always add intervening spaces between data elements when writing to a file It's just the print statement that does that. I doubt that. I tried one small file, I opened

Re: Cost of Queue.put

2008-03-18 Thread Gabriel Genellina
On 18 mar, 01:13, James [EMAIL PROTECTED] wrote: Basically, what I need is a multi-process safe persistent quick queue. The arrangement I had was a simple XML-RPC service running on the web server which the various web server threads POST the relevant search engine updates to. These updates

Re: ctypes in python failed to honor c_int

2008-03-18 Thread Jerry Fleming
Gabriel Genellina wrote: On 17 mar, 23:57, Jerry Fleming [EMAIL PROTECTED] wrote: I have a binary file written with c structures. Each record contains a null-terminated string followed by two 4-bytes integers. I wrote a small segment of python code to parse this file in this way: [coe]

Re: urllib2.unquote() vs unicode

2008-03-18 Thread Gabriel Genellina
On 18 mar, 02:20, Maciej Bliziński [EMAIL PROTECTED] wrote: I've been hit by a urllib2.unquote() issue. Consider the following unit test: import unittest import urllib2 class UnquoteUnitTest(unittest.TestCase):    def setUp(self):        self.utxt = u'%C4%99'        self.stxt = '%C4%99'

Re: About reading Python code

2008-03-18 Thread hellt
On 18 мар, 03:57, sturlamolden [EMAIL PROTECTED] wrote: On 17 Mar, 04:54, WaterWalk [EMAIL PROTECTED] wrote: So I'm curious how to read code effectively. I agree that python code is clear, but when it becomes long, reading it can still be a hard work. First, I recommend that you write

Multiple Submits in HTML Forms - Cherrypy

2008-03-18 Thread Maurice LING
Hi, Assuming that I have this code for Cherrypy 3 class Welcome: def index(self): return form action=btn_handler method=POST input value=Add name=AddBtn type=submit input value=Edit name=EditBtn type=submit /form

Re: ctypes in python failed to honor c_int

2008-03-18 Thread Gabriel Genellina
On 18 mar, 04:12, Jerry Fleming [EMAIL PROTECTED] wrote: Gabriel Genellina wrote: On 17 mar, 23:57, Jerry Fleming [EMAIL PROTECTED] wrote: I have a binary file written with c structures. Each record contains a null-terminated string followed by two 4-bytes integers. I wrote a small

Re: Multiple Submits in HTML Forms - Cherrypy

2008-03-18 Thread Carsten Haese
On Tue, 2008-03-18 at 07:14 +, Maurice LING wrote: Hi, Assuming that I have this code for Cherrypy 3 class Welcome: def index(self): return form action=btn_handler method=POST input value=Add name=AddBtn type=submit input

please click here

2008-03-18 Thread [EMAIL PROTECTED]
please click here http://profile_myprofile.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't xmlrpclib.dumps just dump an empty value instead of nil/?

2008-03-18 Thread Marc 'BlackJack' Rintsch
On Mon, 17 Mar 2008 17:41:23 +0100, martin f krafft wrote: also sprach martin f krafft [EMAIL PROTECTED] [2008.03.16.1421 +0100]: Why doesn't it just yield 'params\nparam\nvalue//param\n/params\n' Or even just 'params\nparam/\n/params\n' There's a difference between those two.

Extending C++ with Python scripting: twin objects or proxy objects?

2008-03-18 Thread jdetaeye
Hi, I would like to use Python as a scripting language for a C++ framework I am working on. The most common approach for this seems to be a twin objects: the python and the C++ object have the same lifespan and are always linked to each other. My initial thinking was to use a proxy approach

Re: writing to a binary file without intervening spaces

2008-03-18 Thread Paul Rubin
Larry [EMAIL PROTECTED] writes: I even went further to opening the file using notepad, and did a search-and-replace for space characters. The result was what I desired: data,data,data... In Windows, you also have to make sure to open binary files in binary mode. --

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/205183 idiom

2008-03-18 Thread Gabriel Rossetti
Hello, I am reading core python python programming and it talks about using the idiom described on http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/205183 . I'm using python 2.5.1 and if I try : class MyClass(object): def __init__(self): self._foo = foo self._bar =

Re: Multiple Submits in HTML Forms - Cherrypy

2008-03-18 Thread Maurice LING
Carsten Haese wrote: On Tue, 2008-03-18 at 07:14 +, Maurice LING wrote: Hi, Assuming that I have this code for Cherrypy 3 class Welcome: def index(self): return form action=btn_handler method=POST input value=Add name=AddBtn type=submit

Re: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/205183 idiom

2008-03-18 Thread Carsten Haese
On Tue, 2008-03-18 at 09:06 +0100, Gabriel Rossetti wrote: Hello, I am reading core python python programming and it talks about using the idiom described on http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/205183 . I'm using python 2.5.1 and if I try : class MyClass(object):

Re: Regarding coding style

2008-03-18 Thread Marc 'BlackJack' Rintsch
On Mon, 17 Mar 2008 12:51:14 -0700, [EMAIL PROTECTED] wrote: On Mar 17, 12:15 pm, rockingred [EMAIL PROTECTED] wrote: On Mar 10, 11:30 am, [EMAIL PROTECTED] [EMAIL PROTECTED] Unfortunately, no free VC system existed for the language in which I was programming Explain? VC isn't

Decode email subjects into unicode

2008-03-18 Thread Laszlo Nagy
Hi All, 'm in trouble with decoding email subjects. Here are some examples: =?koi8-r?B?4tnT1NLP19nQz8zOyc3PIMkgzcHMz9rB1NLB1M7P?= [Fwd: re:Flags Of The World, Us States, And Military] =?ISO-8859-2?Q?=E9rdekes?= =?UTF-8?B?aGliw6Fr?= I know that =?UTF-8?B means UTF-8 + base64 encoding, but

Re: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/205183 idiom

2008-03-18 Thread Gabriel Rossetti
Carsten Haese wrote: On Tue, 2008-03-18 at 09:06 +0100, Gabriel Rossetti wrote: Hello, I am reading core python python programming and it talks about using the idiom described on http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/205183 . I'm using python 2.5.1 and if I try :

finding items that occur more than once in a list

2008-03-18 Thread Simon Forman
Is there a more efficient way to do this? def f(L): '''Return a set of the items that occur more than once in L.''' L = list(L) for item in set(L): L.remove(item) return set(L) | f([0, 0, 1, 1, 2, 2, 3]) set([0, 1, 2]) --

Re: Immutable and Mutable Types

2008-03-18 Thread Duncan Booth
Stargaming [EMAIL PROTECTED] wrote: On Mon, 17 Mar 2008 16:03:19 +, Duncan Booth wrote: For the answer I actually want each asterisk substitutes for exactly one character. Played around a bit and found that one: Python 3.0a3+ (py3k:61352, Mar 12 2008, 12:58:20) [GCC 4.2.3 20080114

Re: Comunicate processes with python

2008-03-18 Thread Adrián Bravo Navarro
Hi, Does the absence of answers mean that the unique way to let the console invoke daemon functions is trough dbus or sockets? I wonder if python provides any other mechanism to get this. Thanks Adrian 2008/3/17, Adrián Bravo Navarro [EMAIL PROTECTED]: Hi, let me introduce ourselves first.

Re: Convert binary file

2008-03-18 Thread Tim Golden
Diez B. Roggisch wrote: Vamp4L schrieb: Hello, Specifically, I'm trying to convert the Internet Explorer history file (index.dat) into a readable format. Anyone done something similar or know of any functions that may help with such a task? I'm not sure exactly what kind of file the

Re: Decode email subjects into unicode

2008-03-18 Thread Laszlo Nagy
Sorry, meanwhile i found that email.Headers.decode_header can be used to convert the subject into unicode: def decode_header(self,headervalue): val,encoding = decode_header(headervalue)[0] if encoding: return val.decode(encoding) else: return val However, there are malformed emails and I

detect current timezone set by kde

2008-03-18 Thread Pradnyesh Sawant
Hello, can someone please tell me how can I programatically detect the timezone information that has been set through kde? basically, I have a small pyqt4 app which shows the current time. however it shows me my system time (dunno where that is stored; basically it shows me time in IST). however,

Program source implemented in non-text storage (was: Regarding coding style)

2008-03-18 Thread Ben Finney
Marc 'BlackJack' Rintsch [EMAIL PROTECTED] writes: [A general VCS] depends usually on the fact that there are individual files. Preferably text files if you want automagic merging of different changes. Yes. Now think of languages that are tightly coupled with their IDE storing only binary

Re: finding items that occur more than once in a list

2008-03-18 Thread Chris
On Mar 18, 11:57 am, Simon Forman [EMAIL PROTECTED] wrote: Is there a more efficient way to do this? def f(L):     '''Return a set of the items that occur more than once in L.'''     L = list(L)     for item in set(L):         L.remove(item)     return set(L) | f([0, 0, 1, 1, 2, 2, 3])

Re: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/205183 idiom

2008-03-18 Thread Gabriel Rossetti
Carsten Haese wrote: On Tue, 2008-03-18 at 09:06 +0100, Gabriel Rossetti wrote: Hello, I am reading core python python programming and it talks about using the idiom described on http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/205183 . I'm using python 2.5.1 and if I try :

Re: stdout custom

2008-03-18 Thread castironpi
On Mar 17, 8:16 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: On 17 mar, 19:43, [EMAIL PROTECTED] wrote: Can I allocate a second console window, so I can place certain output to that directly, and leave the original streams alone?  I tried some things in subprocess (Py 3a3 /WinXP) but

[no subject]

2008-03-18 Thread Tom Stambaugh
Duncan Booth [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I've also just spent a while getting simplejson 1.7.4 to install on a (non- windows) system without a C compiler. The trick is to unzip the tar file and then before you try to install it delete everything in

RE: Decode email subjects into unicode

2008-03-18 Thread Ryan Ginstrom
On Behalf Of Laszlo Nagy =?koi8-r?B?4tnT1NLP19nQz8zOyc3PIMkgzcHMz9rB1NLB1M7P?= [Fwd: re:Flags Of The World, Us States, And Military] =?ISO-8859-2?Q?=E9rdekes?= =?UTF-8?B?aGliw6Fr?= Try this code: from email.header import decode_header def getheader(header_text, default=ascii):

Get actual call signature?

2008-03-18 Thread Jarek Zgoda
Say, I have a function defined as: def fun(arg_one, arg_two='x', arg_three=None): pass Is there any way to get actual arguments that will be effectively used when I call this function in various ways, like: fun(5) = [5, 'x', None] fun(5, arg_three=['a', 'b']) = [5, 'x', ['a', 'b']] fun(5,

Re: Anomaly in time.clock()

2008-03-18 Thread Godzilla
Thanks Roel. If there is a way to pass in the PRESERVE_PRECISION constant in the python time.clock library, that would be great. But I'm afraid it's not possible. I think I will change away from using time.clock() from now on... seems too edgy to me. Thank you for sharing your experience with me

Re: detect current timezone set by kde

2008-03-18 Thread Gerald Klix
I suggest to change /etc/timezone by invoking sudo tzselect. HTH, Gerald Pradnyesh Sawant schrieb: Hello, can someone please tell me how can I programatically detect the timezone information that has been set through kde? basically, I have a small pyqt4 app which shows the current time.

Re: win32: emulating select() on pipes

2008-03-18 Thread Bryan Olson
gangesmaster wrote: i'm trying to figure out if a pipe on win32 has data for me to read. [...] does anyone know of a better way to tell if data is available on a pipe? something that blocks until data is available or the timeout is elapsed, In Win32 WaitForMultipleObjects and

Re: finding items that occur more than once in a list

2008-03-18 Thread Paul Rubin
Simon Forman [EMAIL PROTECTED] writes: Is there a more efficient way to do this? http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/502263 -- http://mail.python.org/mailman/listinfo/python-list

Re: finding items that occur more than once in a list

2008-03-18 Thread Bryan Olson
Simon Forman wrote: Is there a more efficient way to do this? def f(L): '''Return a set of the items that occur more than once in L.''' L = list(L) for item in set(L): L.remove(item) return set(L) That's neat, but quadratic time because list.remove() requires a

Re: Python 3 and PEP238 division

2008-03-18 Thread Ninereeds
On Mar 17, 7:26 pm, Terry Reedy [EMAIL PROTECTED] wrote: Ninereeds [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | Is the PEP238 change to division going into Python 3 as planned? IDLE 3.0a3 1/2 0.5 | I realise that the new integer division semantics have been available | in

Re: finding items that occur more than once in a list

2008-03-18 Thread Ninereeds
Just to throw in one more alternative, if you sort your list, you only need to test adjacent items for equality rather than needing a search for each unique item found. You should get O(n log n) rather than O(n^2), since the performance bottleneck is now the sorting rather than the searching for

Re: Python 3 and PEP238 division

2008-03-18 Thread Marc 'BlackJack' Rintsch
On Tue, 18 Mar 2008 04:47:49 -0700, Ninereeds wrote: On Mar 17, 7:26 pm, Terry Reedy [EMAIL PROTECTED] wrote: 2.6, I have read, have optional 'Py3' warnings, and a 2to3 conversion program The tools can work out the *intent* of any particular division operator? Can work out whether the

automatically doing some cleaning-up by the process when the systems shuts down

2008-03-18 Thread bharath venkatesh
hi .. my programs runs as daemon and it does some logging .. when system shuts down .. which may be done manually . i want my process do some cleaning up automatically such as writing in to the log file when the process terminats before the system shuts down

Merging a patch/diff generated by difflib?

2008-03-18 Thread erikcw
Hi, I'm trying to create an undo/redo feature for a webapp I'm working on (django based). I'd like to have an undo/redo function. My first thought was to use the difflib to generate a diff to serve as the backup, and then if someone wants to undo their operation, the diff could just be

Re: how to create instances of classes without calling the constructor?

2008-03-18 Thread Steven D'Aprano
On Tue, 18 Mar 2008 01:08:45 +0100, Dominik Jain wrote: Hi! Does anyone know how an instance of a (new-style) class can be created without having to call the constructor (and providing the arguments it requires)? With old-style classes, this was possible using new.instance. Surely there

Re: Can't get bsddb working on Solaris 8

2008-03-18 Thread partofthething
I fixed it! I had omitted the cascade of exceptions, but the previous one to the one shown is: File /usr/local/lib/python2.5/dbhash.py, line 5, in module import bsddb So I just went into dbhash.py and changed line 5 to import bsddb3 as bsddb. Then everything started working as planned.

Re: stdout custom

2008-03-18 Thread Tim Golden
[EMAIL PROTECTED] wrote: Can I allocate a second console window, so I can place certain output to that directly, and leave the original streams alone? I've rather lost track of what you're trying to do, but I would second Gabriel's suggestion of the standard Windows method of debug output:

Re: Pycon disappointment

2008-03-18 Thread John DeRosa
On Mon, 17 Mar 2008 14:36:29 -0500, J. Clifford Dyer [EMAIL PROTECTED] wrote: Note to speakers: do not say x, y = tee(foo) say from itertools import tee x, y = tee(foo) or better (for pedagogical purposes) import itertools x, y = itertools.tee(foo) I was scratching my head

Re: About reading Python code

2008-03-18 Thread sturlamolden
On 18 Mar, 08:00, hellt [EMAIL PROTECTED] wrote: under Microsoft Visual Studio do you mean IronPython instance? AFAIK, with the latest VS 2008 you can develop for CPython and IronPython. http://blogs.msdn.com/haibo_luo/archive/2007/10/16/5482940.aspx --

Re: Interesting math problem

2008-03-18 Thread sturlamolden
On 18 Mar, 00:58, Jeff Schwab [EMAIL PROTECTED] wrote: def make_slope(distance, parts): if parts == 0: return [] q, r = divmod(distance, parts) if r and parts % r: q += 1 return [q] + make_slope(distance - q, parts - 1) Beautiful. If Python could

Problems building zlib module on RHEL

2008-03-18 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
I can't seem to get the zlib module to build on an RHEL box. I did the following: 1) Download zlib 1.2.3 2) configure;make;make install 3) Download python 2.5.2 4) configure;make;make install 5) import zlib = ImportError: No module named zlib In the make install step for python, I notice there

Re: PyCon video editing

2008-03-18 Thread amk
On Mar 17, 10:00 pm, dundeemt [EMAIL PROTECTED] wrote: Anyone know who is in charge of this? I'd like to help out if I could. I am, but haven't set anything up yet, such as a mailing list or a host for the video. I'll update the wiki page http://wiki.python.org/moin/PyConRecordingBof with

Re: finding items that occur more than once in a list

2008-03-18 Thread Hrvoje Niksic
Ninereeds [EMAIL PROTECTED] writes: The dictionary version Chris suggests (and the essentially equivalent set-based approach) is doing essentially the same thing in a way, but using hashing rather than ordering to organise the list and spot duplicates. This is *not* O(n) due to the rate of

Need to force SpamBayes to run.

2008-03-18 Thread Andoni
Hi all, I realise this is not the SpamBayes list but you could grow old waiting for that so trying here. We are using SpamBayes to filter messages coming in to a mailbox. It misses some messages with errors like what's below. When this happens we can go in and click Filter Messages and it runs

Re: finding items that occur more than once in a list

2008-03-18 Thread Ninereeds
Hrvoje Niksic wrote: This doesn't apply to Python, which implements dict storage as an open-addressed table and automatically (and exponentially) grows the table when the number of entries approaches 2/3 of the table size. Assuming a good hash function, filling the dict should yield

Re: Interesting math problem

2008-03-18 Thread Marc Christiansen
sturlamolden [EMAIL PROTECTED] wrote: On 18 Mar, 00:58, Jeff Schwab [EMAIL PROTECTED] wrote: def make_slope(distance, parts): if parts == 0: return [] q, r = divmod(distance, parts) if r and parts % r: q += 1 return [q] + make_slope(distance - q,

Need Help Starting Out

2008-03-18 Thread jmDesktop
Hi, I would like to start using Python, but am unsure where to begin. I know how to look up a tutorial and learn the language, but not what all technologies to use. I saw references to plain Python, Django, and other things. I want to use it for web building with database access. What do I use

lock access to serial port

2008-03-18 Thread [EMAIL PROTECTED]
hello group, how to get ttyS0 serial port for exclusive access? I have a python script that uses this device with AT commands. I need that two instances can call simultaneosuly this python script but only one of them gets the device. I tried fcntl.flock, it was just ignored, put writtable file

Re: Problems building zlib module on RHEL

2008-03-18 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
On Mar 18, 8:42 am, mhearne808[insert-at-sign-here]gmail[insert-dot- here]com [EMAIL PROTECTED] wrote: I can't seem to get the zlib module to build on an RHEL box. I did the following: 1) Download zlib 1.2.3 2) configure;make;make install 3) Download python 2.5.2 4) configure;make;make

globals() using For Loop against Generator

2008-03-18 Thread cokofreedom
if __name__ == '__main__': print Globals (For Loop): try: for i in globals(): print \t%s % i except RuntimeError: print Only some globals() printed\n else: print All globals() printed\n print Globals (Generator): try: print

Re: Decode email subjects into unicode

2008-03-18 Thread Jeffrey Froman
Laszlo Nagy wrote: I know that =?UTF-8?B means UTF-8 + base64 encoding, but I wonder if there is a standard method in the email package to decode these subjects? The standard library function email.Header.decode_header will parse these headers into an encoded bytestring paired with the

Re: Need Help Starting Out

2008-03-18 Thread rodmc
Hi, I would like to start using Python, but am unsure where to begin. I know how to look up a tutorial and learn the language, but not what all technologies to use. I saw references to plain Python, Django, and other things. Hi, For database stuff you can plug directly into either MySQL or

Re: Interesting math problem

2008-03-18 Thread Jeff Schwab
Marc Christiansen wrote: sturlamolden [EMAIL PROTECTED] wrote: On 18 Mar, 00:58, Jeff Schwab [EMAIL PROTECTED] wrote: def make_slope(distance, parts): if parts == 0: return [] q, r = divmod(distance, parts) if r and parts % r: q += 1 return [q] +

Re: Need Help Starting Out

2008-03-18 Thread D'Arcy J.M. Cain
On Tue, 18 Mar 2008 09:27:46 -0700 (PDT) rodmc [EMAIL PROTECTED] wrote: Hi, I would like to start using Python, but am unsure where to begin. I know how to look up a tutorial and learn the language, but not what all technologies to use. I saw references to plain Python, Django, and

Re: Fast 2D Raster Rendering with GUI

2008-03-18 Thread Miki
Hello Dave, Hi All. I've been formulating in my head a simple image editor. I actually started prototyping is some time ago in Java, but am liking Python more and more. My editor will be nowhere near the level of Gimp/ Photoshop, but I do need fast pixel level control and display. For

Re: Need Help Starting Out

2008-03-18 Thread Michael Mabin
Pylons is a Ruby on Rails-like web framework that allows you build dynamic web applications with a database backend. Here is a link to the Pylons web site: http://pylonshq.com/ On Tue, Mar 18, 2008 at 11:10 AM, jmDesktop [EMAIL PROTECTED] wrote: Hi, I would like to start using Python, but

Re: Strange problem with structs Linux vs. Mac

2008-03-18 Thread Martin Blume
Marc 'BlackJack' Rintsch schrieb I don't think this qualifies as a bug, but I am astonished that the struct module does not tell you whether you are big endian, you have to find out yourself with struct.unpack('@I', s)[0]==struct.unpack(I, s)[0] Maybe a little more compact and

Re: Comunicate processes with python

2008-03-18 Thread Joshua Kugler
Adrián Bravo Navarro wrote: Is there any simple way to achieve this goal? We've been thinking of sockets but Im not conviced at all with that. If you want to communicate between processes on the same host, yes, you can use DBus or a couple of the options here:

Re: finding items that occur more than once in a list

2008-03-18 Thread Raymond Hettinger
On Mar 18, 2:57 am, Simon Forman [EMAIL PROTECTED] wrote: Is there a more efficient way to do this? def f(L): '''Return a set of the items that occur more than once in L.''' L = list(L) for item in set(L): L.remove(item) return set(L) | f([0, 0, 1, 1, 2, 2, 3])

Re: globals() using For Loop against Generator

2008-03-18 Thread Mel
[EMAIL PROTECTED] wrote: if __name__ == '__main__': print Globals (For Loop): try: for i in globals(): print \t%s % i except RuntimeError: print Only some globals() printed\n else: print All globals() printed\n print Globals

Re: Pycon disappointment

2008-03-18 Thread perrygreenfield
Amen on the diamond keynotes and lightning talks. The lightning talks were a great disappointment. Sponsor talks (or any such talks pitched at selling or recruiting) should go in their own, clearly labeled group so those of us who don't care about them can avoid them. If there must diamond

Re: Fast 2D Raster Rendering with GUI

2008-03-18 Thread sturlamolden
On 18 Mar, 17:48, Miki [EMAIL PROTECTED] wrote: Apart from PIL, some other options are: 1. Most GUI frameworks (wxPython, PyQT, ...) give you a canvas object you can draw on Yes, but at least on Windows you will get a GDI canvas. GDI is slow. 2. A bit of an overkill, but you can use

Re: Comunicate processes with python

2008-03-18 Thread Adrián Bravo Navarro
That was what we were thinking of, so if there is not some kind of easy python magic we will probably use some sockets. Thanks!! 2008/3/18, Joshua Kugler [EMAIL PROTECTED]: Adrián Bravo Navarro wrote: Is there any simple way to achieve this goal? We've been thinking of sockets but Im not

Re: Fast 2D Raster Rendering with GUI

2008-03-18 Thread Chris Mellon
On Tue, Mar 18, 2008 at 12:30 PM, sturlamolden [EMAIL PROTECTED] wrote: On 18 Mar, 17:48, Miki [EMAIL PROTECTED] wrote: Apart from PIL, some other options are: 1. Most GUI frameworks (wxPython, PyQT, ...) give you a canvas object you can draw on Yes, but at least on Windows you will

Re: Merging a patch/diff generated by difflib?

2008-03-18 Thread Raymond Hettinger
On Mar 18, 6:08 am, erikcw [EMAIL PROTECTED] wrote: Hi, I'm trying to create an undo/redo feature for a webapp I'm working on (django based). I'd like to have an undo/redo function. My first thought was to use the difflib to generate a diff to serve as the backup, and then if someone wants

Re: Pycon disappointment

2008-03-18 Thread Mike Orr
On Mar 16, 6:10 am, Bruce Eckel [EMAIL PROTECTED] wrote: vendors: But it gets worse. The lightning talks, traditionally the best, newest and edgiest part of the conference, were also sold like commercial air time. We introduced sponsor lighting talks last year. This year it got out of hand

Re: Huge problem gettng MySQLdb to work on my mac mini running Macosx 10.5 Leopard

2008-03-18 Thread geert
On Mar 14, 1:15 pm, [EMAIL PROTECTED] wrote: look athttp://groups.google.be/group/comp.lang.python/browse_thread/thread/d... There is a macpython list that you can consult athttp://www.nabble.com/Python---pythonmac-sig-f2970.html Just wanted to let you know that I've solved my problem. The

Re: Regarding coding style

2008-03-18 Thread Tim Lesher
On Mar 9, 2:04 am, Ryan Ginstrom [EMAIL PROTECTED] wrote: On Behalf Of Grant Edwards I think docstrings are a great idea. What's needed is a way to document the signature that can't get out-of-sync with what the fucntion really expects. Like doctests? (I know, smart-ass response)

Re: Python Generators

2008-03-18 Thread Marius Gedminas
On Mar 16, 9:24 am, Matt Nordhoff [EMAIL PROTECTED] wrote: mpc wrote: def concatenate(sequences):     for seq in sequences:         for item in seq:             yield item You should check out itertools.chain(). It does this. You call it like chain(seq1, seq2, ...) instead of

Re: Get actual call signature?

2008-03-18 Thread castironpi
On Mar 18, 5:40 am, Jarek Zgoda [EMAIL PROTECTED] wrote: Say, I have a function defined as: def fun(arg_one, arg_two='x', arg_three=None):     pass Is there any way to get actual arguments that will be effectively used when I call this function in various ways, like: fun(5) = [5, 'x',

Re: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/205183 idiom

2008-03-18 Thread George Sakkis
On Mar 18, 6:03 am, Gabriel Rossetti [EMAIL PROTECTED] wrote: Carsten Haese wrote: On Tue, 2008-03-18 at 09:06 +0100, Gabriel Rossetti wrote: Hello, I am reading core python python programming and it talks about using the idiom described on

Re: PyCon Feedback and Volunteers (Re: Pycon disappointment)

2008-03-18 Thread fumanchu
On Mar 17, 6:25 pm, dundeemt [EMAIL PROTECTED] wrote: I agree - the balance wasn't as good. We can all agree that HowTos and Intros are a necessary part of the conference talks track, but as Robert pointed out some talks should be of a more advanced nature. I enjoy those that stretch my

Re: Pycon disappointment

2008-03-18 Thread George Sakkis
On Mar 18, 1:49 pm, Mike Orr [EMAIL PROTECTED] wrote: On Mar 16, 6:10 am, Bruce Eckel [EMAIL PROTECTED] wrote: vendors: On top of that, the quality of the presentations was unusually low. I did feel that. An advanced track would be a good idea. Because you do need to repeat stuff for the

Re: PyCon Feedback and Volunteers (Re: Pycon disappointment)

2008-03-18 Thread Mike Driscoll
On Mar 18, 1:41 pm, fumanchu [EMAIL PROTECTED] wrote: On Mar 17, 6:25 pm, dundeemt [EMAIL PROTECTED] wrote: I agree - the balance wasn't as good. We can all agree that HowTos and Intros are a necessary part of the conference talks track, but as Robert pointed out some talks should be of a

Re: Decode email subjects into unicode

2008-03-18 Thread John Machin
On Mar 18, 9:09 pm, Laszlo Nagy [EMAIL PROTECTED] wrote: Sorry, meanwhile i found that email.Headers.decode_header can be used to convert the subject into unicode: def decode_header(self,headervalue): val,encoding = decode_header(headervalue)[0] if encoding: return val.decode(encoding)

Re: stdout custom

2008-03-18 Thread castironpi
On Mar 18, 8:51 am, Tim Golden [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Can I allocate a second console window, so I can place certain output to that directly, and leave the original streams alone?   I've rather lost track of what you're trying to do, but I would second Gabriel's

Re: Fast 2D Raster Rendering with GUI

2008-03-18 Thread Ross Ridge
Chris Mellon [EMAIL PROTECTED] wrote: OpenGL is totally unsuitable if the goal is to implement your own pixel-level raster drawing. Unfornately, any solution involving Python is likely to be unsuitable if your goal is to set individual pixels one-by-one, and GDI would be no better than OpenGL

Re: Anomaly in time.clock()

2008-03-18 Thread John Machin
On Mar 18, 9:43 pm, Godzilla [EMAIL PROTECTED] wrote: Thanks Roel. If there is a way to pass in the PRESERVE_PRECISION constant in the python time.clock library, that would be great Re-read Roel's message. Something like PRESERVE_PRECISION is to be passed to whatever is setting up DirectX.

Re: PyCon Feedback and Volunteers (Re: Pycon disappointment)

2008-03-18 Thread Jeff Schwab
Mike Driscoll wrote: On Mar 18, 1:41 pm, fumanchu [EMAIL PROTECTED] wrote: On Mar 17, 6:25 pm, dundeemt [EMAIL PROTECTED] wrote: I agree - the balance wasn't as good. We can all agree that HowTos and Intros are a necessary part of the conference talks track, but as Robert pointed out some

method to create class property

2008-03-18 Thread Joe P. Cool
Hi, I like C#'s style of defining a property in one place. Can the following way to create a property be considered reasonable Python style (without the print statements, of course)? class sample(object): def __init__(self): sample.y = self._property_y() def _property_y(self):

Re: Get actual call signature?

2008-03-18 Thread Jarek Zgoda
[EMAIL PROTECTED] pisze: On Mar 18, 5:40 am, Jarek Zgoda [EMAIL PROTECTED] wrote: Say, I have a function defined as: def fun(arg_one, arg_two='x', arg_three=None): pass Is there any way to get actual arguments that will be effectively used when I call this function in various ways,

Re: Get actual call signature?

2008-03-18 Thread George Sakkis
On Mar 18, 6:40 am, Jarek Zgoda [EMAIL PROTECTED] wrote: Say, I have a function defined as: def fun(arg_one, arg_two='x', arg_three=None): pass Is there any way to get actual arguments that will be effectively used when I call this function in various ways, like: fun(5) = [5, 'x',

Re: finding items that occur more than once in a list

2008-03-18 Thread Hrvoje Niksic
Ninereeds [EMAIL PROTECTED] writes: As for the growth pattern, each time you grow the table you have to redistribute all the items previously inserted to new locations. Resizes would get rarer as more items are added due to the exponential growth, but every table resize would take longer too

Re: stdout custom

2008-03-18 Thread castironpi
Can I allocate a second console window, so I can place certain output to that directly, and leave the original streams alone?   I've rather lost track of what you're trying to do, but I would second Gabriel's suggestion of the standard Windows method of debug output: using

os.path.getsize() on Windows

2008-03-18 Thread Sean DiZazzo
Hi all, I'm seeing some behavior that is confusing me. I often use a simple function to tell if a file is growing...ie being copied into a certain location. (Can't process it until it's complete) My function is not working on windows, and I'm wondering if I am missing something simple, or if I

Re: method to create class property

2008-03-18 Thread Diez B. Roggisch
Joe P. Cool schrieb: Hi, I like C#'s style of defining a property in one place. Can the following way to create a property be considered reasonable Python style (without the print statements, of course)? class sample(object): def __init__(self): sample.y =

Colorado Python training in May

2008-03-18 Thread Mark Lutz
Python author and trainer Mark Lutz will be teaching another 3-day Python class at a conference center in Longmont, Colorado, on May 14-16, 2008. This is a public training session open to individual enrollments, and covers the same topics as the 3-day onsite sessions that Mark teaches, with

keyboard interrupt

2008-03-18 Thread John Fisher
Hi Group, I have been absent a while, mainly because I have been getting better at figuring out my own Python problems. But not this one... I have a timed loop performing certain tasks until a total period of time has elapsed. I would like to be able to interrupt the loop or set various flags

Re: finding items that occur more than once in a list

2008-03-18 Thread sturlamolden
On 18 Mar, 10:57, Simon Forman [EMAIL PROTECTED] wrote: def f(L): '''Return a set of the items that occur more than once in L.''' L = list(L) for item in set(L): L.remove(item) return set(L) def nonunique(lst): slst = sorted(lst) return list(set([s[0] for s

ftp recursively

2008-03-18 Thread Jeff Schwab
I need to move a directory tree (~9GB) from one machine to another on the same LAN. What's the best (briefest and most portable) way to do this in Python? I see that urllib has some support for getting files by FTP, but that it has some trouble distinguishing files from directories.

Re: finding items that occur more than once in a list

2008-03-18 Thread sturlamolden
On 18 Mar, 22:22, sturlamolden [EMAIL PROTECTED] wrote: def nonunique(lst): slst = sorted(lst) return list(set([s[0] for s in filter(lambda t : not(t[0]-t[1]), zip(slst[:-1],slst[1:]))])) Or perhaps better: def nonunique(lst): slst = sorted(lst) return list(set([s[0] for

  1   2   3   4   >