file-association

MacOSX - File extension associate with application - Programmatically

怎甘沉沦 提交于 2019-11-26 12:44:56
问题 I\'m trying to get my program to automatically associate certain file extensions to be opened by it but I\'m not sure how to do that in MacOSX. I\'m not asking how to associate a program with a file extension in the GUI, I want to be able to program it into my program. 回答1: To register a new file extension with an application use the following defaults command. Replace PUT_FILE_EXTENSION_HERE_WITHOUT_PERIOD with the file extension i.e. txt. Replace org.category.program with the com/org name

Associating file extensions with a program

試著忘記壹切 提交于 2019-11-26 11:15:36
问题 I get how to do it, and i have been to http://www.codeproject.com/KB/vb/VBFileAssociation.aspx before. My question is about what doing that does, is it possible to reverse it? What if you do not know where your program will be, and you are just testing it for now? Is there any way for it to \"find\" your program, or an easy way to edit where it is opened? For that matter, is it possible to tell if the file has been associated already, is it an issue to try and reassociate? Finally, how can

Open file with associated application

◇◆丶佛笑我妖孽 提交于 2019-11-26 04:44:23
问题 i want to ask for help with opening a file from c# app with associated app. I tried this: ProcessStartInfo pi = new ProcessStartInfo(file); pi.Arguments = Path.GetFileName(file); pi.UseShellExecute = true; pi.WorkingDirectory = Path.GetDirectoryName(file); pi.FileName = file; pi.Verb = \"OPEN\"; Process.Start(pi); or this: Process.Start(file); where string file in both examples represents full path to the file trying to open. Now, everything is working well, except the (jpg) images with

Windows is not passing command line arguments to Python programs executed from the shell

跟風遠走 提交于 2019-11-26 01:57:44
问题 I\'m having trouble getting command line arguments passed to Python programs if I try to execute them directly as executable commands from a Windows command shell. For example, if I have this program (test.py): import sys print \"Args: %r\" % sys.argv[1:] And execute: >test foo Args: [] as compared to: >python test.py foo Args: [\'foo\'] My configuration has: PATH=...;C:\\python25;... PATHEXT=...;.PY;.... >assoc .py .py=Python.File >ftype | grep Python Python.CompiledFile=\"C:\\Python25\

How to execute Python scripts in Windows?

亡梦爱人 提交于 2019-11-26 00:40:54
问题 I have a simple script blah.py (using Python 2): import sys print sys.argv[1] If I execute my script by: python c:/..../blah.py argument It prints argument but if I execute script by: blah.py argument error occurs: IndexError... So arguments do not pass to script. python.exe in PATH. Folder with blah.py also in PATH. python.exe is default program to execute *.py files. What is the problem? 回答1: When you execute a script without typing "python" in front, you need to know two things about how