Re: Making code run in both source tree and installation path

2009-06-30 Thread ryles
On Jun 29, 12:20 pm, Javier Collado wrote: > Hello, > > I would like to be able to run the main script in a python project > from both the source tree and the path in which it's installed on > Ubuntu. The script, among other things, imports a package which in > turns makes use of some data files t

Re: Multi thread reading a file

2009-06-30 Thread Gabriel Genellina
En Tue, 30 Jun 2009 22:52:18 -0300, Mag Gam escribió: I am very new to python and I am in the process of loading a very large compressed csv file into another format. I was wondering if I can do this in a multi thread approach. Does the format conversion involve a significant processing time

Streaming Webcam over network

2009-06-30 Thread Nik Martelaro
Hi eveyone, I am working on a project that requires streaming video from a webcam over LAN and displaying the live video on the remote computer. Basically, I am creating a specialized video chat client. I can get really nice video locally using VideoCapture and Pygame, however have only been able t

Re: invoking a method from two superclasses

2009-06-30 Thread Gabriel Genellina
En Tue, 30 Jun 2009 21:34:02 -0300, Mitchell L Model escribió: Allow me to add to my previous question that certainly the superclass methods can be called explicitly without resorting to super(), e.g.: class C(A, B): def __init__(self): A.__init__(self) B.

Re: invoking a method from two superclasses

2009-06-30 Thread Scott David Daniels
Mitchell L Model wrote: From: Scott David Daniels Date: Tue, 30 Jun 2009 16:49:18 -0700 Message-ID: Subject: Re: invoking a method from two superclasses Mitchell L Model wrote: In Python 3, how should super() be used to invoke a method defined in C that overrides its two superclasses A and B,

Re: invoking a method from two superclasses

2009-06-30 Thread Mitchell L Model
>From: Scott David Daniels >Date: Tue, 30 Jun 2009 16:49:18 -0700 >Message-ID: >Subject: Re: invoking a method from two superclasses > >Mitchell L Model wrote: >>In Python 3, how should super() be used to invoke a method defined in C > > that overrides its two superclasses A and B, in particular

Re: PEP 376

2009-06-30 Thread Joachim Strömbergson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Aloha! Carl Banks wrote: > On Jun 30, 5:55 pm, Lawrence D'Oliveiro central.gen.new_zealand> wrote: >> In message , Tarek >> >> Ziadé wrote: >>> I would like to propose this PEP for inclusion into Python 2.7 / 3.2 >>> http://www.python.org/dev/peps/pe

Re: PEP 376

2009-06-30 Thread Scott David Daniels
Carl Banks wrote: On Jun 30, 5:55 pm, Lawrence D'Oliveiro wrote: In message , Tarek Ziadé wrote: I would like to propose this PEP for inclusion into Python 2.7 / 3.2 http://www.python.org/dev/peps/pep-0376/ Why are you using MD5? I doubt it's the design aim for eggs to be cryptographically

Re: packaging apps

2009-06-30 Thread David Lyon
On Tue, 30 Jun 2009 11:11:15 -0400, Ronn Ross wrote: > I have a simple application that has a glade file and a .py file. How would > I package that into an installer for Windows, Mac, and a deb file? Can > anyone point me in the right direction? I don't think there is a simple way to do that just

Multi thread reading a file

2009-06-30 Thread Mag Gam
Hello All, I am very new to python and I am in the process of loading a very large compressed csv file into another format. I was wondering if I can do this in a multi thread approach. Here is the pseudo code I was thinking about: Let T = Total number of lines in a file, Example 100 (1 mil

Re: invoking a method from two superclasses

2009-06-30 Thread Carl Banks
On Jun 30, 6:23 pm, Carl Banks wrote: > On Jun 30, 5:34 pm, Mitchell L Model wrote: > > > Allow me to add to my previous question that certainly the superclass > > methods can be called explicitly without resorting to super(), e.g.: > > >     class C(A, B): > >         def __init__(self): > >    

Re: invoking a method from two superclasses

2009-06-30 Thread Carl Banks
On Jun 30, 5:34 pm, Mitchell L Model wrote: > Allow me to add to my previous question that certainly the superclass > methods can be called explicitly without resorting to super(), e.g.: > >     class C(A, B): >         def __init__(self): >             A.__init__(self) >             B.__init__(se

Re: Determining if a function is a method of a class within a decorator

2009-06-30 Thread David Hirschfield
Unfortunately that still requires two separate decorators, when I was hoping there was a way to determine if I was handed a function or method from within the same decorator. Seems like there really isn't, so two decorators is the way to go. Thanks, -David Carl Banks wrote: On Jun 29, 6:01 pm

Re: csv blank fields

2009-06-30 Thread norseman
Mag Gam wrote: I am using the csv package to parse a compressed .csv.gz file. So far its working perfectly fine but it fails when I have a missing value in on of the fields. For example, I have this Abc,def,,jkl Is it possible to fill the missing column with a null? I want, Abc,def,NULL,jkl

Re: PEP 376

2009-06-30 Thread Carl Banks
On Jun 30, 5:55 pm, Lawrence D'Oliveiro wrote: > In message , Tarek > > Ziadé wrote: > > I would like to propose this PEP for inclusion into Python 2.7 / 3.2 > > >http://www.python.org/dev/peps/pep-0376/ > > Why are you using MD5? I doubt it's the design aim for eggs to be cryptographically secur

Re: PEP 376

2009-06-30 Thread Lawrence D'Oliveiro
In message , Tarek Ziadé wrote: > I would like to propose this PEP for inclusion into Python 2.7 / 3.2 > > http://www.python.org/dev/peps/pep-0376/ Why are you using MD5? -- http://mail.python.org/mailman/listinfo/python-list

Re: Determining if a function is a method of a class within a decorator

2009-06-30 Thread Carl Banks
On Jun 29, 6:01 pm, David Hirschfield wrote: > So is there > a pattern I can follow that will allow me to determine whether the > objects I'm given are plain functions or belong to a class? > > Thanks in advance, class HomemadeUnboundMethod(object): def __init__(self,func): self.fun

Re: PEP 376

2009-06-30 Thread Tarek Ziadé
On Wed, Jul 1, 2009 at 12:52 AM, Carl Banks wrote: > On Jun 30, 12:41 pm, Tarek Ziadé wrote: >> Hello, >> >> I would like to propose this PEP for inclusion into Python 2.7 / 3.2 >> >> http://www.python.org/dev/peps/pep-0376/ >> >> It has been discussed a lot already in the distutils-SIG, but new >

Re: MIT OpenCourseWare Introduction to Computer Science and Programming

2009-06-30 Thread sato.ph...@gmail.com
I should note that the course utilized python when teaching computer science. On Jun 30, 5:23 pm, "sato.ph...@gmail.com" wrote: > I am wondering if anyone else is also going through the MIT > OpenCourseWare Intro to CS class. > > http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Scien

Re: invoking a method from two superclasses

2009-06-30 Thread Mitchell L Model
Allow me to add to my previous question that certainly the superclass methods can be called explicitly without resorting to super(), e.g.: class C(A, B): def __init__(self): A.__init__(self) B.__init__(self) My question is really whether there is any way of get

MIT OpenCourseWare Introduction to Computer Science and Programming

2009-06-30 Thread sato.ph...@gmail.com
I am wondering if anyone else is also going through the MIT OpenCourseWare Intro to CS class. http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-00Fall-2007/CourseHome/index.htm I've been doing the assignments and, as this class didn't include any answer key, was hoping to se

Re: invoking a method from two superclasses

2009-06-30 Thread Scott David Daniels
Mitchell L Model wrote: In Python 3, how should super() be used to invoke a method defined in C > that overrides its two superclasses A and B, in particular __init__? ... I've discovered the surprising fact described in the documentation of super

Re: pep 8 constants

2009-06-30 Thread MRAB
Eric S. Johansson wrote: I've been working with speech recognition for 15 years. I've written something on the order of 10,000 lines of Python code both as open source and private projects. I've tried it least two dozen editors and they all fail miserably because they're focused on keyboard use

Re: string character count

2009-06-30 Thread Emile van Sebille
On 6/30/2009 1:43 PM nn said... On Jun 30, 1:56 pm, MRAB wrote: >>> len("text12345.txt".split(".", 1)[0]) 9 >>> len("textstringwithoutdot".split(".", 1)[0]) 20 Also: >>> len("text.12345.txt".partition('.')[0]) 4 >>> len("text.12345.txt".rpartition('.')[0]) 10 >>> unless you've got fi

Re: PEP 376

2009-06-30 Thread Carl Banks
On Jun 30, 12:41 pm, Tarek Ziadé wrote: > Hello, > > I would like to propose this PEP for inclusion into Python 2.7 / 3.2 > > http://www.python.org/dev/peps/pep-0376/ > > It has been discussed a lot already in the distutils-SIG, but new > feedbacks are welcome > > there's an implementation prototy

Re: handling https sites

2009-06-30 Thread Cameron Simpson
On 26Jun2009 09:34, cgoldberg wrote: | > Is there any module in python to open https | > sites through a proxy. | | yes, you can use "urllib2". | | from the urllib2 docs: | "The default is to read the list of proxies from the environment | variables" | | So if you have a proxy setup, it should

Ubigraph vs Matplotlib (dynamic plotting, event handling)

2009-06-30 Thread Ala
Hello everyone, I intend to use python for some network graph plotting, with event handling (clicking on network nodes, zooming in/out etc..) and so far I have come across two good candidates which are Matplotlib and Ubigraph. Did anyone have any experience with either of them for dynamic plottin

invoking a method from two superclasses

2009-06-30 Thread Mitchell L Model
In Python 3, how should super() be used to invoke a method defined in C that overrides its two superclasses A and B, in particular __init__? class A: def __init__(self): print('A') class B: def __init__(self): print('B') class C(A, B):

Re: string character count

2009-06-30 Thread nn
On Jun 30, 1:56 pm, MRAB wrote: > noydb wrote: > > If I have a string for a file name such that I want to find the number > > of characters to the left of the dot, how can that be done? > > > I did it this way: > > x = "text12345.txt" > > dot = x.find('.') > > print dot > > > Was curious to see wh

Re: It's ...

2009-06-30 Thread Beni Cherniavsky
On Jun 24, 11:40 pm, "J. Cliff Dyer" wrote: > Also note that you can iterate over a file several times: > > f = open('foo.txt') > for line in f: > print line[0] # prints the first character of every line > for line in f: > print line[1] #prints the second character of every line > No, yo

PEP 376

2009-06-30 Thread Tarek Ziadé
Hello, I would like to propose this PEP for inclusion into Python 2.7 / 3.2 http://www.python.org/dev/peps/pep-0376/ It has been discussed a lot already in the distutils-SIG, but new feedbacks are welcome there's an implementation prototype here : http://bitbucket.org/tarek/pep376/src/tip/pkgut

Re: Determining if a function is a method of a class within a decorator

2009-06-30 Thread Terry Reedy
I do not like top posting. Some thoughts in randon order: Introspection is version-specific. Call-time introspection is different from definition-time introspection. Do what is easy and works. Do not use recipes that depend on version-specific stuff you do not understand. Code objects, I believe

ANN: ActivePython 3.1.0.1 is now available

2009-06-30 Thread Sridhar Ratnakumar
I'm happy to announce that ActivePython 3.1.0.1 is now available for download from: http://www.activestate.com/activepython/python3/ This is a major release that updates ActivePython3 to core Python 3.1. What is ActivePython? - ActivePython is ActiveState's binary dist

Re: Noob

2009-06-30 Thread Gabriel Genellina
En Tue, 30 Jun 2009 15:02:21 -0300, kaffeen escribió: Hello all, just joined this list and am just beginning to learn Python. Thanks to everyone for making this a great place to learn and their contributions. Welcome! As mentioned, I'm new to Python (but have experience with other programm

Re: tokenize module

2009-06-30 Thread Tim Roberts
bootkey wrote: > >Thanks for the reply. I wonder why the tokenizer classifies all >operators simply as OP, instead of the various operators listed in the >tok_name dictionary. I imagine it's just an exercise left to the reader. It's not that hard of an extension. -- Tim Roberts, t...@probo.com

Re: Python Imaging Library download link broken?

2009-06-30 Thread Tim Roberts
peter wrote: > >Just got a new computer and I'm trying to download my favourite >applications. All's well until I get to PIL, and here pythonware and >effbot both return a 502 Proxy error. > >Is this just a temporary glitch, or something more serious? And if >it's the latter, is there any altern

Re: Direct interaction with subprocess - the curse of blocking I/O

2009-06-30 Thread cgoldberg
> So well, I'd like to know, do you people know any solution to this > simple problem - making a user interact directly with a subprocess? you might want something like Expect. check out the pexpect module: http://pexpect.sourceforge.net/pexpect.html -Corey -- http://mail.python.org/mailman/li

Re: python+encryption

2009-06-30 Thread Benjamin Peterson
jayshree gmail.com> writes: > > I have the key pair generated by the GPG. Now I want to use the public > key for encrypting the password. I need to make a function in Python. > Can somebody guide me on how to do this … PyCrypto -- http://mail.python.org/mailman/listinfo/python-list

Re: Unexpected behaviour of inner functions/ decorators

2009-06-30 Thread Scott David Daniels
Francesco Bochicchio wrote: def dec_f(f): def inner_f(): if f.enabled: f() return inner_f @dec_f def funct(): print "Ciao" The three lines above should behave a lot like: def funct_original(): print "Ciao" funct = dec_f(funct_original) > funct.e

Python/Pygame question

2009-06-30 Thread Crip
I have been experimenting with pygame. I would like to know how to go about placing an image of my creation as the background of the generated window. To where should I save the image, and what should it be saved as? -- http://mail.python.org/mailman/listinfo/python-list

Re: Unexpected behaviour of inner functions/ decorators

2009-06-30 Thread David Stanek
On Tue, Jun 30, 2009 at 1:44 PM, Francesco Bochicchio wrote: > [snip] > It looks like the decorator uses an older  instance of 'funct', which > does not yet > have the attribute dinamically attached to it. This seem to be > confirmed by the fact that adding the attribute before > rebinding the fu

Re: Problem with uuid package when embedding a python interpreter

2009-06-30 Thread Gabriel Genellina
En Tue, 30 Jun 2009 13:05:42 -0300, Jérôme Fuselier escribió: I've tried to import a script in an embedded python intrepreter but this script fails when it imports the uuid module. I have a segmentation fault in Py_Finalize(). #include "Python.h" void test() { Py_Initialize(); PyImp

Noob

2009-06-30 Thread kaffeen
Hello all, just joined this list and am just beginning to learn Python. Thanks to everyone for making this a great place to learn and their contributions. As mentioned, I'm new to Python (but have experience with other programming languages/scripting). I have a couple of questions... 1) Where mig

Re: string character count

2009-06-30 Thread MRAB
noydb wrote: If I have a string for a file name such that I want to find the number of characters to the left of the dot, how can that be done? I did it this way: x = "text12345.txt" dot = x.find('.') print dot Was curious to see what method others would use - helps me learn. I guess I was mos

Unexpected behaviour of inner functions/ decorators

2009-06-30 Thread Francesco Bochicchio
Hi all, I found a strange (for me) behaviour of inner function. If I execute the following code: # file in_f.py --- def dec_f(f): def inner_f(): if f.enabled: f() return inner_f @dec_f def funct(): print "Ciao" funct.enabled = True funct() # end of file

python+encryption

2009-06-30 Thread jayshree
I have the key pair generated by the GPG. Now I want to use the public key for encrypting the password. I need to make a function in Python. Can somebody guide me on how to do this … to encrypt password by the public key ..how can i do this ,which library is best and easy to prefer.i have to work

string character count

2009-06-30 Thread noydb
If I have a string for a file name such that I want to find the number of characters to the left of the dot, how can that be done? I did it this way: x = "text12345.txt" dot = x.find('.') print dot Was curious to see what method others would use - helps me learn. I guess I was most curious to se

Re: ANN: Package Manager GUI for Python (Windows)

2009-06-30 Thread Daniel Fetchinson
> Hi All, > > I'm pleased to announce a GUI package manager (v 0.12) for > Python versions 2.x under Windows. > > http://sourceforge.net/projects/pythonpkgmgr/ > > It's tightly linked to the pypi repository and offers > the following functions: > > - search packages on pypi by name > > - install

Re: Timeout when connecting to sybase DBS

2009-06-30 Thread skip
Gil> I have looked for a timeout parameter to limit the 4 minutes to Gil> something more reasonable but couldn't find one. Can anyone please Gil> help? Gil> BTW, I'm using Sybase.connect(, , , Gil> datetime='auto') We use the Sybase module where I work, but I've never encoun

Re: pep 8 constants

2009-06-30 Thread Tim Chase
I've tried it least two dozen editors and they all fail miserably because they're focused on keyboard use (but understandable) [...snip...] I've tried a whole bunch, like I said at least a dozen. They all fail for first reasons such as inability to access all functionality through keystrokes (e

Re: python3 fail to start

2009-06-30 Thread Mark Dickinson
On Jun 30, 3:43 pm, ts wrote: > i just install the python 3.1 dmg onto my mac. when i run python3, it > fail with : > > Fatal Python error: Py_Initialize: can't initialize sys standard > streams > LookupError: unknown encoding: > Abort trap > > couldnt understand the problem. anyone can help? Hmm

Problem with uuid package when embedding a python interpreter

2009-06-30 Thread Jérôme Fuselier
Hello, I've tried to import a script in an embedded python intrepreter but this script fails when it imports the uuid module. I have a segmentation fault in Py_Finalize(). Here is a simple program which imitate my problem. main.c : #include "Python.h" void test() { Py_Initialize(); Py

Re: using input(), raw_input() to allow user to run different functions

2009-06-30 Thread rhvonl...@gmail.com
On Jun 29, 5:22 pm, MRAB wrote: > rhvonl...@gmail.com wrote: > > Something's been giving me difficulty.. > > > We have a USB-attached device that we frequently debug with simple > > python scripts.  The model has always been that each script logs on to > > the device, does something, then logs off

Re: packaging apps

2009-06-30 Thread Javier Collado
Hello, Regarding packaging for debian (.deb), the best reference I've found is: https://wiki.ubuntu.com/PackagingGuide/Python However, all that mess probably won't be needed anymore once this is finished: https://blueprints.edge.launchpad.net/ubuntu/+spec/desktop-karmic-automagic-python-build-sys

Re: Passing parameters for a C program in Linux.

2009-06-30 Thread Miles Kaufmann
On Jun 30, 2009, at 6:46 AM, venutaurus...@gmail.com wrote: I have to write an automted script which will test my c program. That program when run will ask for the commands. Keep in mind that, if your test script checks the program's output before giving it input, you can run into pro

Re: identify checksum type?

2009-06-30 Thread Christian Heimes
Scott David Daniels wrote: > fortunately, the hashlib checksums can be distinguished by their length Unfortunately the world knows more hash algorithms than the Python standard library. :) Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: pep 8 constants

2009-06-30 Thread Eric S. Johansson
Tim Chase wrote: > Eric S. Johansson wrote: > np. I get this confusion often. > > While I have used SR in some testing, I've found that while it's > passable for prose (and even that, proclamations of "95% accuracy" sound > good until you realize how many words comprise 5% of your daily typing >

packaging apps

2009-06-30 Thread Ronn Ross
I have a simple application that has a glade file and a .py file. How would I package that into an installer for Windows, Mac, and a deb file? Can anyone point me in the right direction? -- http://mail.python.org/mailman/listinfo/python-list

Re: pep 8 constants

2009-06-30 Thread Eric S. Johansson
Rhodri James wrote: > [Trimming for length, sorry if that impacts too much on intelligibility] no problem, one of the hazards of speech recognition uses you become very verbose. > This goes a long way, but it doesn't eliminate the need for some forms > of escape coming up on a moderately frequen

Re: Learning to use decorators with classes

2009-06-30 Thread sk8in_zombi
--- On Tue, 30/6/09, Bruno Desthuilliers wrote: > > Don't use '__name__', they are reserved for the > implementation. And FWIW, don't use '__name' unless you have > a really compelling reason to do so. > That was an honest mistake!. Noted :) > > >     def search(self, **kw): > >         pri

Re: identify checksum type?

2009-06-30 Thread Scott David Daniels
Christian Heimes wrote: PK schrieb: Given a checksum value, whats the best way to find out what type it is? meaning. I can use hashlib module and compute a md5 or sha1 for a given data etc..but given a checksum value say "d2bda52ee39249acc55a75a0f3566105" whats the best way for me to identify i

Re: Passing parameters for a C program in Linux.

2009-06-30 Thread pdpi
On Jun 30, 11:46 am, "venutaurus...@gmail.com" wrote: > Hi all, >        I have to write an automted script which will test my c > program. That program when run will ask for the commands. For example: > > local-host# ./cli > Enter 1 for add > Enter 2 for sub > Enter 3 for mul > 1            -

python3 fail to start

2009-06-30 Thread ts
i just install the python 3.1 dmg onto my mac. when i run python3, it fail with : Fatal Python error: Py_Initialize: can't initialize sys standard streams LookupError: unknown encoding: Abort trap couldnt understand the problem. anyone can help? -- http://mail.python.org/mailman/listinfo/python-

Re: Passing parameters for a C program in Linux.

2009-06-30 Thread Petr Messner
2009/6/30 venutaurus...@gmail.com : ... > Can you give some more explanation about how exactly this can be > done.. Popen object enables you to run any program in a newly-created child process, write to its standard input and read from its standard and error outputs. There is an example how your

Re: ImageEnhance.Contrast - is this fishy or what?

2009-06-30 Thread roop
On Jun 17, 12:38 am, Scott David Daniels wrote: > > Over on image-sig, Fredrik Lundh responded: >  > And the award for finding the oldest bug in PIL goes to... (that code >  > was last touched in 1996). >  > > > Congrats, roop, on getting this discovered just in the nick of time. > /me takes a bo

Re: timer

2009-06-30 Thread Paul Moore
2009/6/30 superpollo : > Paul Moore wrote: >> >> 2009/6/30 superpollo : >> >>> Paul Moore wrote: >>> For a non-toy example, you'd probably create an Event object, use your timer to set the event, and your while loop would do while event.is_set(), so the problem wouldn't arise. >>> >>

Re: timer

2009-06-30 Thread superpollo
i would like to thank each and everyone for help given, and aplologise for my inaccuracy. thanks 10**3! superchicken -- http://mail.python.org/mailman/listinfo/python-list

Re: timer

2009-06-30 Thread superpollo
Paul Moore wrote: 2009/6/30 superpollo : Paul Moore wrote: For a non-toy example, you'd probably create an Event object, use your timer to set the event, and your while loop would do while event.is_set(), so the problem wouldn't arise. thank u paul. if u dont mind, would you give me a more

Re: timer

2009-06-30 Thread Paul Rudin
superpollo writes: > so why this does not work? > > 1 #!/usr/bin/python > 2 > 3 import threading > 4 > 5 e = threading.Event() > 6 t = threading.Timer(3.0, e.set()) The second arg needs to be a callable - maybe you meant e.set without the brackets? -- http:

Re: timer

2009-06-30 Thread superpollo
Paul Moore wrote: 2009/6/30 superpollo : Paul Moore wrote: For a non-toy example, you'd probably create an Event object, use your timer to set the event, and your while loop would do while event.is_set(), so the problem wouldn't arise. thank u paul. if u dont mind, would you give me a more

Re: Passing parameters for a C program in Linux.

2009-06-30 Thread venutaurus...@gmail.com
On Jun 30, 5:42 pm, Petr Messner wrote: > Hi, > > this can be done using module "subprocess"; there is also function > popen() in module "os" and module popen2, but they are deprecated > since Python 2.6. > > PM > > 2009/6/30 venutaurus...@gmail.com : > > > Hi all, > >       I have to write an aut

Re: timer

2009-06-30 Thread Tim Golden
superpollo wrote: so why this does not work? 1 #!/usr/bin/python 2 3 import threading 4 5 e = threading.Event() 6 t = threading.Timer(3.0, e.set()) 7 t.start() 8 while not e.isSet(): 9 print "stuff ", it does *NOT* print (but it should,

Re: timer

2009-06-30 Thread superpollo
Paul Moore wrote: 2009/6/29 MRAB : superpollo wrote: hi folks. the follwing shoud print 'stuff' for 3 seconds and then stop. why it does not work? (prints stuff forever) 1 #!/usr/bin/python 2 3 import threading 4 import sys 5 6 t = threading.Timer(3.0, sys.exit)

Re: timer

2009-06-30 Thread Paul Moore
2009/6/30 superpollo : > Paul Moore wrote: >> For a non-toy example, you'd probably create an Event object, use your >> timer to set the event, and your while loop would do while >> event.is_set(), so the problem wouldn't arise. > > thank u paul. if u dont mind, would you give me a more detailed pi

Re: Learning to use decorators with classes

2009-06-30 Thread Bruno Desthuilliers
Mr SZ a écrit : Hi, I'm writing an LDAP plugin for my TG2 application. In this I wrote a small class based decorator with args to set up a connection and call the necessary functionality but I'm having problems with it. Here's my code: (snip code) class LdapPlugin(Plugin): ... def _

ANN: Package Manager GUI for Python (Windows)

2009-06-30 Thread David Lyon
Hi All, I'm pleased to announce a GUI package manager (v 0.12) for Python versions 2.x under Windows. http://sourceforge.net/projects/pythonpkgmgr/ It's tightly linked to the pypi repository and offers the following functions: - search packages on pypi by name - install (via easyinstall or

Re: Passing parameters for a C program in Linux.

2009-06-30 Thread Petr Messner
Hi, this can be done using module "subprocess"; there is also function popen() in module "os" and module popen2, but they are deprecated since Python 2.6. PM 2009/6/30 venutaurus...@gmail.com : > Hi all, > I have to write an automted script which will test my c > program. That program whe

Re: timer

2009-06-30 Thread superpollo
Paul Moore wrote: 2009/6/29 MRAB : superpollo wrote: hi folks. the follwing shoud print 'stuff' for 3 seconds and then stop. why it does not work? (prints stuff forever) 1 #!/usr/bin/python 2 3 import threading 4 import sys 5 6 t = threading.Timer(3.0, sys.exit)

Re: Help me plsss...

2009-06-30 Thread Harsha Reddy
Hi Marc, Thanks for the repl... Ican see below in /data/oracle/product/10.2.0.3/lib newprd$ ls -ltr libclntsh* -rwxrwxr-x 1 oracle dba 24048416 Apr 29 10:49 libclntsh.so.10.1 lrwxrwxrwx 1 oracle dba 51 Apr 29 10:49 libclntsh.so -> /data/oracle/product/10.2.0.3/lib/lib

Re: Help me plsss...

2009-06-30 Thread Harsha Reddy
Hi Marc, Thanks for the repl... Ican see below in /data/oracle/product/10.2.0.3/lib newprd$ ls -ltr libclntsh* -rwxrwxr-x 1 oracle dba 24048416 Apr 29 10:49 libclntsh.so.10.1 lrwxrwxrwx 1 oracle dba 51 Apr 29 10:49 libclntsh.so -> /data/oracle/product/10.2.0.3/lib/lib

Re: Help me plsss...

2009-06-30 Thread Marco Bizzarri
Of course, you're sure that under /data/oracle/product/10.2.0.3/lib you can find libclntsh.so.9.0 Regards Marco On Tue, Jun 30, 2009 at 1:45 PM, Harsha Reddy wrote: > > Hi All, > > Environment :-                 Solaris > Python Version :-         ActivePython 2.4.3 Build 11 (ActiveState S

Help me plsss...

2009-06-30 Thread Harsha Reddy
Hi All, Environment :- Solaris Python Version :- ActivePython 2.4.3 Build 11 (ActiveState Software Inc.) based on Python 2.4.3 (#1, Apr 3 2006, 18:34:02) [C] on sunos5 Oracle version :- 10.2.0.3 Below is the library path echo $LD_LIBRARY_PATH /da

Re: Drawing in PDF

2009-06-30 Thread Eduardo Lenz
Em Ter 30 Jun 2009, às 04:19:13, Grant Edwards escreveu: > On 2009-06-30, Eduardo Lenz wrote: > > Em Seg 29 Jun 2009, às 20:39:22, Lawrence D'Oliveiro escreveu: > >> In message >> > >> d7fe56d05...@g19g2000yql.googlegroups.com>, Jun wrote: > >> > ... is there open source solution ? > >> > >> Popp

Re: Using Python for file packing

2009-06-30 Thread Nobody
On Mon, 29 Jun 2009 14:16:34 -0700, Scott David Daniels wrote: >>> Do you mean like a zip or tar file? >>> >>> http://docs.python.org/library/zipfile.htmlhttp://docs.python.org/library/tarfile.html >>> >> >> I had no idea you could access a single file from a ZIP or TAR without >> explicitly extr

Re: Specific iterator in one line

2009-06-30 Thread Bearophile
Filip Gruszczyński: > [1, 0, 0, 1] -> ['b', 'b', 'a', 'a', 'b', 'b'] I like this version (43 golf holes), it's readable enough: [c for d in[1,0,0,1]for c in("a","bb")[d]] Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Drawing in PDF

2009-06-30 Thread Grant Edwards
On 2009-06-30, Eduardo Lenz wrote: > Em Seg 29 Jun 2009, às 20:39:22, Lawrence D'Oliveiro escreveu: >> In message > >> d7fe56d05...@g19g2000yql.googlegroups.com>, Jun wrote: >> > ... is there open source solution ? >> >> Poppler? > > pypdf -- http://pybrary.net/pyPdf/ > > > A Pure-Python library b

Re: pep 8 constants

2009-06-30 Thread Jean-Michel Pichavant
Eric S. Johansson wrote: Ethan Furman wrote: Eric S. Johansson wrote: yup how long will i[t] be before you become disablesd? maybe not as badly as I am but you should start feeling some hand problems in your later 40's to early 50's and it goes down hill from there. self preservation

python extend c++ module

2009-06-30 Thread Shen, Yu-Teh
I have written a c++ extend module and I use distutils to build. setup.py from distutils.core import setup, Extension setup(name="noddy", version="1.0", ext_modules=[ Extension("noddy3", ["noddy3.cpp", "a.cpp"]) ]) I found it's quite strange when compilin

RE: Specific iterator in one line

2009-06-30 Thread Andreas Tawn
> -Original Message- > From: python-list-bounces+andreas.tawn=ubisoft@python.org [mailto:python- > list-bounces+andreas.tawn=ubisoft@python.org] On Behalf Of Paul Rubin > Sent: Tuesday, June 30, 2009 11:27 AM > To: python-list@python.org > Subject: Re: Specific iterator in one line

Re: Drawing in PDF

2009-06-30 Thread Eduardo Lenz
Em Seg 29 Jun 2009, às 20:39:22, Lawrence D'Oliveiro escreveu: > In message > d7fe56d05...@g19g2000yql.googlegroups.com>, Jun wrote: > > ... is there open source solution ? > > Poppler? pypdf -- http://pybrary.net/pyPdf/ A Pure-Python library built as a PDF toolkit. It is capable of: * ext

Passing parameters for a C program in Linux.

2009-06-30 Thread venutaurus...@gmail.com
Hi all, I have to write an automted script which will test my c program. That program when run will ask for the commands. For example: local-host# ./cli Enter 1 for add Enter 2 for sub Enter 3 for mul 1---Our option Enter two numbers 44 33 Our option Result is 77

RE: Specific iterator in one line

2009-06-30 Thread Peter Otten
Peter Otten wrote: > Andreas Tawn wrote: > >>> > > This is purely sport question. I don't really intend to use the >>> > > answer in my code, but I am wondering, if such a feat could be done. >>> > > >>> > > I have a following problem: I have a list based upon which I would >>> > > like to constr

Learning to use decorators with classes

2009-06-30 Thread Mr SZ
Hi, I'm writing an LDAP plugin for my TG2 application. In this I wrote a small class based decorator with args to set up a connection and call the necessary functionality but I'm having problems with it. Here's my code: class getConnection(object): def __init__(self, settings, credentials)

Re: Specific iterator in one line

2009-06-30 Thread Tim Chase
list("".join([("a","b"*2)[x] for x in [1,0,0,1]]) 50 characters. Do I win £5? list("".join([("a","bb")[x] for x in [1,0,0,1]]) Or 49 :o) Well, you have a missing ")" character, but that would be the 49th. You can[*] abuse python's parsing by removing certain spaces with list(''.join([

Re: Specific iterator in one line

2009-06-30 Thread Paul Rubin
"Andreas Tawn" writes: > list("".join([("a","b"*2)[x] for x in [1,0,0,1]]) > 50 characters. Do I win £5? Er, missing right paren. Try: list("".join(("a","bb")[x] for x in [1,0,0,1])) -- http://mail.python.org/mailman/listinfo/python-list

RE: Specific iterator in one line

2009-06-30 Thread Peter Otten
Andreas Tawn wrote: >> > > This is purely sport question. I don't really intend to use the >> > > answer in my code, but I am wondering, if such a feat could be done. >> > > >> > > I have a following problem: I have a list based upon which I would >> > > like to construct a different one. I could

Re: The Python Way for module configuration?

2009-06-30 Thread Horace Blegg
On Sun, Jun 28, 2009 at 10:22 AM, kj wrote: > In <87fxdlujds@benfinney.id.au> Ben Finney > > > writes: > > >(Even if you don't want to receive email, could you please give your > >actual name in the ‘From’ field instead of just initials? It makes > >conversation less confusing.) > > I don't

RE: Specific iterator in one line

2009-06-30 Thread Andreas Tawn
> > > This is purely sport question. I don't really intend to use the answer > > > in my code, but I am wondering, if such a feat could be done. > > > > > > I have a following problem: I have a list based upon which I would > > > like to construct a different one. I could simply use list > > > comp

Re: pep 8 constants

2009-06-30 Thread Rhodri James
[Trimming for length, sorry if that impacts too much on intelligibility] On Tue, 30 Jun 2009 02:52:37 +0100, Eric S. Johansson wrote: let's use an example. Admittedly, this is a very simple example but hopefully it illustrates my point What I dictate is: from pots is class telephone Wh

RE: Specific iterator in one line

2009-06-30 Thread Andreas Tawn
> > This is purely sport question. I don't really intend to use the answer > > in my code, but I am wondering, if such a feat could be done. > > > > I have a following problem: I have a list based upon which I would > > like to construct a different one. I could simply use list > > comprehensions,

  1   2   >