Re: Running an interactive subprocess with Popen
On Apr 10, 2:56 am, "Diez B. Roggisch" wrote: > David Liang schrieb: > > > > > > > Hello, > > Sorry for the newbie question. How do I run a program that could > > block, waiting for user input, using subprocess.Popen? For example, > > > from subprocess import * > > > def foo(): > > a = Popen(['python'] ...) > > > I want to be able to get input from the user and send input to the > > subprocess, printing stdout and stderr as data becomes available, then > > return once the subprocess exits. Is it possible to send to the > > subprocess keyboard interrupts, EOF, and such? > > > I tried doing stdout=PIPE, stderr=PIPE, stdin=PIPE. I tried using > > communicate(), but could only call it once; subsequent calls raised > > "ValueError: I/O operation on closed file." > > And both a.stdout.read() and a.stderr.read() blocked the program. Any > > help would be much appreciated. > > Use pexpect, which emulates a pseudo-terminal speaking with the subprocess. > > Diez- Hide quoted text - > > - Show quoted text - I am not sure about that particular issue put I did manage to get it working with windows in the dex tracker project.. you would have to search the files or something to figure out where.. when you are looking at examples it does matter wich operating system you are using at least for python 2.5 -- http://mail.python.org/mailman/listinfo/python-list
Re: GUI Programming
On Apr 12, 8:07 am, Gabriel wrote: > Hello, > > I'm python newbie and i need to write gui for my school work in python. > I need to write it really quick, because i haven't much time .) > So question is, which of gui toolkits should i pick and learn? I heard > PyGTK and Glade are best for quick gui programming? Is it good for > beginner? Or is there something better? > I have some experience with java swing, btw.. pygame may work for you (sdl doesn't work on my compaq though so test the examples befour reading the manual)... most of the other ones are going to be "ugly".. If what you want is realy simple and pygame doesn't work for you may want pycap (a gaming system with python embeded) .. What do you need it to do?? just simple buttons??? -- http://mail.python.org/mailman/listinfo/python-list
Re: Create standalone Windows program with simple graphics?
On Apr 16, 8:12 am, Poster28 wrote: > Hi, > > I'd like to program and compile a simple graphics program (showing something > like a chess board, some numbers and buttons, mouse support) and provide it > as a standalone binary for Windows users. > > What is the easiest way to do that? Which libraries or compilers I should > use? I recently tried pycap for that.. It is a game engine that has python embeded in it http://www.farbs.org/pycap.html It seems to work better with sprites than with the builtin rectangle command so I would try a black square picture and a white square picture but that might be just my code since there where just a couple examples available. http://dexrowem.blogspot.com/2009/04/pycap-drum-machine-or-piano-roll-beta.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Create standalone Windows program with simple graphics?
On Apr 17, 1:48 am, edexter wrote: > On Apr 16, 8:12 am, Poster28 wrote: > > > Hi, > > > I'd like to program and compile a simple graphics program (showing something > > like a chess board, some numbers and buttons, mouse support) and provide it > > as a standalone binary for Windows users. > > > What is the easiest way to do that? Which libraries or compilers I should > > use? > > I recently tried pycap for that.. It is a game engine that has python > embeded in it > > http://www.farbs.org/pycap.html > > It seems to work better with sprites than with the builtin rectangle > command so I would try a black square picture and a white square > picture but that might be just my code since there where just a couple > examples available. > > http://dexrowem.blogspot.com/2009/04/pycap-drum-machine-or-piano-roll... or you can just try pygame.. I am not sure what it takes to distrute just the python2.5 exe and a library like wxpython.. it seems to work but I am not sure if it is taking the python envirement on the installed version or go to the folder of the newly copied python 2.5 .. seems like you would need a machine without python installed to know for sure.. -- http://mail.python.org/mailman/listinfo/python-list
Re: wxpython and zoom/pan image
On May 24, 8:57 am, "Barak, Ron" wrote: > Hi Ross, > You probably would get more focused answers if you addressed the question to > the wxPython list at [email protected] > As for your question, seeing your (simplified) code might help: out of hand, > what you want to do is catch the events you're interested in (e.g., > double-left-click) and create functions/class-instances that would perform > the needed actions. > I'd suggest reading "wxPython in Action" (ISBN 1-932394-62-1) as it would > give you most of the answers you seek. > Bye, > Ron. > > > > > -Original Message- > > From: [email protected] [mailto:[email protected]] > > Sent: Sunday, May 24, 2009 03:28 > > To: [email protected] > > Subject: wxpython and zoom/pan image > > > Hi, > > > I've googled for this, but can only find things like > > openlayers that is a web-based javascript solution. > > > I need to display an image at various zoom levels and want to > > allow the user to pan around in the Google maps style, that > > is, left-click hold and drag. The code should also action > > double-clicks on the image (but that's easy). > > > There are no 'standard' wxpython widgets that allow this. > > Can anyone point me to information on how to implement such a > > thing, or maybe some working code? > > > Thanks, > > Ross- Hide quoted text - > > - Show quoted text - I think I remember seeing an example about zooming somewhere on the wxpython list or wiki... -- http://mail.python.org/mailman/listinfo/python-list
Re: Python -> R?
On May 23, 8:20 am, Esmail wrote: > Hello! > > Anyone using Python scripts and accessing some of R's functionality? > If so, what are you using? I have read about RPy, is that a good > solution? Are there others that can be recommended or are preferred? > > I would prefer to code in Python instead of R :-) > > Thanks, > Esmail I was playing around with a r sound module and looking at the graphic stuff and I have downloaded the rpy thing but I have never used it I have been looking for a good excuse to use it... It looks like it could be useful for graphing stuff or maybe alogrithmic (spelling I am sure) composition... The R people have a publication somewhat like the python papers where you might find something intresting. -- http://mail.python.org/mailman/listinfo/python-list
Re: PureData py/pyExt into standalone python
On May 23, 6:49 am, [email protected] wrote: > Hi guys, > > Short version: > > I've written some python classes for py/pyExt extensions for the > "dataflow" graphical programming environment PureData. Here's an > example PureData screenshot for clarity: > > see:http://i40.tinypic.com/2rrx6gy.jpg > > My classes talk to eachother via the PureData system, and they talk to > the outside world via pyPortMIDI (which enables raw MIDI data > communication). > > PureData encourages modularisation, so I've written several classes: > * some that receive raw MIDI data, > * some that parse this into human-readable tokens, > * some that just generate human-readable tokens, > * and some that parse human-readable tokens then send raw MIDI data > > I want to join these together as a stand-alone python application, > using internal python communication instead of PureData... > > ...but I don't know how to do this. The only python I know comes from > writing using the pyExt API, and the PureData API (which is written in > C). > > > Long(er) version: > > Miller Pukette's PureData:http://puredata.info/ > Thomas Grill's Flext:http://puredata.info/Members/thomas/flext > Thomas Grill's Py/Pyext:http://puredata.info/Members/thomas/py/ > John Harrison's PyPortMIDI:http://www.media.mit.edu/~harrison/code.html > CMU's PortMIDI:http://www.cs.cmu.edu/~music/portmusic/ > > PureData is a graphical "dataflow" programming environment that (among > many, many other things!) allows for very rapid development of Audio > and MIDI processing. Objects in PureData (and MaxMSP) communicate by > sending messages through "patch cords" that connect an "outlet" to an > "inlet" of another object. > > Thomas Grill's py/pyExt allows python code to be embedded as a > PureData object. The benefit being that this python code can be > effortlessly ported across multiple platforms (win32/linux/osx) and > also to the highly related (but more commercial) Cycling'74 MaxMSP > system. (PureData object code is written in C and generally not easy > to port between platforms, nor between PD and MaxMSP - so writing > portable python objects is a boon!) > > a pyExt object sends messages from its outlets using the line: > > self._outlet(outlet_id,message_to_send) > > a pyExt object performs actions when a message arrives at an inlet. An > integer arriving at inlet 1 could be attached to this method code: > > def int_1(self,*arg): > print "received integer:",arg[0] > > If these pieces of code were in separate python classes - how would I > connect two objects together such that an integer was passed between > the two? > > If the first object sent 42, in puredata it would look like this: > > http://i44.tinypic.com/15eh74p.gif > > useless fact: the screenshot doubles up (i.e. "pyext sender sender") > due to the first word being the python file (i.e. sender.py), whilst > the second is the name of the object class (i.e class sender > (pyext._class) > > > Maybe a more tricky question is: > > PureData supports "message busses" - messages sent to named busses can > be broadcast to multiple locations. How would I connect objects up in > this way using python? > > a pyExt object registers to receive messages on a certain bus using: > > self._bind(bus_name,self.method_to_call) > > def method_to_call(self,*arg): > print "a message on", bus_name, "arrived" > print "the message was", len(arg), "long" > print "and had the values", arg, "inside" > > a pyExt object sends messages to a particular bus by using: > > self._send(bus_name,message_to_send) * some that parse this into human-readable tokens, * some that just generate human-readable tokens, This might be usefull do you intend to release this code?? There are some midi libraries that may be helpful, it is hard to tell what you need without seeing the code -- http://mail.python.org/mailman/listinfo/python-list
Re: What text editor is everyone using for Python
On May 30, 6:28 am, "Hendrik van Rooyen" wrote: > "Lie Ryan" wrote: > > norseman wrote: > > > Suggestion: > > > Take a look at the top two most used OS you use and learn the default > > > (most often available) text editors that come with them. > > > Which means Notepad on Windows? > > you could live dangerously and use WordPad... > > - Hendrik I will sometimes use word pad but i perfer syntax highlighting.. I have been tempted to fork out some cash what I would be after is to be able to define my syntax file, the ability to use code snippits, the ability to add tools and compilers... until then I use spe, vim, emacs, boa constructor, I had a couple of other ones but I probily won't miss them that much.. The python to c compiler coming of age is something I am looking foward to and is something I would like to have supported in my editor (shedskin it is all coming back to me now). -- http://mail.python.org/mailman/listinfo/python-list
Re: is anyone using text to speech to read python documentation
On Jun 2, 7:52 pm, "[email protected]" wrote: > I wrote a small pre-processor for python documentation and I am > looking for advice on how to get the most natural sounding reading. I > uploaded an example of a reading of lxml documentation as a podcast1 > > http://dexrow.blogspot.com/2009/06/python-voice-preprocessor.html. I take it identifing html tags and changing the wording would help : ( I will fix that.. -- http://mail.python.org/mailman/listinfo/python-list
Re: is anyone using text to speech to read python documentation
On Jun 3, 12:28 pm, Stef Mientki wrote: > [email protected] wrote: > > I wrote a small pre-processor for python documentation and I am > > looking for advice on how to get the most natural sounding reading. I > > uploaded an example of a reading of lxml documentation as a podcast1 > > >http://dexrow.blogspot.com/2009/06/python-voice-preprocessor.html. > > Depends what OS you want to use, on Windows it's very easy: > > import win32com.client > s = win32com.client.Dispatch("SAPI.SpVoice") > s.Speak('Is this punthoofd ') > > cheers, > Stef That is intresting and might be useful but isn't what I am doing. alot of the time you will see stuff like >>> that needs to be changed into other wording so you have one file that gets transformed into another text that makes more sense when read. I haven't changed html tags into something that makes more sense when spoken so my example is a little defective -- http://mail.python.org/mailman/listinfo/python-list
Re: best vi / emacs python features
On Oct 7, 10:07 am, OdarR wrote: > hello, > > * this is not a troll * > > which kind of help you have with your favorite editor ? > > personnally, I find emacs very nice, in the current state of my > knowledge, when I need to reindent the code. > you know how this is critical in python...:-) > > I don't use other python-mode features for the moment, maybe you have > some advices. > I used with success an Xemacs on Solaris, as well as a Aquamacs on > Mac. > > For the vi/vim guys, explain us the best features this editor give you > in your py files ! > > thanks, > > Olivier I like alot of the features of both on gvim they show white space symbols but I find both emacs and gvim a pain to extend and I need to find a key word and then hilight columns so because of the complexity it has become rich edit vs scintilla.. I wrote my own syntax highlighter for rich edit 2 for csound but not with all the complexity I am planning later.. jedit looked very intresting but I haven't figured out the output window yet they do have python embeded well jython anyway (like gvim does) -- http://mail.python.org/mailman/listinfo/python-list
Re: python along or bash combined with python (for manipulating files)
On Oct 14, 3:42 am, Jean-Michel Pichavant wrote: > Peng Yu wrote: > > Bash is easy to use > > +JOTW > > :) > > JM why choose.. http://shython.sourceforge.net/ I don't think this is the most recent I would also try the package index -- http://mail.python.org/mailman/listinfo/python-list
Re: install older Python version parallel
On Jun 11, 8:50 am, "S. Dornseifer" wrote: > Hi everybody, > > The situation: > I wrote a GUI, based on Python, TkInter and Pmw. > It runs perfectly fine with Python 2.4 (providing, TkInter and Pmw are > installed). But it crashes with Python 2.6. I tried this on MacOSX11.4 > and various Linux Distributions. > Crashes occurs when I activate a Pmw.Diaog (I guess this is due to a bug > in the installed blt package), also when I use setitems on > Pmw.OptionMenu (I guess this is due to another package, associated with > tcl/tk). > > The target: > I have to get my GUI work under openSUSE 11.1 (x86_64). > > My plan: > On my openSUSE 11.1 (x86_64), Python 2.6 is installed by default. > I would like to know, how to install Python 2.4 along with TkInter and > Pmw (and packages that are required by them), parallel to the existing > Python 2.6. So that I do not break other software that depends on Python > 2.6. > > If you can think of another plan, I would be also glad to discuss it. > > Cheers, > Simon 0n windows I had multiple versions installed ex python24 python25 i would write a batch file C:\python24\python.exe test.py pause the pause is there just so that I can see an error message if there is one. I have no idea what would work for the mac or linux though... I suspect something simular might work after all why rewrite all your software because someone else wants you to have a particular version of python not with the amount of disk space that is available now-adays.. -- http://mail.python.org/mailman/listinfo/python-list
Re: install older Python version parallel
On Jun 11, 8:50 am, "S. Dornseifer" wrote: > Hi everybody, > > The situation: > I wrote a GUI, based on Python, TkInter and Pmw. > It runs perfectly fine with Python 2.4 (providing, TkInter and Pmw are > installed). But it crashes with Python 2.6. I tried this on MacOSX11.4 > and various Linux Distributions. > Crashes occurs when I activate a Pmw.Diaog (I guess this is due to a bug > in the installed blt package), also when I use setitems on > Pmw.OptionMenu (I guess this is due to another package, associated with > tcl/tk). > > The target: > I have to get my GUI work under openSUSE 11.1 (x86_64). > > My plan: > On my openSUSE 11.1 (x86_64), Python 2.6 is installed by default. > I would like to know, how to install Python 2.4 along with TkInter and > Pmw (and packages that are required by them), parallel to the existing > Python 2.6. So that I do not break other software that depends on Python > 2.6. > > If you can think of another plan, I would be also glad to discuss it. > > Cheers, > Simon I suspect you want to install python 2.4 and then reinstall 2.6 I did that in windows and I don't understand why it wouldn't work in linux -- http://mail.python.org/mailman/listinfo/python-list
Re: first full alpha release of PyLab_Works v0.3
On Jun 16, 12:27 pm, Stef Mientki wrote: > hello, > > I am pleased to announce the first full alpha release of PyLab_Works, v0.3. > > PyLab_Works is a modular Visual Development Environment, based on > data-flow programming technics. PyLab_Works is specially aimed at > Education, Engineering and Science. The ideas behind PyLab_Works are, > that the final user should not be burdened with programming details and > domain details, whereas the domain expert should be able to implement > the specific domain knowledge without being a full educated programmer. > > You can always find my notes on PyLab_Works on > http://pic.flappie.nl > Most of these pages are also collected in a single pdf document, which > can be found here: > http://pylab-works.googlecode.com/files/pw_manual.pdf > > The source code and a one-button-Windows-Installer can be found on > codegoogle: > http://code.google.com/p/pylab-works/ > The files are rather large, because they contain some data samples. > The Windows-Installer contains everything you need to get started with > PyLab_Works: ConfigObj, gprof2dot, HTTPlib, MatPlotLib, Numpy, Pickle, > Psyco, pyclbr, PyGame, PyLab_Works, PyODBC, Python, RLCompleter, Scipy, > Sendkeys, SQLite3, SQLObject, URLparse, wave, Visual, win32*, wxPython. > Although the PyLab_Works programs are compiled with Py2Exe, all the > source files are explicitly included. > > have fun, > Stef Mientki program didn't start because .dll is missing (sorry I don't have the name)... I don't know if that is just an issue with the installer with vista or not (missing msv something 71. dll) -- http://mail.python.org/mailman/listinfo/python-list
Re: first full alpha release of PyLab_Works v0.3
On Jun 17, 12:29 am, "Martin P. Hellwig" wrote: > edexter wrote: > > On Jun 16, 12:27 pm, Stef Mientki wrote: > >> hello, > > >> I am pleased to announce the first full alpha release of PyLab_Works, v0.3. > > >> PyLab_Works is a modular Visual Development Environment, based on > >> data-flow programming technics. PyLab_Works is specially aimed at > >> Education, Engineering and Science. The ideas behind PyLab_Works are, > >> that the final user should not be burdened with programming details and > >> domain details, whereas the domain expert should be able to implement > >> the specific domain knowledge without being a full educated programmer. > > >> You can always find my notes on PyLab_Works on > >> http://pic.flappie.nl > >> Most of these pages are also collected in a single pdf document, which > >> can be found here: > >> http://pylab-works.googlecode.com/files/pw_manual.pdf > > >> The source code and a one-button-Windows-Installer can be found on > >> codegoogle: > >> http://code.google.com/p/pylab-works/ > >> The files are rather large, because they contain some data samples. > >> The Windows-Installer contains everything you need to get started with > >> PyLab_Works: ConfigObj, gprof2dot, HTTPlib, MatPlotLib, Numpy, Pickle, > >> Psyco, pyclbr, PyGame, PyLab_Works, PyODBC, Python, RLCompleter, Scipy, > >> Sendkeys, SQLite3, SQLObject, URLparse, wave, Visual, win32*, wxPython. > >> Although the PyLab_Works programs are compiled with Py2Exe, all the > >> source files are explicitly included. > > >> have fun, > >> Stef Mientki > > > program didn't start because .dll is missing (sorry I don't have the > > name)... I don't know if that is just an issue with the installer > > with vista or not (missing msv something 71. dll) > > You probably mean the microsoft visual C++ runtime (msvcr71.dll), > windows vista has a brand new way (via manifest files) to make it more > difficult to install compiled binaries. > > Search for 'Microsoft Visual C++ 2005 Redistributable Package' and > install it. > > -- > MPHhttp://blog.dcuktec.comm > 'If consumed, best digested with added seasoning to own preference.' it says I am missing msvcp71.dll installing Microsoft Visual C++ 2005 Redistributable Package did not help.. I had simular problems with alot of installers I had saved (from installing on xp) but when I grabbed newer installers they all worked, could be the manifast I was looking forward to trying it out.. -- http://mail.python.org/mailman/listinfo/python-list
