Aug-06-2021, 02:25 PM
Hi all,
I just want the program to stop/end when it comes across this line.
First I tried quit() and that didn't work
I then tried exit() and that caused the kernel to die.
import sys, sys.exit() works by raising an exception.
Why is this such a difficult thing? I don't know enough about programming yet to understand why. I've seen many posts about it on SO, here, and elsewhere online. I'm not the only one who gets confused as to how to handle it.
Here's the code:
I just want the program to stop/end when it comes across this line.
First I tried quit() and that didn't work
I then tried exit() and that caused the kernel to die.
import sys, sys.exit() works by raising an exception.
Why is this such a difficult thing? I don't know enough about programming yet to understand why. I've seen many posts about it on SO, here, and elsewhere online. I'm not the only one who gets confused as to how to handle it.
Here's the code:
import pandas as pd import sys fran = pd.read_csv(r'C:\Users\Mark\Desktop\FrancesMsg.csv',header=None) lang_lib = {} print(fran) sys.exit() print("exit didn't work") for line in fran: # line.lstrip() line = str(line) print(line)