#----------------------------------------------------------------------------- # Copyright (c) 2013, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- import sys print "Argv from python:", sys.argv # Testing the argv capturing capability on the Mac is not that easy, but doable. First, build the app bundle # with PyInstaller, like this: # # python $path_to_your_pyinstaller/pyinstaller.py -w -d test_argv_emulation.py # # The result should be test_argv_emulation.app. Then, create a file called Info.plist and place the attached # text into it, and copy it to test_argv_emulation.app/Contents/. Finally, create a file called "a.foo", and drag/drop that # file onto the test_argv_emulation.app's icon in the Finder. The app will very briefly run, and should print an output to # stdout, which is viewable in the Mac's Console app. The output should read something like: # # Argv from python: ['/the/path/to/the/app','/the/path/to/the/file/a.foo'] # # The Mac's Console app is not terminal. Mac's Console app is a log viewer of system's messages. # This app can be found in your Applications (icon in the taskbar), then utilities, then Console.app. # http://en.wikipedia.org/wiki/Console_(OS_X) """ CFBundleDevelopmentRegion English CFBundleDisplayName test_argv_emulation CFBundleDocumentTypes CFBundleTypeExtensions foo CFBundleTypeNameFoo Test Document CFBundleTypeRole Viewer CFBundleExecutable test_argv_emulation CFBundleIdentifier org.pythonmac.unspecified.test_argv_emulation CFBundleInfoDictionaryVersion 6.0 CFBundleName test_argv_emulation CFBundlePackageType APPL CFBundleShortVersionString 0.0.0 CFBundleSignature ???? CFBundleVersion 0.0.0 LSHasLocalizedDisplayName NSHumanReadableCopyright Copyright not specified NSMainNibFile MainMenu NSPrincipalClass NSApplication """