Differenze
Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
| Entrambe le parti precedenti la revisioneRevisione precedenteProssima revisione | Revisione precedente | ||
| python:porting_python_2_to_pyton_3 [2020/01/22 17:04] – WIP apressato | python:porting_python_2_to_pyton_3 [2020/01/22 18:01] (versione attuale) – WIP apressato | ||
|---|---|---|---|
| Linea 1: | Linea 1: | ||
| ====== Porting da Python 2 a Python 3 ====== | ====== Porting da Python 2 a Python 3 ====== | ||
| - | <WRAP center round important 60%> | ||
| - | ***WIP***: Quello seguente è un articolo in divenire | ||
| - | </ | ||
| Linea 1266: | Linea 1263: | ||
| - | ===== Modernize ===== | + | ===== Python-Modernize ===== |
| + | ==== Scopo del progetto ==== | ||
| + | Questa libreria è un wrapper attorno a '' | ||
| + | Il comando python-modernize funziona come 2to3. Ecco come riscrivere un singolo file: | ||
| + | <code bash> | ||
| + | python-modernize -w example.py | ||
| + | </ | ||
| + | Il sito Web del progetto è disponibile su [[https:// | ||
| + | ==== Una nota sulla gestione delle stringhe ==== | ||
| + | * Di default modernize non cambia le stringhe Unicode. \\ Questa è l' | ||
| + | * In alternativa, | ||
| + | * L' | ||
| + | ==== Preparazione ==== | ||
| + | Dal prompt dei comandi lanciare | ||
| + | <code bash> | ||
| + | pip --install modernize | ||
| + | </ | ||
| + | Al termine dell' | ||
| + | ==== Batch di conversione ==== | ||
| + | <code batch> | ||
| + | set mydatetime=%date: | ||
| + | set logpath=.\Logs | ||
| + | set logfile=%logpath%\Migrate_%Application%_2to3_%mydatetime%.log | ||
| + | set RepoPath=path\to\your \web2py\applications | ||
| + | set Application=Your_Folder_App_Name | ||
| + | |||
| + | IF NOT EXIST %logpath% ( | ||
| + | MKDIR %logpath% | ||
| + | ) | ||
| + | |||
| + | (FOR /f " | ||
| + | (FOR /f " | ||
| + | (FOR /f " | ||
| + | </ | ||
| Linea 1283: | Linea 1313: | ||
| - [[https:// | - [[https:// | ||
| - [[https:// | - [[https:// | ||
| + | - [[https:// | ||

