Launch Excel file from Python on Mac -


i'd start excel file python on mac. when hardcode file path in following lines works fine.

import os os.system("open -a 'microsoft excel.app' 'path/file.xlsx'") 

but problem instead of hardcoding path solution should like:

file_path = '/users/path/file.xlsx'   import os   os.system("open -a'microsoft excel.app' 'file_path'") 

apparently not work. in advance

try maybe:

os.system("open -a 'microsoft excel.app' '%s'" % file_path)


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -