- ipyb 转成 py
第一种是所有cell的脚本转换成py:
jupyter notebook(or jupyter lab)脚本转成.py,用jupyter notebook打开,点download as选择py即可,如下图
第二种是将某个cell的脚本转换成py
在cell最上方加入 %%writefile Hello.py ,则会将该cell的脚本生成Hello.py
%%writefile Hello.py
import time
a = input('Input your name :')
print(f'Hello {str(a)}')
time.sleep(3)
- 将脚本生成exe文件
首先需要安装 pyinstaller
然后运行一下命令pyinstaller -F (脚本路径+脚本名)