![](/img/trans.png)
[英]Using python debugger on python3 throws NameError: name 'raw_input' is not defined
[英]Python3: NameError: name 'raw_input' is not defined
这是导致错误的脚本的一部分:
File "/home/bcramer/workdir-aptaNET/feature_extraction.py", line 28, in <module>
apt=raw_input('GGGAGWAVIPV')
NameError: name 'raw_input' is not defined
# ##########################################
##pseAAC encoding
from sys import argv
import string
#20 native amino acids according to the alphabetical order of their single-letter codes
aa_20 = ['A','C','D','E','F','G','H','I','K','L','M','N','P','Q','R','S','T','V','W','Y']
#count_amino_acids
apt=raw_input('GGGAGWAVIPV')
target=raw_input("SGFRKMAFPSGKVEGCMVQVTCGTTTLNGLWLDDVVY")
下面是脚本作者编写的原始代码:
#count_amino_acids
apt=raw_input('Please Enter Aptamer Sequence:')
target=raw_input("Please Enter Protein Sequence:")
raw_input
是一个 function ,在 Python 2 中可用。 Python 3 将其重命名为input
。 您应该相应地修改您的脚本,或者使用 2.x 一代(可能是最新的 2.7)的 Python 版本。
问题是raw_input
在 Python 3 中input
。
apt=input('GGGAGWAVIPV')
target=input("SGFRKMAFPSGKVEGCMVQVTCGTTTLNGLWLDDVVY")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.