473,320 Members | 2,000 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Re: Stream I/O to a java applet (os.popen?)

Cody Woolaver wrote:
This is all done at the terminal though and i need to have it done through a python file. I'm aware that i will have to use os.popen but am unfamiliar with how it works.
You'll probably want to look at the subprocess module, which replaces
the old os.popen stuff. It's also a bit better at running on Windows.
There are lots of docs and examples relating to subprocess. Probably
some good recipes too, especially for running on windows. I'd begin by
looking on google for "python subprocess example windows."

Bear in mind interactive control of a subprocess is sometimes fraught
with difficulty, as it's easy to deadlock if you're waiting for the
subprocess to say something and it's waiting for you to say something.

On another track, you might want to consider using Jython, as it will
allow your python class file to interact directly with the Java stuff,
rather than having to do it via pipes and subprocesses. The only
downside to Jython currently is it's stuck at Python 2.2 stuff. But
it's a nice integration of Java and Python.
Jun 27 '08 #1
0 728

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: apchar | last post by:
I am trying to use php as a kind of servlet to act as a middle man between a java applet and mysql. I know java has jdbc but it's flakey and painful. php access to mysql is much nicer. So I have:...
0
by: James Hong | last post by:
Help please, I try to sending an email from my html page using the java applet. but it give error on most of the PC only very few work, what is the error i make the java applet show as below ...
2
by: SubbaRao Karanam | last post by:
What does this error for the Code below java.io.StreamCorruptedException: invalid stream header at java.io.ObjectInputStream.readStreamHeader(Unknown Source) at...
2
by: Jonathan | last post by:
Hi I'm doing a project for school and wrote an applet that makes a socket connection to a server (smae host as webserver) that was setup for this project. In the applet there are 3 buttons and by...
1
by: polilop | last post by:
i have an java applet, and when i start it it shows a gray win with x. the console shows java.lang.NoClassDefFoundError: GeomApplet (wrong name: vj3/GeomApplet) at...
2
by: Tim Murray | last post by:
First of all, I don't know much about Java, even its naming and version numbering nomenclature, and second, if there is a better group to ask this in, please let me know. System is Mac with...
4
by: coolsti | last post by:
I have an applet that accepts data as a stream from a php script using the following code snippet: String dataendpoint = "http://phpfunction.php"; URL url = new...
1
by: coolsti | last post by:
I am having a curious problem with Vista working on a Lenovo thinkpad. To test and demonstrate this problem, I have a PHP script that does not terminate. It enters an infinite loop where it...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.