2

I have a string print("hello"). I want to directly store this as a .pyc file and execute it later. How can I do this?

codingsplash
  • 4,785
  • 12
  • 51
  • 90
  • Please have a look at this [SO Answer](http://stackoverflow.com/a/5607315/1155650) for the [Question](http://stackoverflow.com/q/5607283/1155650) – Rohit Vipin Mathews Jun 16 '15 at 11:17
  • I am already aware of py_compile, which necessiates a .py file. I want to do the same without a .py file getting created. – codingsplash Jun 16 '15 at 11:18

1 Answers1

0

Take a look at the py_compile.compile and its source code to see how it is done.

Vincent
  • 12,919
  • 1
  • 42
  • 64