Python 2to3 - Convert your Python 2 to Python 3 automatically!

preview_player
Показать описание


In this Python 3 programming tutorial, we cover how to use the built in module called 2to3, which is used to convert python 2 scripts to python 3 scripts.

I had no idea this existed, and it has already saved me a ton of time. I hope it can help you as well!

Bitcoin donations: 1GV7srgR4NJx4vrk7avCmmVQQrqmv87ty6
Рекомендации по теме
Комментарии
Автор

8 yeards and this video is still relevant thanks !
piqued to know what you are doing currently !

anshumannew
Автор

I struggled with installing PyQt4 to python2.4 the whole afternoon and ended with installation errors! At the end, your simple tricks worked and I converted the TrackChanges Python Package which was compiled with Python2.4 to the one that works with Python3.8. It works perfectly with the module PyQt5.
Thanks.

avral
Автор

Thanks man. Nothing like having someone hold your hand and explain everything clearly and slowly to stop you from f*cking up.

taylorrogers
Автор

dude you are a greek god of knowledge with this man, you are a big to you man.

grandmastrdro
Автор

This is going to be SO useful for me. I got a syntax error when trying to compile an application only to find that one of the modules I was using was partially written in python 2.7 and therefore, the script wouldn't compile (it worked fine when running because said part of the module isn't used). Pygame, I facepalm at you not only for that blunder, but for denying me the change to try and fix it by redownloading the installer (at the time of writing, the servers are down). Thank you for this tutorial.

Jono
Автор

@sentdex, thanks for making this video. I got initially confused with running the 2to3 script but you clarified it for me. Well done!

andrews
Автор

Python's documentation shows that you may be able to use "2to3 example.py" to see the changes and "2to3 -w example.py" to write the changes.

WEBteamUniversity
Автор

Well, that's another 2 hours of horsing around you've saved me!

edwilliams
Автор

Thanks man! Again, another stunning tutorial on something the website doesn't explain well..

NatHarwood
Автор

Very nice. You do a good job of explaining each step in comprehensible terms, a sign of a good teacher!

Pentasoniczound
Автор

Thank you so much @sentdex, your demo is about to save hours here :)

jitendrayejare
Автор

Thank you so so much! You really made it easy to understand how to implement socket and threading. Appreciate this little mini series. THANKS once again!

jimmycheong
Автор

Ah, I finally finish downloading all videos on this playlist :D Starting learning Python next month :) Thx man!

azkanand
Автор

If I right click I have no open commando window here when clicking right. Ok but I navigated there manually. Then (I use Python 3.5) when I tipped the whole thing in (a litle other path), it errors that it can't find ___main___ in C:\Programms (the whole thing is in Programms x86). What can I do?

oida
Автор

Thanks for making tutorial. Unfortunately, in trying to port code to Python 3.5 using 2to3, have followed your directions, right-clicking on folder then typing python and 'filename' " without success. To see if 2to3 was in path, tried dir() and got '__builtins___' ... '__specs__' but no indication that Tools and Scripts was in path. Any suggestions?

jameshafford
Автор

Please do one on parallel processing using joblib or multiprocessing.

dfrusdn
Автор

when i write the path for 2to3 for my computer I get an error saying that there is no such file or directory. could i please have some help?!?!?!

dritonosmani
Автор

On Windows file systems are not case-sensitive except for file/folder creation. And using '/' instead of '\' only works because of some historic POSIX/C compatibility.os.newline() is new in Python 3 and also worth a look (if I remembered the name correctly). Thanks for the vid :-)

TechLord
Автор

on Windows, you can use Ctrl-Z instead of Ctrl-D on Linux

sonofusion
Автор

Does this only do one script at a time?
is it possible to do a full module just by using 2to3.py on the setup file?

arcspwan
welcome to shbcf.ru