lets say you have a basic txt file with:
USERNAME(var1):PASSWORD(var2):VAR3
USERNAME(var1):PASSWORD(var2):VAR3
... etc...
And I want to be able to read that in my script/code as:
Username = var1
Password = var2
something = var3
And implement that like:
username = var1
password = var2
s.login(var1, var2)
file = open(var3, 'r')
I have been spitting through a lot of code, trying to reverse engineer some things, but it's not quite working out. If someone could shed some light that'd be great.
I need to make these lists myself, so I can use any separator I want (,
, ;
, :
etc).
edit, this is what I've tried so far:
all_lines = []
file = open('test.txt', 'r')
for line in file:
Username,Password,something = line.split(':')
print(Username,Password,something)
But it gives me the following error:
File "test.py", line 8
print(Username,Password,something)
^
IndentationError: unexpected indent