3 ms·
Most of the time you're writing Python3 code and you don't even know it... try changing #!/usr/bin/env python to #!/usr/bin/env python3 I bet your Python2 scr
by welder 8y ago
Most of the time you're writing Python3 code and you don't even know it... try changing #!/usr/bin/env python to
#!/usr/bin/env python3
I bet your Python2 script will run on Python3.
- ageofwant 8y agoAnd then there is 2to3, which has not failed me once.
- matmann2001 8y agoIt might be interesting as a learning exercise but there's a lot of gotchas in running 2 as 3. Besides the obvious things like print, which will just cause an error, there's behavioral changes, like with division and range, that may introduce more insideous bugs. Better to read up on the difference first and use a tool.