Message from Python discussions

November 2018

β€” Lol

β€” 

If you really want it to be more effective, think as the python script as a real backend, and the PHP site as the frontend for it, so I guess you have to completelly re-write your python script

β€” Thanks for the intell. Will work on itπŸ’ͺ🏼

β€” Appropriate naming is API client and server

β€” Who know any website that has list of python gui problems? I want to practice

β€” Hi Guys, I have a question if I have the following code:
f = open("test.txt","r") #opens file with name of "test.txt"
print(f.read(1))
print(f.read())
f.close()

And I would like to read txt files and send the message (text inside the file) to the user in Telegram.
bot.send_message(chat_id=chat_id, text= ...something...
)

Message permanent page

β€” Anyone have an idea?

β€” Content = f.read()
bot.send_message(chat_id=chat_id, text = content
)

doesn't this work?

β€” No not really

β€” I usually use f.close() when I open file in writing mode)

β€” Content = strVar()
content = f.read()
bot.send_message(chat_id=chat_id, text = content
)

how about this

Message permanent page

β€” Language:

py3


Source:
strVar()


Errors:
Traceback (most recent call last):
File "source_file.py", line 1, in <module>
strVar()
NameError: name 'strVar' is not defined

Message permanent page