[英]Conditionally executing some part of python code as 2.x in a 3.x program
There is an option of __future__
to import modules from python 3.x
into 2.x
venv. __future__
选项可以将模块从python 3.x
导入2.x
venv。 Is there a similar option that allows 2.x code to be run in 3.x venv. 是否有类似的选项允许2.x代码在3.x venv中运行。
Some thing like 就像是
__use2.x__:
#2.x code block
#back to 3.x code
This is to be used to merge codes from different versions while upgrading to a higher level of python. 这用于合并来自不同版本的代码,同时升级到更高级别的python。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.