python模块lib2to3(py2转py3自动化工具)
 Usage: 2to3 [options] file|dir ...

 Options:
-h, --help show this help message and exit
-d, --doctests_only Fix up doctests only
-f FIX, --fix=FIX Each FIX specifies a transformation; default: all
-j PROCESSES, --processes=PROCESSES
Run 2to3 concurrently
-x NOFIX, --nofix=NOFIX
Prevent a transformation from being run
-l, --list-fixes List available transformations
-p, --print-function Modify the grammar so that print() is a function
-v, --verbose More verbose logging
--no-diffs Don't show diffs of the refactoring
-w, --write Write back modified files
-n, --nobackups Don't write backups for modified files
-o OUTPUT_DIR, --output-dir=OUTPUT_DIR
Put output files in this directory instead of
overwriting the input files. Requires -n.
-W, --write-unchanged-files
Also write files even if no changes were required
(useful with --output-dir); implies -w.
--add-suffix=ADD_SUFFIX
Append this string to all output filenames. Requires
-n if non-empty. ex: --add-suffix='' will generate
.py3 files.

eg:2to3 -w test.py

python2代码升级到python3工具的更多相关文章

  1. python2.7升级到python3后,用pip进行安装时报Fatal error in launcher:Unbale to create process using`""

    解决:python2.7升级到python3后,用pip进行安装时报Fatal error in launcher:Unbale to create process using`"" ...

  2. python2代码批量转为python3代码

    由于python存在python2和python3两个主要的版本方向,经常会有将python2的代码转到python3的环境下运行的需求.尤其是跑一些神经网络的代码时有很多是在python2的环境下写 ...

  3. centos7中python2.7升级到python3.7

    一.下载源码包 # 切换到root目录 [root@localhost ~] cd /root/ # 安装wget [root@localhost ~] yum -y install wget # 使 ...

  4. centos6.5系统python2.6升级到python3.6

    1.安装必备的工具 wget:yum install wget gcc:yum install gcc zlib zlib-devel: yum install zlib zlib-devel -y ...

  5. python2.7升级到python3.6注意事项

    python3.6下载地址:https://www.python.org/downloads/source/ 1.安装依赖包:gcc   openssl-devel.zlib-devel.readli ...

  6. python2.7 升级到 python3.6

    1.命令 yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel t ...

  7. 自动发布工具版本从python2升级成python3后遇到的种种问题(涉及paramiko,Crypto,zipfile等等)

    从在公司实习到正式入职,一直还在被同事使用的是我写的一个自动发布工具.该工具的主要功能是:开发人员给出需要更新的代码包(zip格式),测试人员将该代码包部署到测服,这些代码包和JIRA数据库里的项目信 ...

  8. python 内置2to3工具将python2代码转换为python3代码

    python2与python3代码不兼容,如果需要python2代码在python3环境下运行,需要将代码进行转换,本文介绍使用python3内置工具2to3.py对代码进行转换 一:2to3.py在 ...

  9. 一键将 Python2 代码自动转化为 Python3

    问题 Python2 的代码直接在 Python3 环境运行的话会报错误: 如果大量的代码,无论是批量替换,还是逐行修改都够累的,这活儿表示不能干! 有没有办法一键转换呢? 百度了一下发现网上的方法如 ...

随机推荐

  1. 【Luogu】P3228数列(数学题)

    题目链接 考虑我们把所有的增加量拿出来做成一个序列b. 那么在所有n中开头中$1~\sum\limits_{i=1}^{k-1}b[i]$是合法的 也就是说我们枚举所有b[i],然后答案就是$n*m^ ...

  2. hdu 1551 Cable master (二分法)

    Cable master Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Tota ...

  3. [bzoj5472] 数列

    Description 输入一个长度为n的数组{ai}(1 <= i <= n) 问有多少个长度为n的数组{xi}(1 <= i <= n),满足1 <= xi < ...

  4. [洛谷P4178]Tree

    题目大意:给一棵树,问有多少条路径长度小于等于$k$ 题解:点分治 卡点:无 C++ Code: #include <cstdio> #include <algorithm> ...

  5. 强军如歌(strong)

    强军如歌(strong) 题目描述 给定一个NN个数的序列AA,如果序列AA不是非降序的,你需要在其中选择一个数删掉,不断重复这个操作直到序列AA非降.求有多少种不同的删数方案.注意:删掉的数的集合相 ...

  6. Codeforces 938.A Word Correction

    A. Word Correction time limit per test 1 second memory limit per test 256 megabytes input standard i ...

  7. xdebug使用教程

    http://www.cnblogs.com/xujian2016/p/5548921.html 配置信息 zend_extension="D:\phpStudy\php53n\ext\ph ...

  8. VS2013 MFC listcontrol 双击编辑

    原文地址:http://blog.csdn.net/xianglifighter/article/details/17592209 最近在拿一些小的项目练习MFC,遇到不少问题,期中之一便是修改列表框 ...

  9. mtk GPIO口

    http://blog.csdn.net/mcgrady_tracy/article/details/39320691 mt6582多达168个GPIO口,当然这些GPIO口是复用的,注意lk和Lin ...

  10. Windows基础-实时录音程序(WaveXXX)

    写在前面 一开始是打算用这个老接口做讯飞语音识别的程序,在转移到UWP时发现,这玩意在Windows Runtime中屏蔽(弃用)了,将来会更新使用WASAPI的程序 WaveRecorder类代码下 ...