philc
December 29th, 2007, 07:44 PM
I'm very new to Python and trying to teach myself. I've read a few beginner tutorials, and I find it easiest to learn when I have a goal important to me, rather than simple "Hello World" examples.
Anyway, I have a Bash script that takes a user defined video file at run time, asks a bunch of questions, then alters the file based on those answers, and outputs a new file using FFMPEG.
Script is here if you're interested:
http://www.kapitalworks.com/projects/ffmpeg/kapitaltranscode
I'm OK so far with how general user input in Python works, in terms of user is asked a question and the program interprets the answer.
What I'm stuck on is what comes before.......
The Bash script is executed in the following way:
~$ scriptname.sh inputfilename,extension
Where inputfilename.extension is a file in the user's current directory, that they wish to convert to a different format using FFMPEG
The script then takes this input as input_file=$1
Obviously this is invalid syntax in Python, so essentially I'm looking for the equivalent way of doing this. I can't really see an answer so far from reading the tutorials I've tried (e.g. A Byte of Python and hetland.org: Instant Hacking)
Any help most appreciated.
Anyway, I have a Bash script that takes a user defined video file at run time, asks a bunch of questions, then alters the file based on those answers, and outputs a new file using FFMPEG.
Script is here if you're interested:
http://www.kapitalworks.com/projects/ffmpeg/kapitaltranscode
I'm OK so far with how general user input in Python works, in terms of user is asked a question and the program interprets the answer.
What I'm stuck on is what comes before.......
The Bash script is executed in the following way:
~$ scriptname.sh inputfilename,extension
Where inputfilename.extension is a file in the user's current directory, that they wish to convert to a different format using FFMPEG
The script then takes this input as input_file=$1
Obviously this is invalid syntax in Python, so essentially I'm looking for the equivalent way of doing this. I can't really see an answer so far from reading the tutorials I've tried (e.g. A Byte of Python and hetland.org: Instant Hacking)
Any help most appreciated.