Hi so I'm trying to do something pretty simple
I have an Array
with a ton of sentences being used randomly for a slideDown notification div. Since I don't want to have a really long 1 line in PyCharm I figured I could just import the sentences from a txt file into my Array
.
I found this and this so I imported numpy, and using the code below, however, it breaks(and skips to my error messages) on the success_msgs
line, I don't get an error too.
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."]
Any thoughts? :(
My Text File (which is in the same folder as the py file:
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._
Debugger
my def 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 debug: