M
M
Maria Hoffman2021-04-02 17:56:32
Python
Maria Hoffman, 2021-04-02 17:56:32

I am writing a bot for a game that will go to the file path and copy 1 line from txt, how to do this?

I want to create a decorator, I write def copy_pass(): , then open, and then.....? supposedly you need to write somehow the path to the file and the command for python - copy the first line

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Z
zexer, 2021-04-02
@zexer

with open(path_to_file.txt, 'r') as file:
    text = file.readline()
print(text)

P
Puma Thailand, 2021-04-03
@opium

Dude, reading files is now in school, read at least one short tutorial on python

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question