1, How to check the python version

import sys
if sys.version_info < (3.0)
    print ("python version is 2.x")
else:
    print ("python version is 3.x")

2, How to change the default python version

sudo rm /usr/bin/python
sudo ln -s /usr/bin/python3.5 /usr/bin/python

3, How to install python3.x package

sudo apt install python3-pip
sudo pip3 install package

4,Auto update python2.x to python3.x

http://python-future.org/futurize.html#forwards-conversion

http://python-future.org/automatic_conversion.html

4.1 Install future
sudo pip install future
4.2 execute cmd
futurize --stage1 -w **/*.py
futurize --stage2 -w **/*.py

or

futurize -w **/*.py

5, Changed lib

2.x
3.x
import ConfigParser import configparser
import copy_reg import copyreg
import Queue import queue
import SocketServer import socketserver
import HTMLParser import html
import urllib2 import urllib
   

Auto update Python 2.x to 3.x的更多相关文章

  1. hibernate.hbm2ddl.auto=update不能自动生成表结构

    在写上篇文章<spring整合springmvc和hibernate>的时候,曾遇到一个问题 INFO: Server startup in 8102 ms Hibernate: inse ...

  2. <property name="hibernate.hbm2ddl.auto">update</property> 问题

    其实这个hibernate.hbm2ddl.auto参数的作用主要用于:自动创建|更新|验证数据库表结构.如果不是此方面的需求建议set value="none".create:每 ...

  3. 在WinForm中使用Web Services 来实现 软件自动升级( Auto Update ) (C#)

    winform程序相对web程序而言,功能更强大,编程更方便,但软件更新却相当麻烦,要到客户端一台一台地升级,面对这个实际问题,在最近的一个小项目中,本人设计了一个通过软件实现自动升级技术方案,弥补了 ...

  4. Close Java Auto Update in Windows 7 and Later

    0. Environment Windows 7JDK 1.6.0_45 1. Steps 1) Enter "JRE/bin" 2) Run javacpl.exe as adm ...

  5. 在WinForm中使用Web Services 来实现 软件 自动升级( Auto Update ) (C#)

    winform程序相对web程序而言,功能更强大,编程更方便,但软件更新却相当麻烦,要到客户端一台一台地升级,面对这个实际问题,在最近的一个小项目中,本人设计了一个通过软件实现自动升级技术方案,弥补了 ...

  6. 解决"hibernate.hbm2ddl.auto" update值 无效

    <property name="schemaUpdate"> <value>true</value> </property> 若果是 ...

  7. mysql不创建表 <property name="hbm2ddl.auto">update</property> 无效

    netbeans win10 mysql8 hibernate 4.3.11 dakai mysql的general_log发现并没有创建表的语句 未完待续 今天又遇到不创建表的问题 但是问题比较奇怪 ...

  8. Python MySQL Update

    章节 Python MySQL 入门 Python MySQL 创建数据库 Python MySQL 创建表 Python MySQL 插入表 Python MySQL Select Python M ...

  9. Python之路【第四篇】:模块

    什么是模块: 模块就是一个功能的集合. 模块就和乐高积木差不多,你用这些模块组合出一个模型,然后也可以用这个模块加上其他的模块组合成一个新的模型 模块的种类: 1.内置模块(python自带的比如os ...

随机推荐

  1. Linux服务之nginx服务篇一(概念)

    nginx官网:http://nginx.org/ 一. nginx和apache的区别 Nginx: 1.轻量级,采用 C 进行编写,同样的 web 服务,会占用更少的内存及资源. 2.抗并发,ng ...

  2. 【转】Jquery 使用Ajax获取后台返回的Json数据后,页面处理

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  3. 4 系统的 CPU 使用率很高,但为啥却找不到高 CPU的应用?

    上一节讲了 CPU 使用率是什么,并通过一个案例教你使用 top.vmstat.pidstat 等工具,排查高 CPU 使用率的进程,然后再使用 perf top 工具,定位应用内部函数的问题.不过就 ...

  4. 启动kafaka失败了,提示zk保存kafka的ids已经在使用。

    FATAL [Kafka Server 1], Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.Ka ...

  5. Mui入门(Day_42)

    开始体验Mui 1. 安装HbuilderX 下载地址:https://www.dcloud.io/hbuilderx.html 2. 新建Mui项目 3. 文件结构介绍 _ css : 样式表文件 ...

  6. 如何在 Docker 环境下自动给 .NET 程序生成 Dump

    前言 之前"一线码农"大佬有写文章介绍了如何在 windows 下自动 dump,正好手里有个在 docker 环境下 dump 的需求,所以在参考大佬文章的基础上,有了本篇. ​ ...

  7. vue 安装sass5.0版本遇到的问题

    cnpm install node-sass@4.9.2 --save-dev cnpm install sass-loader@7.3.1 --save-dev cnpm install style ...

  8. python 获取当天和前几天时间数据

    python 获取当天和前几天时间数据 import datetime from datetime import datetime, date, timedelta def dayDateRange( ...

  9. Docker学习(9) Docker守护进程的配置和操作

  10. 嵌入式Linux设备驱动程序:发现硬件配置

    嵌入式Linux设备驱动程序:发现硬件配置 Embedded Linux device drivers: Discovering the hardware configuration Interfac ...