Python Forum
problem in using subprocess module
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem in using subprocess module
#1
hi
when i was reading the page https://realpython.com/python-eval-funct...es-of-eval about eval() in python, i encounterd a problem.
in the code (the below code is on the above page):
# Run the echo command
import subprocess
eval("subprocess.getoutput('echo Hello, World')")

# Launch Firefox (if available)
eval("subprocess.getoutput('firefox')")
when I ran it, I took the below :
Error:
"'firefox' is not recognized as an internal or external command,\noperable program or batch file."
I think the code is used for running Firefox from inside Python. is it true?
why did not the code run successfully?
I have another question:
is it possible to take information about something in Python? For example, suppose I want to know about %
usage in Python. when I am in idle , I wrote help(%), and it takes an error as
Error:
SyntaxError: invalid syntax
. how can I take information about something in idle?
thanks
Reply


Messages In This Thread
problem in using subprocess module - by akbarza - Sep-23-2023, 12:01 PM
RE: problem in using subprocess module - by akbarza - Sep-24-2023, 11:09 AM
RE: problem in using subprocess module - by akbarza - Sep-24-2023, 11:15 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  problem with memory_graph module akbarza 3 421 Mar-04-2024, 10:15 AM
Last Post: snippsat
  problem using coloeama module akbarza 3 619 Jan-08-2024, 07:31 AM
Last Post: akbarza
  problem in import module from other folder akbarza 5 1,533 Sep-01-2023, 07:48 AM
Last Post: Gribouillis
  problem in using pyqrcode module to create QRcode akbarza 9 2,092 Aug-23-2023, 04:17 PM
Last Post: snippsat
  Problem with Pyinstaller. No module named '_tkinter' tonynapoli2309 0 1,048 May-15-2023, 02:38 PM
Last Post: tonynapoli2309
  Problem with module time and leap seconds Pedroski55 3 1,278 Oct-07-2022, 11:27 PM
Last Post: Pedroski55
  Question on subprocess module. knoxvilles_joker 3 2,731 Apr-11-2021, 12:51 AM
Last Post: knoxvilles_joker
  keyboard module; must be root problem philipbergwerf 2 19,255 Apr-04-2021, 11:40 AM
Last Post: philipbergwerf
  Problem with Flask Bcrypt import module marcello86 2 5,810 Aug-31-2020, 08:10 PM
Last Post: marcello86
  Js2Py module not found problem Charliedactyl1 5 8,000 Jun-14-2020, 07:39 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020