无法使用n运行python脚本

2024-04-20 04:12:18 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在localhost上用nltk运行python脚本。我的代码是:

#!C:\Users\fname lname\AppData\Local\Programs\Python\Python37-32\python.exe

print("Content-type: text/plain\n")
print("Single Quotes")
print("checkkk") 

from nltk.tokenize import sent_tokenize, word_tokenize

EXAMPLE_TEXT = "Hello Mr. Smith, how are you doing today? The weather is great, and Python is awesome. The sky is pinkish-blue. You shouldn't eat cardboard."

print(sent_tokenize(EXAMPLE_TEXT))

输出如下:

Single Quotes
checkkk
Content-type: text/plain

Single Quotes
checkkk

问题是:它没有考虑在这一行之后导入nltk和代码。请帮忙。你知道吗


Tags: 代码textisexampletypecontentquotessent