return in loop for ?
hello, is it legal to return inside a for loop or am I obliged to break out of the loop before returning ? thanks yomgui -- http://mail.python.org/mailman/listinfo/python-list
Re: return in loop for ?
Mike Meyer wrote: > > yomgui <[EMAIL PROTECTED]> writes: > > is it legal to return inside a for loop > > or am I obliged to break out of the loop before returning ? > > Try it and see: it is not because it does work on an implementation of python that it will work on any other platform or in the futur. yomgui -- http://mail.python.org/mailman/listinfo/python-list
list of lists of lists ....
Hi, I have a list of data (type A) my list can includes element of type A or a lists, these list can includes element of type A or a lists, and so on ... is there a simple way to obtain a single list of all the elemets of type A ? thanks yomgui -- http://mail.python.org/mailman/listinfo/python-list
Re: list of lists of lists ....
I forgot the most important, I am looking for a non recursive method. thanks yomgui yomgui wrote: > > Hi, > > I have a list of data (type A) > my list can includes element of type A or a lists, > these list can includes element of type A or a lists, and so on ... > > is there a simple way to obtain a single list of all the elemets > of type A ? > > thanks > > yomgui -- http://mail.python.org/mailman/listinfo/python-list
Re: list of lists of lists ....
thanks for all your answers yomgui yomgui wrote: > > Hi, > > I have a list of data (type A) > my list can includes element of type A or a lists, > these list can includes element of type A or a lists, and so on ... > > is there a simple way to obtain a single list of all the elemets > of type A ? > > thanks > > yomgui -- http://mail.python.org/mailman/listinfo/python-list
how can I modify an imported variable ?
I've tried this: import MyPackage if MyPackage.aVariable is None: MyPackage.aVariable = True but when I tried to access MyPackage.aVariable from another file (ie through an other import) the value is still None. how can I do this thanks yomgui -- http://mail.python.org/mailman/listinfo/python-list
Re: how can I modify an imported variable ?
hi, your sample code works, but mine doesn't. it must be a multi-thread issue. I am certain that I am modifying MyPackage.aVariable before using it. Both threads are importing MyPackage, but the modification of MyPackage.aVariable is not seen by the other thread. is this possible ? is there a turn around to allow it ? thanks yomgui -- http://mail.python.org/mailman/listinfo/python-list
Re: how can I modify an imported variable ?
actually, it is not linked to threading but to the scope. the second attempt to access MyPackage.aVariable is inside the __init__ of a class and this seems to be the problem. I believe it is a genuine python bug. yomgui -- http://mail.python.org/mailman/listinfo/python-list
alternative to eclipse [ python ide AND cvs ]
Hi, Eclipse is just not really working on linux 64 bit (I tried ubuntu and centos, it is freesing and crashing and extremly slow) I use eclipse for python and cvs, what is "the" good alternative ? thanks yomgui -- http://mail.python.org/mailman/listinfo/python-list
Re: alternative to eclipse [ python ide AND cvs ]
as you said, I re-installed java properly and it solved the problem. thanks. thanks for everybody else for responding yomgui Nathan Harmston wrote: > I have had very few problems with eclipse on ubuntu with pydev > installed. Is it still running under the gnu jvm, not the sun one? It > was crashing on me until I changed them around, detials about changing > it around on ubuntu anyway > > http://ubuntuguide.org/wiki/Ubuntu_Edgy#How_to_install_Java_Integrated_Development_Environment_.28Eclipse.29 > > > > Hope this helps, > > Nathan -- http://mail.python.org/mailman/listinfo/python-list
opensg or openscenegraph
Hi, I need to use a scengraph for my python/opengl application but I have trouble finding out which one I should use. opensg or openscenegraph (OSG) ? I suppose the quality of the python bindings will make the decision. any advice ? thanks yomgui -- http://mail.python.org/mailman/listinfo/python-list
Re: Using subprocess.Popen() in a Windows service
hi, this is how i do it: from subprocess import Popen, PIPE, call, check_call if sys.platform == 'win32': net.processWithoutGui = Popen( ['python', self.temporaryFilename,'-w'], shell=False, cwd=lNetworkDir) else: net.processWithoutGui = Popen( [self.temporaryFilename,'-w'], shell=False, cwd=lNetworkDir) hope it helps yomgui Mark Shewfelt wrote: Hello, I am attempting to use Popen() in a Windows service. I have a small Win32 .exe that I normally run through the os.popen2() function. I've written a class to work with the input and output parameters that are passed and captured from this exe. When I use the class outside of a service using either subprocess.Popen or os.popen2 work just fine. When I use this class inside a Windows service it doesn't work. It doesn't crash the service or anything but there are no values returned from the Popen. Here's how I'm calling Popen: p = subprocess.Popen( cmd, shell=True, bufsize=128, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd="C:\\path_to_exe\\" ) p.wait() (modbus_stdin, modbus_stdout)=(p.stdin,p.stdout) lines = modbus_stdout.readlines() While this doesn't fail there is nothing in the lines variable when it finishes. I am using Python 2.5 on a Windows XP Professional machine. Any help would be greatly appreciated. Best Regards, Mark Shewfelt -- http://mail.python.org/mailman/listinfo/python-list
