piping question
I have been working on a little frontend for newspost. It runs newspost just fine and gets it's output. The problem is that i want it to get the stdout as the program runs, not hold it all till it's finished. I've tried a few variations of popen , and others with no luck. Here is the subroutine that executes newspost: def on_BT_go_clicked(self,obj): self.notebook.set_current_page(3) newspost = "newspost -i " + self.newsserver.get_text() + " " newspost += "-z " + self.port.get_text() + " " if self.username.get_text() != "": newspost += "-u " + self.username.get_text() + " " if self.password.get_text() != "": newspost += "-p " + self.password.get_text() + " " newspost += "-f " + self.email.get_text() + " " newspost += "-n " + self.newsgroup.get_text() + " " newspost += "-s \"" + self.subject.get_text() + "\" " if self.include_file_x_of_y.get_active(): newspost += "-q " if self.yenc.get_active(): newspost += "-y " for row in self.listmodel: newspost += "\"" + row[0] + "\" " pipe = os.popen(newspost) while 1: output = pipe.read() if not(output): break textiter = self.textbuffer.get_end_iter() self.textbuffer.insert(textiter, output) pipe.close() -- http://mail.python.org/mailman/listinfo/python-list
piping question
I forgot to add that i'm running ubuntu with python 2.4, and the imports
are:
import os
import pygtk
pygtk.require('2.0')
import gtk
import gtk.glade
--
http://mail.python.org/mailman/listinfo/python-list
Re: piping question
Thanks. I would have wasted a good day trying to figure that out. I found a work around. I'll just run the output in a terminal. -- http://mail.python.org/mailman/listinfo/python-list
Re: How protect proprietary Python code? (bytecode obfuscation?, what better?)
>>I'm afraid that the only *proven* way to protect code from >>reverse-engineering is to not distribute it *at all*. ain't that the truth. A hex editor would stop the "PyRun_SimpleString(secret_code)" Even if you encrypt your string they have to run at some point. A couple clicks in decent disassembler like softice when the program is running, and the program will have un-encrypted it for you. And besides, when you introduce drm (copy protection) into a program, you you take a chance on introducing bugs. There's nothing worse than losing legitimate customers over copy protection. Clean, Stable, Working programs sell better. The people that steal are going to steal it. So why not make people want to give you money for the good job you did. Not some buggy crap of a program that's too worried you might steal something. -- http://mail.python.org/mailman/listinfo/python-list
