Home  >  Q&A  >  body text

How to call python2 from python3 program?

I need to call an independent module written in python2 (pass some parameters) in a program written in python3. In addition to using subprocess, is there a more elegant way?

PHP中文网PHP中文网2648 days ago894

reply all(3)I'll reply

  • 欧阳克

    欧阳克2017-06-22 11:54:14

    It’s better to upgrade 2 to 3. Use py2to3.py

    reply
    0
  • 某草草

    某草草2017-06-22 11:54:14

    Use __future__ in python2?

    reply
    0
  • 欧阳克

    欧阳克2017-06-22 11:54:14

    A more elegant way is to upgrade the python2 program to a python3 program.

    reply
    0
  • Cancelreply