Miguel
Miguel

Reputation: 21

Is there any way to compile py scripts to pyc as Python 2.7 from a 3.7 script?

I would like to:

from a python 3.7 scripts do a compileall.compile_dir('.')

to create pyc's of quite many scripts written in 2.7

I am now getting syntax errors against 3.7. Is there any way to accomplish this?

Thanks a lot and HappyNY!

Upvotes: 0

Views: 75

Answers (1)

Shamanou
Shamanou

Reputation: 41

You first need to convert the syntaxis of the python 2.7 scripts to python 3.7 using 2to3 Afterwards i expect your procedure to work.

Upvotes: 1

Related Questions