Jan-28-2019, 04:03 AM
Please use python and output tags when posting code and results. I put them in for you this time. Here are instructions for doing it yourself next time.
The standard way to write to a file is:
The standard way to write to a file is:
with open('data.txt', 'w') as data_file: data_file.write(some_string)The data can be retrieved with
with open('data.txt') as data_file: some_string = data_file.read()You can also read the lines of a file in as a list (
data_file.readlines()
) or iterate over the lines in a file (for line in data_file:
).
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures