I'm trying to read a .txt file (currently empty) to check if chat_id already exists, if it already exists, it ends there. If it does not exist ... Add the new chat_id in the last line, but when I run the code and see the file, there is nothing w...
I have the following function, which I intend to extend it:
def get_dataframe(site, search):
if site == 'pichau':
try:
soup = get_page(f'https://www.pchau.com.br/catalogsearch/result/?q={search}')
assert sou...
I'm studying python in version 3.7 and would like a python north on android.
My idea would be to automate the navigation of the app using python to perform touch tasks using as reference defined images, something like java sikuli.
At the mome...
How can I expect user response after a command is executed? I'm using Python 3.6 and the telegram-bot-python lib.
Example:
usuario - /apel
bot - Qual o seu apelido?
usuario - dfop
bot - Uau, seu apelido é dfop
I've made it here:
def ap...
Initially I was developing a python code that would help me better understand Nikola Tesla's Number Theory ( video ).
Explaining quickly, starting with 360, adding each separate value results in 9, for example: 3 + 6 + 0 = 9, always dividing...
I have the models below
class ProdutosIngredientes(db.Model):
__tablename__ = 'produtos_ingredientes'
id = db.Column(db.Integer(), primary_key=True)
produtos_id = db.Column('produtos_id', db.Integer, db.ForeignKey('produtos.id'))...
Good Night !!!
This time my doubt is about unit testing. Come on.
How can I test the following in the unittest.mock environment?
def save_html_file(conteudo, filename, encoding='iso8859-1'):
assert isinstance(conteudo, str), '"conteudo"...
I am not able to access a field of a relationship in filter, I am bringing the objects through the context of a DetailView.
View Server
class HistoricoProgressoes(DetailView):
model = Servidor
def get_context_data(self, **kwargs):...
I was making a game copy of Space Invaders but when I went to do the "shot"
of the ship, I came across a problem:
AsseenintheGif,whenIhitthekey,everythingonthecanvas"freezes" until the shot reaches the end, how do I solve it? Thank you in...