#๐Ÿ”’ print to file & get from file? need to save a simple config file.

13 messages ยท Page 1 of 1 (latest)

faint oxideBOT
#

@shrewd scaffold

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

bitter bobcat
#

and your question is ...

#
config_text = "cat breed: siamese"
# save it
with open("config.txt", "w") as outf:
   outf.write(config_text)

# read if
with open("config.txt") as inf:
   config_text = inf.read()
shrewd scaffold
#

and if i get permission denied

bitter bobcat
#

then uh fix the problem?

#

I can't help you do that unless I see your actual code, and you tell me exactly how you ran it

shrewd scaffold
#

!thank you

#

!completed

#

!answer

bitter bobcat
#

!close ๐Ÿคฃ

faint oxideBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.