こんにちは、私はかなり単純なことをしようとしています
私はArray
、slideDown 通知 div に大量の文がランダムに使用されています。PyCharm で非常に長い 1 行を使用したくないので、txt ファイルから .txt ファイルに文をインポートするだけでよいと考えましたArray
。
thisとthisを見つけたので、 numpyをインポートしましたが、以下のコードを使用すると、行で壊れます(エラーメッセージにスキップします) success_msgs
。エラーも発生しません。
def create_request(self):
# text_file = open("success_requests.txt", "r")
# lines = text_file.readlines()
# print lines
success_msgs = loadtxt("success_request.txt", comments="#", delimiter="_", unpack=False)
#success_msgs = ['The intro request was sent successfully', "Request sent off, let's see what happens!", "Request Sent. Good luck, may the force be with you.", "Request sent, that was great! Like Bacon."]
何かご意見は?:(
My Text File (py ファイルと同じフォルダーにあります。
The intro request was sent successfully_
Request sent off, let's see what happens!_
Request Sent. Good luck, may the force be with you._
Request sent, that was great! Like Bacon._
デバッガ
私の定義genfromtxt
def genfromtxt(fname, dtype=float, comments='#', delimiter=None,
skiprows=0, skip_header=0, skip_footer=0, converters=None,
missing='', missing_values=None, filling_values=None,
usecols=None, names=None,
excludelist=None, deletechars=None, replace_space='_',
autostrip=False, case_sensitive=True, defaultfmt="f%i",
unpack=None, usemask=False, loose=True, invalid_raise=True):
genfromtxt デバッグ: