python编译报错,python代码运行出错
SublimeText2编译Python文件出错
展开全部
SublimeText2编译Python文件出错,解决方法:
1.环境变量path添加:
C:\Python32\Tools\Scripts;D:\Python32;D:\Program Files\Sublime Text2;
2.Python.sublime-build内容修改
比如原内容:
{
"cmd": ["python", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}
修改为(路径为安装文件夹):
{
"cmd": ["C:/Python26/python.exe", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}
python代码运行出错
是这样么?
myInput = raw_input('identifier to test?')
if len(myInput) > 1:
if myInput[0] in alphas:
for otherChar in myInput[1:]:
if otherChar in alphas+nums:
print "这是一个字符串"
else:
print "第一个字符后存在违规字符"
else:
print "第一个字符不和规则"
else:
print "输入的字符串必须大于1"
python初学 写了一段代码 出错 问题如下
guess=input("What'syourguess? ")
ifguess<secret:
楼主失败的原因是第九行里,原因是"<"号的两边数据类型必须一定,楼主报错是因为str()<int(
具体应该是你第8行:guess=input("What'syourguess? ")时输入了一个字符 (随机推荐阅读本站500篇优秀文章点击前往:500篇优秀随机文章)