Python upgrading from 2.7 to 3.5 requires a major issue

Source: Internet
Author: User

Summon up the courage to upgrade our Python from 2.7 to 3.5 today. I'm using pycharm development tools. The upgrade process encounters some problems under the summary:

1. Right-click the project: Locate the Project interpreter option on the left, and configure the development environment 3.5.

2. Original: print ' Hello ' after upgrade to modify: print (' Hello ')

3. Original print ' Hello '. Decode (' Utf-8 ') post-upgrade direct print (' Hello ')

4. Original except Exception err: except Exception as err after upgrade:

5. Used to err.errormsg upgrade after the use of errormsg attributes.

6. Remove <>, use! = All

7. Original import configparser after upgrade to pour configparser5 package, after import configparser note case

8.xrange () renamed to Range ()

The 9.long type was canceled with only int type

10.raw_input renamed as input

Python upgrading from 2.7 to 3.5 requires a major issue

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.