![]() And you don’t have as many options as the Microsoft Office suite. Instead of being top-heavy, the options show up in a contextual menu on the side. Pages, for instance, is one of the best Word alternatives for Mac.Īs these are Mac-centric apps, the UI is quite different. These are Apple’s own alternatives to Word, Excel, and PowerPoint. I'll have to look into this.Included with your Mac is the iWork suite: Pages, Numbers, and Keynote. ![]() The question to my mind is what is happening differently in the case of running the script directly from the command line? I don't know if the standard implementation of shell script execution does something special to prevent propagating stdin to the script itself. stdin ( ), so it's not mysterious that when env runs python and in turn python runs the subprocess call, the standard input should remain active. It is apparently well-documented that child processes do inherit their parent process's e.g. running the tool from the command line? I don't know. So why does FastScripts behave differently than e.g. With the contents of the file as the standard input.Īs far as I know this is a pretty conventional way to invoke a shell tool for running arbitrary script-based commands. So for example in your example, it would be running: ![]() The way FastScripts runs shell scripts is to interpret from the #! (shebang) line in the script the name of the tool to run, and then simply running that tool, providing the content of the script file as standard input to the tool being run. I have downloaded and confirmed the same behavior that you see, and am currently trying to make sense of it. Thanks for raising this interesting question. (The Note that calling os.system() in place of subprocess.Popen() causes same, anomalous behavior.įor some reason, FastScripts and only FastScripts seems to direct the content of the script it's running (in the above case, test_subprocess_stdin.py) to the stdin of any (sub) script that gets called within the toplevel script/program. Stdin: subprocess.Popen(cmd2, shell=True) Stdin: subprocess.Popen(cmd1, shell=True) Stdin: cmd2 = '/tmp/reprint_stdin.py /tmp/cmd2out.txt' Stdin: cmd1 = '/tmp/reprint_stdin.py >/tmp/cmd1out.txt' However, strange stuff happens when running the above script(s) from FastScripts: $ # The following demonstrates the scripts running properly: $ cat test_subprocess_stdin.pyĬmd1 = '/tmp/reprint_stdin.py >/tmp/cmd1out.txt'Ĭmd2 = '/tmp/reprint_stdin.py /tmp/cmd2out.txt' I'll be emailing a link to this question to the FastScripts developers/technical support. I've not tested similar behavior with non-Python scripts, but multiple independent Python programs I've written all behave the same way. Not only is this just plain weird, it can cause significant confusion when developing software triggered by FastScripts directives. I'm running MacOS 10.9.5.)įastScripts 2.6.8 appears to copy the content of the current script its running to stdin for any subprocess that runs in said script, as demonstrated by the command-line session below. ![]() Why does the FastScripts application do the following, is it purposeful, and can I or FastScripts developers somehow fix/change the behavior to not do this? (I otherwise find FastScripts to be a superb application. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |