from turtle import *import osf=open(test.py,w,encoding=utf-8)f.close()speed(0)color(blue)pensize(3)n...
from turtle import * import os f=open("test.py","w",encoding="utf-8") f.close() speed(0) color("blue") pensize(3) num=50 for i in range(num): circle(50) left(360/num) done() f=open("test.py","r",encoding="utf-8") num1=f.read() f.close() f=open("test.py","w",encoding="utf-8") f.write(num1) os.remove("test02.py")
PyCharm-错误-找不到指定文件python.exe的解决方法
1、现象
系统提示找不到指定的文件:
Error running 'hello': Cannot run program "B:\pystudy\venv\Scripts\python.exe" (in directory "\python-study"): CreateProcess error=2, 系统找不到指定的文件。
2、原因
原来的工程目录(B盘)下,保存了python的编译环境,包括python.exe文件。工程目录移动到F盘以后,工程设置中找不到python.exe程序,因此报错,需要修改设置。
3、解决
打开菜单“File/Setting”。
找到“Project Interpreter” ,再选择显示全部,如下图:
先删除旧的程序位置。
再添加一个已有的ptyhon环境。
一周热门 更多>