Re: Line segments, overlap, and bits

2008-03-27 Thread castironpi
On Mar 26, 9:16 pm, Paul Rubin http://[EMAIL PROTECTED] wrote: Sean Davis [EMAIL PROTECTED] writes: OR, NOT, etc.).  Any suggestions on how to (1) set up the bit string and (2) operate on 1 or more of them?  Java has a BitSet class that keeps this kind of thing pretty clean and high-level,

Re: copy file over LAN

2008-03-27 Thread Gabriel Genellina
En Thu, 27 Mar 2008 00:34:20 -0300, Astan Chee [EMAIL PROTECTED] escribió: I have a file on another machine on the local network (my machine and local machines are on windows) and I want to copy it locally. Now the machine requires authentication and when I try to do a import shutil

Re: copy file over LAN

2008-03-27 Thread Astan Chee
Well, the solution seems to be something like (windows only) import os import os.path import shutil import sys import win32wnet def wnet_connect(host, username, password): unc = ''.join(['', host]) try: win32wnet.WNetAddConnection2(0, None, unc, None, username, password)

counting using variable length string as base

2008-03-27 Thread Grimsqueaker
Hi, I'm fairly new to Python and to this list. I have a problem that is driving me insane, sorry if it seems simple to everyone, I've been fighting with it for a while. :)) I want to take a variable length string and use it as a base for counting, eg. given the string 'abc' the sequence would

Re: Python 2.2.1 and select()

2008-03-27 Thread Derek Martin
On Wed, Mar 26, 2008 at 07:11:15PM -0700, Noah Spurrier wrote: def set_nonblock(fd): flags = fcntl.fcntl(fd, fcntl.F_GETFL) fcntl.fcntl(fd, fcntl.F_SETFL, flags | os.O_NONBLOCK) Then in the function, after calling popen: set_nonblock(io.fromchild.fileno())

Re: counting using variable length string as base

2008-03-27 Thread Dan Bishop
On Mar 27, 1:15 am, Grimsqueaker [EMAIL PROTECTED] wrote: Hi, I'm fairly new to Python and to this list. I have a problem that is driving me insane, sorry if it seems simple to everyone, I've been fighting with it for a while. :)) I want to take a variable length string and use it as a base

Re: Plugin framework - Overcomplicating things?

2008-03-27 Thread Gabriel Genellina
En Thu, 27 Mar 2008 01:50:56 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: All this comes to my question - am I overcomplicating this project? I can understand the use of something like the trac component system if I had multiple components and plugins that handled different areas of

Re: How to convert latex-based docs written with Python 2.5 to 2.6 framework

2008-03-27 Thread Waldemar Osuch
On Mar 26, 1:37 pm, Michael Ströder [EMAIL PROTECTED] wrote: HI! I had a look on how Doc/ is organized with Python 2.6. There are files with suffix .rst. Hmm... I'm maintaing existing docs for python-ldap which I might have to convert to the new concept in the long run. What's the

Re: counting using variable length string as base

2008-03-27 Thread Grimsqueaker
That seems to give me the items in the list back in an iterator. Am I using it incorrectly? -- http://mail.python.org/mailman/listinfo/python-list

Re: counting using variable length string as base

2008-03-27 Thread castironpi
On Mar 27, 2:33 am, Grimsqueaker [EMAIL PROTECTED] wrote: That seems to give me the items in the list back in an iterator. Am I using it incorrectly? Use list( it ). -- http://mail.python.org/mailman/listinfo/python-list

Re: what does ^ do in python

2008-03-27 Thread Steven D'Aprano
On Wed, 26 Mar 2008 19:45:34 +0100, Heiko Wundram wrote: Am Mittwoch, 26. März 2008 19:04:44 schrieb David Anderson: HOw can we use express pointers as in C or python? There's no such thing as a pointer in Python, so you can't express them either. Was this what you were trying to ask? But

do 'os.path' include 'os' for us?

2008-03-27 Thread Jerry Fleming
Hi, I wrote a python script to list files in a directory but somehow did it wrongly by importing os.path instead of os. To my astonishment, it works just as charm: #!/usr/bin/python import os.path for file in os.listdir('/root/'): print file I was wondering why? os.path doesn't contain

Re: counting using variable length string as base

2008-03-27 Thread Diez B. Roggisch
Grimsqueaker schrieb: That seems to give me the items in the list back in an iterator. Am I using it incorrectly? No. Just put a list() around it. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: last mouse movment or keyboard hit

2008-03-27 Thread Diez B. Roggisch
Ron Eggler schrieb: Hi, I would like to get the time of the most recent human activity like a cursor movement or a key hit. Does anyone know how I can get this back to start some action after there has been no activity for X minutes/seconds? Try hooking yourself into the OS

Re: do 'os.path' include 'os' for us?

2008-03-27 Thread John Machin
On Mar 27, 6:41 pm, Jerry Fleming [EMAIL PROTECTED] wrote: Hi, I wrote a python script to list files in a directory but somehow did it wrongly by importing os.path instead of os. To my astonishment, it works just as charm: #!/usr/bin/python import os.path for file in os.listdir('/root/'):

Re: genetic algors in practical application

2008-03-27 Thread castironpi
On Mar 26, 9:55 pm, [EMAIL PROTECTED] wrote: I want to go in to construction.  However, 'I' means 'newsgroup' and 'want to go' means 'is'. If you had an army of two-micron spiders, could we build something? Use case is an American skyscraper. They have powerful tricks.  Clearly they can

Re: how to dynamically create class methods ?

2008-03-27 Thread Steven D'Aprano
On Wed, 26 Mar 2008 00:27:17 -0700, Arnaud Delobelle wrote: I'm hardly surprised. The naivety of those who insist that the best way to understand how new.function and new.code work is to look at the C source code for object is amusing. Since 'those who insist...' are just one person, me,

Re: how to dynamically create class methods ?

2008-03-27 Thread Steven D'Aprano
On Wed, 26 Mar 2008 00:55:22 -0700, Arnaud Delobelle wrote: [snip] Except it only *appears* to work. What happens if were store the instances in a list and then execute them all in one go? Ah yes, nicely spotted. Another solution would be to use a proper factory function: def

Partial Function Application and implicit self problem

2008-03-27 Thread Gabriel Rossetti
Hello, I am using Partial Function Application in a class and I've come up with a problem, when the method is called it tries to pass self to the curried/partial function, but this should be the first argument in reality, but since the function is curried, then the self gets passed as the

Re: Partial Function Application and implicit self problem

2008-03-27 Thread Diez B. Roggisch
Gabriel Rossetti schrieb: Hello, I am using Partial Function Application in a class and I've come up with a problem, when the method is called it tries to pass self to the curried/partial function, but this should be the first argument in reality, but since the function is curried, then

Re: Partial Function Application and implicit self problem

2008-03-27 Thread Gabriel Rossetti
Gabriel Rossetti wrote: Hello, I am using Partial Function Application in a class and I've come up with a problem, when the method is called it tries to pass self to the curried/partial function, but this should be the first argument in reality, but since the function is curried, then

Re: Partial Function Application and implicit self problem

2008-03-27 Thread Gabriel Rossetti
Diez B. Roggisch wrote: Gabriel Rossetti schrieb: Hello, I am using Partial Function Application in a class and I've come up with a problem, when the method is called it tries to pass self to the curried/partial function, but this should be the first argument in reality, but since

Re: counting using variable length string as base

2008-03-27 Thread Steven D'Aprano
On Thu, 27 Mar 2008 00:33:21 -0700, Grimsqueaker wrote: That seems to give me the items in the list back in an iterator. Am I using it incorrectly? Given an iterator, you use it like this: for item in iterator: print item # or do something else If you're sure that the iterator is

Re: py2exe socket.gaierror (10093)

2008-03-27 Thread Knut
On 26 Mar, 23:08, Thomas Heller [EMAIL PROTECTED] wrote: Knut schrieb: The script can't resolve the server name. Try to do it by hand using nslookup or even ping (you may want to add a few print statements inside the script to see the exact host name it is trying to connect to, in case

Re: counting using variable length string as base

2008-03-27 Thread Grimsqueaker
OK, got that. If I use: for x in string_cartesian_product('abc'): print x I get: a b c What am I not understanding? Thank you -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe socket.gaierror (10093)

2008-03-27 Thread Tim Golden
Python Programming on Win32 wrote: The problem is running smtplib in a py2exe compiled exe file. When it tries to establish a socket to the mail server it fails. Just wondering someone has encountered this before, and if someone might be able to point me in the right direction. Unhandled

Re: Py2exe embed my modules to libary.zip

2008-03-27 Thread vedrandekovic
On 26 ožu, 20:11, Gabriel Genellina [EMAIL PROTECTED] wrote: En Wed, 26 Mar 2008 15:38:16 -0300, Tzury Bar Yochay [EMAIL PROTECTED] escribió: and then when my application execute code how can I set path to d3dx module to library.zip/d3dx.py. I'm not sure is this properly set question.

Re: counting using variable length string as base

2008-03-27 Thread Peter Otten
Grimsqueaker wrote: That seems to give me the items in the list back in an iterator. Am I using it incorrectly? With Dan's functions in cartesian.py you can do the following: from cartesian import * def count(digits): ... args = [] ... while 1: ... args.append(digits)

Re: Partial Function Application and implicit self problem

2008-03-27 Thread Gabriel Genellina
En Thu, 27 Mar 2008 05:40:30 -0300, Gabriel Rossetti [EMAIL PROTECTED] escribió: if(atomic): # Lock the service dict and register the service, then unlock it self.__mutex.lock(reg, service) self.__mutex.unlock() I see that you've already solved your original

Re: Partial Function Application and implicit self problem

2008-03-27 Thread Bruno Desthuilliers
Gabriel Rossetti a écrit : Gabriel Rossetti wrote: Hello, I am using Partial Function Application in a class and I've come up with a problem, when the method is called it tries to pass self to the curried/partial function, but this should be the first argument in reality, but since the

Re: Partial Function Application and implicit self problem

2008-03-27 Thread Diez B. Roggisch
Gabriel Rossetti wrote: Gabriel Rossetti wrote: Hello, I am using Partial Function Application in a class and I've come up with a problem, when the method is called it tries to pass self to the curried/partial function, but this should be the first argument in reality, but since the

Re: A question on decorators

2008-03-27 Thread Bruno Desthuilliers
Tim Henderson a écrit : Hello I am writing an application that has a mysql back end and I have this idea to simplify my life when accessing the database. The idea is to wrap the all the functions dealing with a particular row in a particular in a particular table inside a class. So if you

Re: Py2exe embed my modules to libary.zip

2008-03-27 Thread Gabriel Genellina
En Thu, 27 Mar 2008 06:00:26 -0300, [EMAIL PROTECTED] escribió: I was add this into my application code: import sys import os my_dir=os.getcwd() sys.path.append(my_dir) sys.path.append(my_dir+\\libary.zip) sys.path.append(my_dir+\\libary.zip\\py2exe) # PY2EXE is folder f=open(path.txt,w)

Re: subtract dates with time module

2008-03-27 Thread Diez B. Roggisch
barronmo wrote: I'm trying to get the difference in dates using the time module rather than datetime because I need to use strptime() to convert a date and then find out how many weeks and days until that date. I'm a beginner so any help would be appreciated. Here is the code: Use strptime

Re: Why does python behave so? (removing list items)

2008-03-27 Thread Bruno Desthuilliers
Thomas Dybdahl Ahle a écrit : On Wed, 2008-03-26 at 23:04 +0100, Michał Bentkowski wrote: Why does python create a reference here, not just copy the variable? Python, like most other oo languages, will always make references for =, unless you work on native types (numbers and strings).

Re: Partial Function Application and implicit self problem

2008-03-27 Thread Gabriel Rossetti
Bruno Desthuilliers wrote: Gabriel Rossetti a écrit : Hello, I am using Partial Function Application in a class and I've come up with a problem, when the method is called it tries to pass self to the curried/partial function, but this should be the first argument in reality, but since

Re: Print to end of line in a terminal

2008-03-27 Thread ndlarsen
Hello again. I apologize for not replying earlier but I have been swamped in work lately. I appreciate your replies. Eventually I chose using curses for right-hand edge of the window as it seemed to be the most suitable solution. Thank you. ndlarsen --

Re: GUI toolkits with Tkinter's .pack() alternative

2008-03-27 Thread Guilherme Polo
2008/3/27, Alex9968 [EMAIL PROTECTED]: Guilherme Polo wrote: 2008/3/26, Alex9968 [EMAIL PROTECTED]: Hi all, I use Tkinter's Pack widget geometry manager (I really prefer it over using visual GUI designers), so my question is which other GUI toolkits have similar

Re: subtract dates with time module

2008-03-27 Thread John Machin
barronmo wrote: I'm trying to get the difference in dates using the time module rather than datetime because I need to use strptime() to convert a date and then find out how many weeks and days until that date. datetime.datetime.strptime was introduced in Python 2.5; what version are you

Re: what does ^ do in python

2008-03-27 Thread castironpi
On Mar 26, 1:36 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Wed, 26 Mar 2008 15:04:44 -0300, David Anderson [EMAIL PROTECTED]   escribió: HOw can we use express pointers as in C or python? Traceback (most recent call last):    File stdin, line 1, in module    File parser.py, line

Re: GUI toolkits with Tkinter's .pack() alternative

2008-03-27 Thread Alex9968
Guilherme Polo wrote: 2008/3/27, Alex9968 [EMAIL PROTECTED]: Guilherme Polo wrote: 2008/3/26, Alex9968 [EMAIL PROTECTED]: Hi all, I use Tkinter's Pack widget geometry manager (I really prefer it over using visual GUI designers), so my question is which other GUI toolkits

Re: Partial Function Application and implicit self problem

2008-03-27 Thread Bruno Desthuilliers
Gabriel Rossetti a écrit : Bruno Desthuilliers wrote: Gabriel Rossetti a écrit : (snip) registerServiceAtomic = partial(__registerService, True) registerServiceNonAtomic = partial(__registerService, False) I should pass self when applying partial, but then I can't do that since self is

Re: Plugin framework - Overcomplicating things?

2008-03-27 Thread André
On Mar 27, 3:31 am, Gabriel Genellina [EMAIL PROTECTED] wrote: En Thu, 27 Mar 2008 01:50:56 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: All this comes to my question - am I overcomplicating this project? I can understand the use of something like the trac component system if I

Re: what are generators?

2008-03-27 Thread castironpi
On Mar 25, 7:36 pm, Miki [EMAIL PROTECTED] wrote: On Mar 24, 8:17 am, [EMAIL PROTECTED] wrote: I'm looking for a cool trick using generators.  Know any exercises I can work? Simple one the comes to mind is flattening a list: list(flatten([1, [[2], 3], [[[4)) [1, 2, 3, 4] I don't

Re: Problem with write binary data to OLE field in Access

2008-03-27 Thread Tim Golden
lialie wrote: [... snip slightly confused indication that reading back a binary item using GetChunk appears to double its length ...] Well I don't know why this should be happening, but I do at least have a few suggestions: 1) Try using ADODB.Stream instead of GetChunk etc. 2) Try using the

Re: counting using variable length string as base

2008-03-27 Thread castironpi
On Mar 27, 4:01 am, Peter Otten [EMAIL PROTECTED] wrote: Grimsqueaker wrote: That seems to give me the items in the list back in an iterator. Am I using it incorrectly? With Dan's functions in cartesian.py you can do the following: from cartesian import * def count(digits): ...    

Re: GUI toolkits with Tkinter's .pack() alternative

2008-03-27 Thread Guilherme Polo
2008/3/27, Alex9968 [EMAIL PROTECTED]: Guilherme Polo wrote: 2008/3/27, Alex9968 [EMAIL PROTECTED]: Guilherme Polo wrote: 2008/3/26, Alex9968 [EMAIL PROTECTED]: Hi all, I use Tkinter's Pack widget geometry manager (I really prefer it over using visual GUI

Re: Partial Function Application and implicit self problem

2008-03-27 Thread castironpi
On Mar 27, 6:05 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: Gabriel Rossetti a écrit : Bruno Desthuilliers wrote: Gabriel Rossetti a écrit : (snip)   registerServiceAtomic = partial(__registerService, True) registerServiceNonAtomic = partial(__registerService, False)

Re: what are generators?

2008-03-27 Thread castironpi
On Mar 27, 6:19 am, [EMAIL PROTECTED] wrote: On Mar 25, 7:36 pm, Miki [EMAIL PROTECTED] wrote: On Mar 24, 8:17 am, [EMAIL PROTECTED] wrote: I'm looking for a cool trick using generators.  Know any exercises I can work? Simple one the comes to mind is flattening a list:

Psyco alternative

2008-03-27 Thread king kikapu
Hi, it seems that Psyco's author will not port it for the upcoming Python 3000 release :( So, for us who use it we will continue to use CPython 2.5.x version for some time to come. Is there an alternative to Psyco so i can have a look at ? Thanks in advance. --

Re: GUI toolkits with Tkinter's .pack() alternative

2008-03-27 Thread Alex9968
Guilherme Polo wrote: 2008/3/27, Alex9968 [EMAIL PROTECTED]: Guilherme Polo wrote: 2008/3/27, Alex9968 [EMAIL PROTECTED]: Guilherme Polo wrote: 2008/3/26, Alex9968 [EMAIL PROTECTED]: Hi all, I use Tkinter's Pack widget geometry manager (I really prefer it

Re: GUI toolkits with Tkinter's .pack() alternative

2008-03-27 Thread Alex9968
Guilherme Polo wrote: 2008/3/27, Alex9968 [EMAIL PROTECTED]: Guilherme Polo wrote: 2008/3/27, Alex9968 [EMAIL PROTECTED]: Guilherme Polo wrote: 2008/3/26, Alex9968 [EMAIL PROTECTED]: Hi all, I use Tkinter's Pack widget geometry manager (I really prefer it

Re: PyGTK localisation on Win32

2008-03-27 Thread Sukhov Dmitry
I had no problem with using standard gettext way of doing i18n on Windows with PyGTK an Glade, apart some quirks with LANG environment variable. Basically, the code that works looks like this: import gettext, locale locale.setlocale(locale.LC_ALL, '') if os.name == 'nt':

Pickle: several class instance objects in one file?

2008-03-27 Thread Dominique.Holzwarth
Hi everyone I've never used the module 'pickle' so far, thus I've got some questions about how to use it: Lets say I have instances of class A and class B: a = A() b = B() Is it possible to pickle both of these instances to the same pkl-file or will that have any bad impact for unpickle

Re: Psyco alternative

2008-03-27 Thread Paul Rubin
king kikapu [EMAIL PROTECTED] writes: it seems that Psyco's author will not port it for the upcoming Python 3000 release :( I think the idea is it will be part of PyPy and you should use that. -- http://mail.python.org/mailman/listinfo/python-list

Re: Psyco alternative

2008-03-27 Thread king kikapu
On 27 Μαρ, 14:35, Paul Rubin http://[EMAIL PROTECTED] wrote: king kikapu [EMAIL PROTECTED] writes: it seems that Psyco's author will not port it for the upcoming Python 3000 release :( I think the idea is it will be part of PyPy and you should use that. I know that his efforts are on PyPy

Re: Pickle: several class instance objects in one file?

2008-03-27 Thread Marc 'BlackJack' Rintsch
On Thu, 27 Mar 2008 12:28:25 +, Dominique.Holzwarth wrote: Lets say I have instances of class A and class B: a = A() b = B() Is it possible to pickle both of these instances to the same pkl-file or will that have any bad impact for unpickle (i.e. the instance are 'mixed' or

Re: Py2exe embed my modules to libary.zip

2008-03-27 Thread vedrandekovic
On 27 ožu, 10:44, Gabriel Genellina [EMAIL PROTECTED] wrote: En Thu, 27 Mar 2008 06:00:26 -0300, [EMAIL PROTECTED] escribió: I was add this into my application code: import sys import os my_dir=os.getcwd() sys.path.append(my_dir) sys.path.append(my_dir+\\libary.zip)

Re: Psyco alternative

2008-03-27 Thread Diez B. Roggisch
king kikapu wrote: On 27 Μαρ, 14:35, Paul Rubin http://[EMAIL PROTECTED] wrote: king kikapu [EMAIL PROTECTED] writes: it seems that Psyco's author will not port it for the upcoming Python 3000 release :( I think the idea is it will be part of PyPy and you should use that. I know that

Re: Psyco alternative

2008-03-27 Thread king kikapu
On 27 Μαρ, 15:56, Diez B. Roggisch [EMAIL PROTECTED] wrote: king kikapu wrote: On 27 Μαρ, 14:35, Paul Rubin http://[EMAIL PROTECTED] wrote: king kikapu [EMAIL PROTECTED] writes: it seems that Psyco's author will not port it for the upcoming Python 3000 release :( I think the idea is

Re: Psyco alternative

2008-03-27 Thread Diez B. Roggisch
Ok, i know this. The one that i do not know, is if, let'say, in 2 years it will be ready for seriously development, PyPy will aim to replace CPython entirely ?? We are talking about an whole new distribution ? Most certainly not. It's the goal of each language to finally become self-hosted,

And the reverse? Does os also import os.path?

2008-03-27 Thread Wilbert Berendsen
If i do import os os.path.abspath(bla) '/home/wilbert/bla' it seems that just import os also makes available al os.path functions. But is that always true? Thanks, Wilbert -- http://www.wilbertberendsen.nl/ You must be the change you wish to see in the world. -- Mahatma Gandhi --

Checking processes running under Windows

2008-03-27 Thread João Rodrigues
Hello all! I'm trying to write a script that needs to check which processes are running under Windows (XP Pro, Home, whatever). The method I'm using is: process_list = os.popen('TASKLIST').read() However, XP Home doesn't have the tasklist.exe tool so, this is kind of useless in that OS. Do you

Regarding __slots__ and other stuff: A couple of questions

2008-03-27 Thread dave berk
I'm new to Python. I'm trying to understand the type/class/object(instance) model. I have read here: http://www.cafepy.com/article/python_types_and_objects/python_types_and_objects.html and here: http://www.cafepy.com/article/python_attributes_and_methods/python_attributes_and_methods.html as well

Re: Psyco alternative

2008-03-27 Thread king kikapu
As for psyco, are there any alternatives to use now ? Nope, but I heard through the grapevine that while it won't be supported for all times to come, a new version is in the making. Aha!! It seems you have better sources than me! :) But ultimately, the author says that the approach is

Re: Psyco alternative

2008-03-27 Thread Jean-Paul Calderone
On Thu, 27 Mar 2008 15:19:11 +0100, Diez B. Roggisch [EMAIL PROTECTED] wrote: Ok, i know this. The one that i do not know, is if, let'say, in 2 years it will be ready for seriously development, PyPy will aim to replace CPython entirely ?? We are talking about an whole new distribution ? Most

Is subprocess.Popen completely broken?

2008-03-27 Thread Skip Montanaro
I am trying to replace os.system calls with subprocess.Popen. This simple example fails miserably: proc = subprocess.Popen (ls /tmp) Traceback (most recent call last): File stdin, line 1, in module File /home/titan/skipm/local/lib/python2.5/subprocess.py, line 594, in __init__ errread,

Re: Psyco alternative

2008-03-27 Thread Stefan Behnel
king kikapu wrote: As for psyco, are there any alternatives to use now ? But ultimately, the author says that the approach is flawed, so at *some* point it will be discontinued. But that could be said about nearly everything, couldn't it? It is a pity because this module *does* really solve

Tkinter menus made easy

2008-03-27 Thread MartinRinehart
Writing Tkinter menu code used to be rather tedious, uninspiring work. I figured that I could delegate the job to a program: http://www.martinrinehart.com/articles/menus.py Run it. Then look at the source (bottom of file). There's a bit more doc in the doc comment at the top. Peer review is

Re: Is subprocess.Popen completely broken?

2008-03-27 Thread Guilherme Polo
2008/3/27, Skip Montanaro [EMAIL PROTECTED]: I am trying to replace os.system calls with subprocess.Popen. This simple example fails miserably: proc = subprocess.Popen (ls /tmp) proc = subprocess.Popen (ls /tmp, shell=True) or proc = subprocess.Popen ([ls, /tmp]) should work.

Re: Tkinter menus made easy

2008-03-27 Thread Guilherme Polo
2008/3/27, [EMAIL PROTECTED] [EMAIL PROTECTED]: Writing Tkinter menu code used to be rather tedious, uninspiring work. I figured that I could delegate the job to a program: I didn't look at it yet, but just in case you weren't aware there is a gui designer tool for tkinter called GUI Designer

Re: Psyco alternative

2008-03-27 Thread king kikapu
If it's about some problems, then maybe Cython is an alternative. http://cython.org Stefan Hmmm...thanks but i think Pyrex-like solution is not the ideal one. Coming from C# and having 8 years of expertise on it, i have gain a very positive thinking about jit compilers and i think that psyco

Tkinter Text widget

2008-03-27 Thread MartinRinehart
Is there a way of translating from the Text widget's width/height (in characters) to pixels so you can open an appropriately sized window? -- http://mail.python.org/mailman/listinfo/python-list

Re: Is subprocess.Popen completely broken?

2008-03-27 Thread Jeffrey Froman
Skip Montanaro wrote: I am trying to replace os.system calls with subprocess.Popen.  This simple example fails miserably: proc = subprocess.Popen (ls /tmp) Popen expects a list of program arguments. When passed a single string instead of a list, as in your example, it assumes that the

Re: Is subprocess.Popen completely broken?

2008-03-27 Thread Jerry Hill
On Thu, Mar 27, 2008 at 10:53 AM, Skip Montanaro [EMAIL PROTECTED] wrote: I am trying to replace os.system calls with subprocess.Popen. This simple example fails miserably: proc = subprocess.Popen (ls /tmp) Traceback (most recent call last): File stdin, line 1, in module File

Re: Is subprocess.Popen completely broken?

2008-03-27 Thread Skip Montanaro
proc = subprocess.Popen (ls /tmp) proc = subprocess.Popen (ls /tmp, shell=True) or proc = subprocess.Popen ([ls, /tmp]) should work. Why should I need to set shell=True? I'm not globbing anything. The second case still fails: proc = subprocess.Popen ([/usr/bin/ls /tmp])

Re: py2exe socket.gaierror (10093)

2008-03-27 Thread Knut
This is frustrating. I was working on writing a sample for my problem. I start with dissecting my code which still gives the same error. Then I start thinking that it might be my setup file doing the damage. And i start it from scratch. Everything suddenly works. Fine! i think, i will have to

Re: Is subprocess.Popen completely broken?

2008-03-27 Thread Jerry Hill
Why should I need to set shell=True? I'm not globbing anything. The second case still fails: RTFM -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking processes running under Windows

2008-03-27 Thread Tim Golden
João Rodrigues wrote: Hello all! I'm trying to write a script that needs to check which processes are running under Windows (XP Pro, Home, whatever). The method I'm using is: process_list = os.popen('TASKLIST').read() However, XP Home doesn't have the tasklist.exe tool so, this is kind of

Re: Is subprocess.Popen completely broken?

2008-03-27 Thread Guilherme Polo
2008/3/27, Skip Montanaro [EMAIL PROTECTED]: proc = subprocess.Popen (ls /tmp) proc = subprocess.Popen (ls /tmp, shell=True) or proc = subprocess.Popen ([ls, /tmp]) should work. Why should I need to set shell=True? The default is shell=False, which means that Popen

Re: Checking processes running under Windows

2008-03-27 Thread Shane Geiger
One way: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303339 Another way: wmi # List all running processes # http://tgolden.sc.sabren.com/python/wmi_cookbook.html#running_processes import wmi c = wmi.WMI () for process in c.Win32_Process (): print process.ProcessId, process.Name

Re: Is subprocess.Popen completely broken?

2008-03-27 Thread Skip Montanaro
Jerry Hill malaclypse2 at gmail.com writes: It's looking for an executable named ls /tmp Since it can't find one, it raises an exception. If you just want to replace an os.system call, you need to pass shell=True to Popen, like this: proc = subprocess.Popen(ls /tmp, shell=True) That

Re: Is subprocess.Popen completely broken?

2008-03-27 Thread Lee Capps
On Mar 27, 2008, at 10:53 AM, Skip Montanaro wrote: I am trying to replace os.system calls with subprocess.Popen. This simple example fails miserably: proc = subprocess.Popen (ls /tmp) Traceback (most recent call last): File stdin, line 1, in module File

Pystemmer 1.0.1 installation problem in Linux

2008-03-27 Thread mungkol
Dear all, I am a newbie to Python community. For my project, I tried to install Pystemmer 1.0.1 (http://snowball.tartarus.org/wrappers/ PyStemmer-1.0.1.tar.gz) on my linux ubuntu 7.10 machine but unsuccessful. It produced the following error: running install running build running build_ext

Re: Is subprocess.Popen completely broken?

2008-03-27 Thread Gary Herron
Skip Montanaro wrote: proc = subprocess.Popen (ls /tmp) proc = subprocess.Popen (ls /tmp, shell=True) or proc = subprocess.Popen ([ls, /tmp]) should work. Why should I need to set shell=True? I'm not globbing anything. The second case still fails: proc =

Re: Is subprocess.Popen completely broken?

2008-03-27 Thread skip
Why should I need to set shell=True? I'm not globbing anything. The second case still fails: Jerry RTFM Thank you. I had. The bits about the type of the args parameter don't mention the shell parameter or that there was any difference between using strings or lists. I missed

Re: Line segments, overlap, and bits

2008-03-27 Thread Istvan Albert
On Mar 26, 5:28 pm, Sean Davis [EMAIL PROTECTED] wrote: I am working with genomic data. Basically, it consists of many tuples of (start,end) on a line. I would like to convert these tuples of (start,end) to a string of bits where a bit is 1 if it is covered by any of the regions described by

Re: Tkinter menus made easy

2008-03-27 Thread bearophileHUGS
On Mar 27, 3:54 pm, [EMAIL PROTECTED] wrote: Writing Tkinter menu code used to be rather tedious, uninspiring work. I figured that I could delegate the job to a program: I did develop a proggy that takes the following as input, it's part of my agui project, you can use it as an idea to improve

Re: Psyco alternative

2008-03-27 Thread bearophileHUGS
Diez B. Roggisch: the author says that the approach is flawed, so at *some* point it will be discontinued. Can't Psyco be improved, so it can compile things like: nums = (i for i in xrange(20) if i % 2) print sum(nums) I think the current Psyco runs slower than Python with generators/

dynimac code with lambda function creation

2008-03-27 Thread Justin Delegard
So I am trying to pass an object's method call to a function that requires a function pointer. I figured an easy way to do it would be to create a lambda function that calls the correct method, but this is proving more difficult than I imagined. Here is the function I'm using: def

Re: Psyco alternative

2008-03-27 Thread Jean-Paul Calderone
On Thu, 27 Mar 2008 08:59:33 -0700 (PDT), [EMAIL PROTECTED] wrote: Diez B. Roggisch: the author says that the approach is flawed, so at *some* point it will be discontinued. Can't Psyco be improved, so it can compile things like: nums = (i for i in xrange(20) if i % 2) print sum(nums)

Dynamic code problem

2008-03-27 Thread perlefenc
My dynamic code failed at this site http://playwide1.extra.hu/, need some help thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Psyco alternative

2008-03-27 Thread king kikapu
One reason attention is going to PyPy instead of Psyco... Jean-Paul I had a look at PyPy, it, indeed, have a very long way to go so we can consider it an alternative. -- http://mail.python.org/mailman/listinfo/python-list

Re: dynimac code with lambda function creation

2008-03-27 Thread Laszlo Nagy
Justin Delegard wrote: So I am trying to pass an object's method call to a function that requires a function pointer. I figured an easy way to do it would be to create a lambda function that calls the correct method, but this is proving more difficult than I imagined. Here is the

Re: first interactive app

2008-03-27 Thread Tim Arnold
Miki [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello Tim, snip Any ideas on a simple interface for this? How about something like: Chapter 1 (001-200 200) Chapter 2 (200-300 100) -- 001-300 300 Chapter 3 (300-450 150) Chapter 4 (450-500 50) -- 300-450 250

Re: dynimac code with lambda function creation

2008-03-27 Thread Bruno Desthuilliers
Justin Delegard a écrit : So I am trying to pass an object's method call I assume you mean to pass an object's method, since I don't get what passing an object's method call could mean. to a function that requires a function pointer. s/pointer/object/ There's nothing like a pointer in

singleton decorator

2008-03-27 Thread r . grimm
Hallo, playing with the decorators from PEP 318 I found the elegant singleton decorator. def singleton(cls): instances = {} def getinstance(): if cls not in instances: instances[cls] = cls() return instances[cls] return getinstance @singleton class A: pass

Re: singleton decorator

2008-03-27 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Hallo, playing with the decorators from PEP 318 I found the elegant singleton decorator. def singleton(cls): instances = {} def getinstance(): if cls not in instances: instances[cls] = cls() return instances[cls]

Re: And the reverse? Does os also import os.path?

2008-03-27 Thread Bruno Desthuilliers
Wilbert Berendsen a écrit : If i do import os os.path.abspath(bla) '/home/wilbert/bla' it seems that just import os also makes available al os.path functions. But is that always true? Nope. Not all packages expose their sub-packages. --

Re: Soup Strainer for ElementSoup?

2008-03-27 Thread Stefan Behnel
erikcw wrote: I'm parsing real-world HTML with BeautifulSoup and XML with cElementTree. I'm guessing that the only benefit to using ElementSoup is that I'll have one less API to keep track of, right? If your real-world HTML is still somewhat close to HTML, lxml.html might be an option. It

  1   2   3   >