Skip to content
Sign upLog in
← Back to Community

read a txt file

Profile icon
AllanJohnson1

Hello, i'm trying to read a txt file on your site using a phyton language, but i cant do it adding the txt on files (im using a google chrome notebook)

can you help me?

Voters
Profile icon
VincentMiller4
Profile icon
AllanJohnson1
Comments
hotnewtop
Profile icon
AllAwesome497
with open("file.txt", "r") as file: file_content = file.read()``` Also what niorg said
Profile icon
SixBeeps

You have to upload the TXT file to repl.it by dragging the file from your computer to underneath the "main.py" on the left of the editor.

Você precisa fazer o upload do arquivo TXT para repl.it arrastando o arquivo do seu computador para baixo do "main.py" à esquerda do editor. (Google Translate)