Piping in PyCharm
I'm a first-year university student in a Python introductory course. We are doing an assignment in which we need to pipe commands from python to a java program written by a student in the University, Quickdraw http://pages.cpsc.ucalgary.ca/QuickDraw/. I tried typing medal_count.txt | C:\"Program Files (x86)"\Java\jre6\bin\java.exe -jar quickdraw.jar in the Create/Run Debug Configuration in the Script box, but I got [Errno 22] Invalid argument. Process finished with exit code 2. I checked that the files I'm piping exist in the same directory as the .txt file, "medal_count.txt".
I am very new to PyCharm, but I want to learn how to use all of its features. Moreover, I am very new to programming.
How do I pipe from Python to Java in PyCharm?
Please sign in to leave a comment.
Hello Sean,
Unfortunately this will not work in a run configuration of PyCharm. Piping
is a feature of the command processor (cmd.exe). PyCharm runs the Python
interpreter directly, rather than via cmd.exe, and intercepts the output
of your process itself.
You can set up an external tool to run your script via cmd.exe with piping
in Settings | External Tools.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"