This leads me to think the subprocess is being run under the Windows environment rather than the Linux one.ĮDIT: Sorry, the reference to "test.py" on line 5 of grep-sub.py should be "working. If you try to run grep-sub.py as a subprocess in this script (from Ubuntu in WT), it doesn't recognize grep, but if you run it directly from the shell, it does. ![]() This was obviously a work in progress but it should get the idea across. I'm just going to post the code I was working with, in case that helps: This might be a related but different issue than the one I was originally facing, I'm not sure. The Python version appears in the next line below your command. Execute command: type in python version or python -V and press Enter. Open the terminal application (for example, bash). So it's been a while since I looked at this, but it seems that your solution did solve the inability to append arguments to the command, but the root problem for me ended up being that WSL still seems to be using the Windows version of Python on some level since it is being called from command prompt. Check Python Version Linux (Exact Steps) Three steps to check the Python version on your Linux operating system. Now, after some fiddling I got this to work, except that some of these scripts also use subprocesses to run linux-specific commands such as grep, which are not recognized as commands, since the wt commandline I used to launch the script is actually using Windows, which of course won't recognize the linux commands.īeta Was this translation helpful? Give feedback. What I'm actually trying to do is use Python subprocesses via Popen to launch multiple python scripts within Windows Terminal (using WT's tabbing and panes to organize the running processes).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |