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?
Asked
Active
Viewed 676 times
2

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 Answers
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
-
-
-
It does not recognise wr_long as well. Am I going wrong somewhere? – codingsplash Jun 16 '15 at 11:48
-
My bad, I didn't notice you're using python 3. I edited the link to the sources. – Vincent Jun 16 '15 at 11:55