zoukankan      html  css  js  c++  java
  • python2代码升级到python3工具

    python模块lib2to3(py2转py3自动化工具)
     1 Usage: 2to3 [options] file|dir ...
     2 
     3 Options:
     4   -h, --help            show this help message and exit
     5   -d, --doctests_only   Fix up doctests only
     6   -f FIX, --fix=FIX     Each FIX specifies a transformation; default: all
     7   -j PROCESSES, --processes=PROCESSES
     8                         Run 2to3 concurrently
     9   -x NOFIX, --nofix=NOFIX
    10                         Prevent a transformation from being run
    11   -l, --list-fixes      List available transformations
    12   -p, --print-function  Modify the grammar so that print() is a function
    13   -v, --verbose         More verbose logging
    14   --no-diffs            Don't show diffs of the refactoring
    15   -w, --write           Write back modified files
    16   -n, --nobackups       Don't write backups for modified files
    17   -o OUTPUT_DIR, --output-dir=OUTPUT_DIR
    18                         Put output files in this directory instead of
    19                         overwriting the input files.  Requires -n.
    20   -W, --write-unchanged-files
    21                         Also write files even if no changes were required
    22                         (useful with --output-dir); implies -w.
    23   --add-suffix=ADD_SUFFIX
    24                         Append this string to all output filenames. Requires
    25                         -n if non-empty.  ex: --add-suffix='3' will generate
    26                         .py3 files.

    eg:2to3 -w test.py

  • 相关阅读:
    ASP.NET Core 静态资源的打包与压缩
    算法
    字符串反转
    js 获取随机数
    AspNetCore MVC 跨域
    add digits
    1-bit and 2-bit Characters
    删除字符串中出现次数最少的字符
    洗牌
    哈夫曼编码
  • 原文地址:https://www.cnblogs.com/buyizhiyou/p/8966583.html
Copyright © 2011-2022 走看看