2016-07-29 61 views
0

我對Python非常陌生,在這裏需要一些幫助。 我認爲它來自PATH,但我不知道修復它。請幫忙。導入錯誤:無法導入名字Split

Once I type in import split and it keeps popping up

runfile('/Users/zhihaowang/Desktop/untitled1.py', wdir='/Users/zhihaowang/Desktop') Traceback (most recent call last):

File "", line 1, in runfile('/Users/zhihaowang/Desktop/untitled1.py', wdir='/Users/zhihaowang/Desktop')

File "/Users/zhihaowang/anaconda3/lib/python3.5/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 714, in runfile execfile(filename, namespace)

File "/Users/zhihaowang/anaconda3/lib/python3.5/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 89, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "/Users/zhihaowang/Desktop/untitled1.py", line 8, in from string import split

ImportError: cannot import name 'split'

回答

0

分裂是標準的字符串方法的一部分不從字符串模塊。無需導入也可以應用拆分方法。 your_str.split()

相關問題