July 14th, 2012, 08:05 PM
Join Date: Jul 2012
Time spent in forums: 28 m 54 sec
Reputation Power: 0
From Python Script, execute python file with argument conditions
I'm new to python and after reading materials on libraries sys, getopt, and argparse I'm even more confused.
So.. here's what I have so far and of course, I'm missing some important pieces somewhere:
#1 /user/bin/env python
# Made in Eclipse with PyDev for Python 2.7+ -XRMod
#Edit the path variables to match your particular setup.
CALCDEPS_PATH = 'C:/Compiler/ClosureLibrary/closure/bin/' #directory containing calcdeps.py
DEPS_PATH = 'C:/Compiler/ClosureLibrary/closure/goog/' #directory containing deps.py
JAR_PATH = 'C:/Compiler/ClosureLibrary/' #directory containing compiler.jar
CLOSURE_PATH = 'C:/Compiler/ClosureLibrary/' #contains directory "closure"
SCRIPT_PATH = 'C:/Compiler/ClosureLibrary/' #directory containing your scripts
#Calcdeps will now be executed with arguments using PATH variables
--input DEPS_PATH/deps.js \
--input SCRIPT_PATH/Firefly.js \
--input SCRIPT_PATH/hover.js \
--output_mode compiled \
--compiler_jar JAR_PATH/compiler.jar \
--compiler_flags "--compilation_level=ADVANCED_OPTIMIZATIONS" \
--compiler_flags "--warning_level=VERBOSE" \
--compiler_flags "--define=goog.LOCALE='de'" > output-compiled.js
So how do I go about properly defining the arguments and executing the file with them?
I'm in a windows 7 x64 environment using Eclipse with PyDev.
Thank you for help.
I forgot to mention, I'm using Python 2.7