【发布时间】:2018-11-25 11:15:59
【问题描述】:
例如这是我的文档:
docs = '''
The goal of /r/Games is to provide a place for informative and interesting
gaming content and discussions. Submissions should be for the purpose of
informing or initiating a discussion, not just with the goal of entertaining
viewers.
IRC channel: #Games on irc.snoonet.org
For an in-depth explanation of our rules don't forget to check our rules
wiki page and FAQ!
I've been spending quite a while reading reviews of various players on the
game. And, it seems (for the most part) it's being received fairly
positively with gamers. I'm interested to hear how Reddit is enjoy the game
thus far. Feel free to be as brief, or as thorough as you want.
Thanks in advance for all replies. '''
我想将文档分成这样的列表:
sentence = [[The goal of /r/Games is to provide a place for informative and
interesting gaming content and discussions. Submissions should be for the
purpose of informing or initiating a discussion, not just with the goal of
entertaining viewers. IRC channel: #Games on irc.snoonet.org For an in-depth
explanation of our rules don't forget to check our rules wiki page and
FAQ!]],
[I've been spending quite a while reading reviews of various players on the
game. And, it seems (for the most part) it's being received fairly
positively with gamers. I'm interested to hear how Reddit is enjoy the game
thus far. Feel free to be as brief, or as thorough as you want.], [Thanks in
advance for all replies.]]
而我用docs.split(' ')我只能得到一个字典,就像只是用单词分开
我如何获得sentence?
【问题讨论】:
-
改为由
.分割。
标签: python-3.x list numpy