473,396 Members | 1,987 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,396 software developers and data experts.

Results from os.system() different from execution at prompt

Hi all,

I am using mpeg_encode under Linux to generate little movies. The
parameter file is generated by a Python script, the last line of which is

os.system('mpeg_encode mpeg.par')

When I execute the same command at the bash prompt, the resulting movie
is longer, i.e., it has more frames.

I have piped the outpout from both the Python-executed and
prompt-executed mpeg_encode into files and found a difference, although
the parameter files were the same file in both runs:

Prompt-executed:

MPEG ENCODER STATS (1.5b)
------------------------
TIME STARTED: Mon Dec 29 16:33:08 2003
MACHINE: PC227
FIRST FILE: /homes/emiddelb/local/pics/eberg_movie/webcam/title.jpg
LAST FILE: /homes/emiddelb/local/pics/eberg_movie/webcam/eff_1975
PATTERN: ibbbpbbbpbbb
GOP_SIZE: 30
SLICES PER FRAME: 1
(...)

Python's os.system():

MPEG ENCODER STATS (1.5b)
------------------------
TIME STARTED: Mon Dec 29 16:28:05 2003
MACHINE: PC227
FIRST FILE: /homes/emiddelb/local/pics/eberg_movie/webcam/title.jpg
LAST FILE: /homes/emiddelb/local/pics/eberg_movie/webcam/eff_1
PATTERN: ibbbpbbbpbbb ^^^^^^^^^^^^
GOP_SIZE: 30
SLICES PER FRAME: 1
(...)
So, the Python-executed mpeg_encode reports fewer input files. Any clues
why this could happen? Is there a limit on the command length or so? I
see no reason why the results from the two ways of calling mpeg_encode
should be different.
Kind regards,

Enno

Jul 18 '05 #1
2 1620
Enno Middelberg wrote:
So, the Python-executed mpeg_encode reports fewer input files. Any
clues why this could happen? Is there a limit on the command length
or so?


Why do you think the reason for this behaviour could be truncated
command line? You just call 'mpeg_encode mpeg.par', this line
shouldn't be too long neither for python nor for the shell.

Mathias
Jul 18 '05 #2
On Mon, Dec 29, 2003 at 05:38:25PM +0100, Mathias Waack wrote:
Enno Middelberg wrote:
So, the Python-executed mpeg_encode reports fewer input files. Any
clues why this could happen? Is there a limit on the command length
or so?


Why do you think the reason for this behaviour could be truncated
command line? You just call 'mpeg_encode mpeg.par', this line
shouldn't be too long neither for python nor for the shell.

.... and a commandline that is too long should cause a non-zero return
status, not run the program with an incorrect argument list:
os.system("true x") 0 os.system("true " + "x" * 320000)

32512

Jul 18 '05 #3

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

Similar topics

1
by: LRW | last post by:
I have a SQL string with a couple of JOINs that works perfectly in command prompt. I get results for all the fields selected just fine. But when I put it into a PHP page, I can't make variables(?)...
30
by: Sean R. Lynch | last post by:
I've been playing around with Zope's RestrictedPython, and I think I'm on the way to making the modifications necessary to create a capabilities-based restricted execution system. The idea is to...
8
by: shannon | last post by:
Hi all, i am new to javascript and was wondering if anyone can help with this assignment? Any help will be great. Shannon A small airline has just purchased a computer for its new...
4
by: Rob | last post by:
When issuing... System.Console.Write and WriteLine commands... the program shells out to Command prompt, displays message, and closes... there is no time to view what is shown,,, how can you...
14
by: Mr Newbie | last post by:
I am often in the situation where I want to act on the result of a function, but a simple boolean is not enough. For example, I may have a function called isAuthorised ( User, Action ) as ?????...
13
by: vasudevmukherjee | last post by:
Hi! Can somebody help tell me why the following code gives a garbage value while producing first student's name, whereas it gives the names correctly for other three students - I really fail to...
74
by: aruna.mysore | last post by:
Hi all, I have a simple definitioin in a C file something like this. main() { char a; ....... int k; }
15
by: wizofaus | last post by:
I have a chunk of code which is essentially IDbCommand cmd = db.CreateCommand(); cmd.CommandText = "SELECT X, Y, Count(*) FROM Foo WHERE Z = 1 GROUP BY X, Y"; using (IDataReader reader =...
16
by: Paul Schwann | last post by:
Hi group, I am relatively new to C# (although I have a lot of programming excperience in other languages like Java and C). Currently I am searching for a solution to this problem: Suppose you...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.