我试图从python 3中的文件名列表中创建一个随机的文件集。
#!/usr/local/bin/python3
import random
import sys
random.seed()
print("Reading lines from ", sys.argv[1])
linecount = 0
lines = []
with open(sys.argv[1]) as f:
for line in f:
lines.append(line)
filelist = random.sample(lines, 5);
for newfile
我想在python3.6上工作,我一直在研究python 2.7,它运行得很好,当我安装python3.6时,它在python 3.6 shell上工作得很好,我还设置了环境路径:-
C:\Python36\Scripts\;C:\Python36\;
当它在我的安装文件上创建时..。我把python 3安装在Python2.7上。当我尝试执行python3文件时,它给了我
'py' is not recognized as an internal or external command`
我重新启动了什么都没发生。
我少了什么东西吗?我该再查一遍“崇高”吗?
我对蟒蛇很陌生。我使用以下命令创建了这个文件:
C:\Python35\Scripts\django-admin startproject mysite
当我运行C:\Python35\Scripts\mysite\python manage.py迁移或C:\Python35\Scripts\mysite\python manage.py runserver时,成功地在directory.But中创建了一个文件,我将得到以下错误
python is not recognized as an internal or external command operable program or bat