473,513 Members | 2,456 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to simulate a TTY with popen2?

Hi Everybody,

I'm stuck trying to write a python module for the vlc videoplayer on
linux (http://www.videolan.org). I'm using the popen2 module to open a
pipe to the program. If I open the vlc player in a shell it recognizes
that I'm running it from a TTY.
Same command with popen2-4 and the vlc doesn't seem to find a TTY so it
tries to open a gui and fails resulting in ending itself.

So here's my question:
Is there a way to open a pipe in python imitating a TTY or am I doing
something completely wrong?

Greetz TC
Jul 18 '05 #1
2 3324
In article <c2**********@newshispeed.ch>,
Tiziano Bettio <tb*****@transnorm.ch> wrote:
Hi Everybody,

I'm stuck trying to write a python module for the vlc videoplayer on
linux (http://www.videolan.org). I'm using the popen2 module to open a
pipe to the program. If I open the vlc player in a shell it recognizes
that I'm running it from a TTY.
Same command with popen2-4 and the vlc doesn't seem to find a TTY so it
tries to open a gui and fails resulting in ending itself.

So here's my question:
Is there a way to open a pipe in python imitating a TTY or am I doing
something completely wrong?

Greetz TC


Is Pexpect <URL: http://pexpect.sourceforge.net/ > exactly what you want?
--

Cameron Laird <cl****@phaseit.net>
Business: http://www.Phaseit.net
Jul 18 '05 #2
Cameron Laird wrote:
In article <c2**********@newshispeed.ch>,
Tiziano Bettio <tb*****@transnorm.ch> wrote:
Hi Everybody,

I'm stuck trying to write a python module for the vlc videoplayer on
linux (http://www.videolan.org). I'm using the popen2 module to open a
pipe to the program. If I open the vlc player in a shell it recognizes
that I'm running it from a TTY.
Same command with popen2-4 and the vlc doesn't seem to find a TTY so it
tries to open a gui and fails resulting in ending itself.

So here's my question:
Is there a way to open a pipe in python imitating a TTY or am I doing
something completely wrong?

Greetz TC

Is Pexpect <URL: http://pexpect.sourceforge.net/ > exactly what you want?


Thx... works great!!!

TC
Jul 18 '05 #3

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

Similar topics

1
7121
by: Guy | last post by:
Hi I was given an exstremly useful answer to a problem that I had in windows. I'm relativly new with python, but find it exstremly useful. I'm creating a script to run test files and record...
1
1701
by: A. Lloyd Flanagan | last post by:
OK, I've got a weird one I haven't been able to figure out yet. Admittedly I haven't had time to dig into the library source, but this behavior certainly doesn't seem right. Here's a test case: ...
1
3097
by: | last post by:
This could possibly be a bug, but I don't understand it fully so I'm posting here first. Searching the list told me other people are having this problem too. I have created a class which...
4
1655
by: P | last post by:
I've written a couple of apps that required running a command and grabbing the output, and I've found the existing interfaces problematic for this. I think the proliferation of functions and...
1
2646
by: Vivien Mallet | last post by:
Hello, I use popen2.Popen4 and I experienced problems with it. Let me show you with an example. The following script is called "lines" (it prints lines of 'X'): ---------------------...
1
2560
by: Magnus Lycka | last post by:
I'm trying to read standard out in a process started with popen2 in a non-blocking way. (Other good ways of doing this than the one I tried are appreciated.) I've tried to dumb down my code to...
9
1822
by: Martin P. Hellwig | last post by:
Hi all, I was doing some popen2 tests so that I'm more comfortable using it. I wrote a little python script to help me test that (testia.py): --------------------------------- someline =...
3
3090
by: mikem76 | last post by:
How do I automatically redirect stdout and stderr when using os.popen2 to start a long running process. If the process prints a lot of stuff to stdout it will eventually stop because it runs out...
1
1783
by: diego | last post by:
I'm trying to understand how popen2 works. Found in this group, that popen2.popen2 can cause trouble so i chose win32pipe.popen2. have a look a the listing of 2 files: ekmain.py: **************...
0
7160
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5685
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5086
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3233
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1594
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
799
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.