Sending Commands to Python Program

Wednesday, 22 September 2010, 260
>>> import sys,os
>>> def doit(command):
                os.system(command)
                print("Executed")
>>> doit('print("Hello Python!")')
Executed
>>>

Leave a comment
Name(required)
Mail (will not be publishing) (required)
Website

  • "I am a dreamer. Seriously, I'm living on another planet."
  • Lütfü Hoca

  • Categories

  • Archives