I am new to Python. Right now I have created a file, "testing.py" in an XCode text editor. It runs a simple program, and I want to be able to run it in the Terminal. Up to now I have just been opening the Terminal, typing "python", and retyping the same code over and over.
Also, I tried typing "python testing.py" in the Terminal, and it gave me an error:
File "testing.py", line 22
break
SyntaxError: 'break' outside loop
The code snippet that caused an error was:
with open("truth.txt") as f:
while True:
i = f.read(1)
if not i:
break
bitstring += bin(ord(i))[2:].zfill(8)
Any suggestions?