#๐Ÿ”’ I opened a file but the content is not printing

16 messages ยท Page 1 of 1 (latest)

wide belfryBOT
#

@valid thunder

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.

lapis dome
#

Show code

valid thunder
#
try:
    file = open('parv.txt', 'r')
    print("File opened successfully")
    f = file.read()
    print(f"File content: {f}")
    file.close()
except Exception as e:
    print(f"Error: {e}")
lapis dome
#

And a screenshot of your IDE running it and showing the path to the text file

valid thunder
#

iasked chat gpt for help

#

see

lapis dome
valid thunder
#

how to?

lapis dome
#

CTRL + S

#

Switch to parv.txt tab

#

and then CTRL + S

valid thunder
#

ooooh thanks problem solved

#

day before yesterday 2 mod of this group taking 1 hour to solve you solved this in 1 min thanks

wide belfryBOT
#
Python help channel closed using Discord native close action

This help channel has been closed. 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.