The script stops executing as soon as it hits the open()-method. It is a molecule-writer, that should save the finished formula in a .txt-file. Here are the relevant lines of code:
first_line_form_display = [" "]
for i in range(9):
first_line_form_display += [" "]
first_line_form_display += [str(i+1)+" "]
form_display = [first_line_form_display]
for i in range(9):
form_display += [[]]
for j in range(19):
form_display[2*i+1] += [" "]
form_display += [[str(i+1)+" "]]
for j in range(18):
form_display[2*i+2] += [" "]
molecule_name = input("Enter the name of the molecule: ")
create_molecule = open("Molekuele\\"+molecule_name+".txt","w")
create_molecule.write("")
create_molecule.close()
for i in range(len(form_display)-1):
save_molecule = open("Molekuele\\"+molecule_name+".txt","a")
save_molecule.write(" ")
for j in range(len(form_display[i+1])-1):
save_molecule.write(form_display[i+1][j+1])
save_molecule.write("\n")
save_molecule.close()
I created the program at VS-Code and it worked fine. I did not forget to create the "Molekuele"-folder. It only stops working, when it is not in the VS-Code project folder. The program really stops exactly at the point, where the open()-method is opened, I tested this with several "print("123")'s.