小米手机python运行创建的文件在python的安装目录,在安装目录下面,有一个python.exe文件,这个就是python的运行文件。希望能够帮助到你。
因此在python中,下面这两种写法都是可以接受的。"c:/test/my doc"
"c:\\test\\my doc"
1、当前目录:os.listdir(".")f1 = open('xugang.txt','w')
2、父目录:os.listdir("..") f1 = open('../xugang.txt','w')
3、根目录写法一:os.listdir('/')f1 = open('/xugang.txt','w')
4、根目录写法二:os.listdir('\') f1 = open('\xugang.txt','w')
5、子目录:os.listdir('mytext') f1 = open('mytext/xugang.txt','w')
(备注:假设当前目录中有一个名为mytext的子目录要访问 )
python的运行文件所在位置:
找到python的安装目录,在安装目录下面,有一个python.exe文件,这个就是python的运行文件
右键单击,选择发送到桌面快捷方式,这个快捷方式就是python的桌面图标了
示例如下:
更多Python知识,请关注:Python自学网!!