Search code examples
pythonpython-requestsurllib3

Convert Code from 2.7 to 3.5


I'm very new to learning python, and was wondering if someone could convert a previously answered question so that it would work in Python 3.5. I would like to get the exact same info as the original question.

Cannot get table data - HTML

Thanks in advance!


Solution

  • Take the code and run this on the file, assuming it is called 'my_code.py'

    2to3 -w my_code.py
    

    The code will now be Python 3 code! This process will save the old Python 2 code as my_code.py.bak should you want to restore it.