Questions tagged as 'python-3.x'

1
answer

What is the difference between the wraps and update_wrapper functions of the funtools module

In module functools of bibliotaca padrão of Python there are two functions update_wrapper and wraps in the documentation of function wraps we have:    This is a convenience function for invoking up...
asked by 28.10.2018 / 02:25
1
answer

Python Error SQLACHEMY

It is giving an error when I try to connect to the SQL SERVER database with SQLALCHEMY from sqlalchemy import create_engine, engine import pandas as pd engine = create_engine('mssql+pyodbc://User:password@server:1433/Bases_testes?drive=SQL+Ser...
asked by 28.10.2018 / 16:22
1
answer

Generate a random combination on each line

I did a number generator that looked like this: import random import math for i in range(10): c1 = (random.choice([1, 2, 3, 4, 5, 6, 7, 8, 9])) c2 = (random.choice([1, 2, 3, 4, 5, 6, 7, 8, 9])) c3 = (random.choice([1, 2, 3, 4, 5,...
asked by 17.11.2018 / 14:22
2
answers

I am trying to use an asynchronous function in python-3, but this is giving error

Error: Warning (from warnings module): File "C:\Users\tiago.pereira\Desktop\python\kivy\kivy_teste.py", line 43 pythoncom.PumpMessages() RuntimeWarning: coroutine 'Keyboard' was never awaited TypeError: an integer is required (got type...
asked by 19.11.2018 / 11:46
1
answer

Integrate RDStation with Django + Python to send lead

Good morning guys, I have a problem: I have an LP that has to save the lead in the Postgres database and automatically send that lead to the RD platform using their API. Using the curl I do as follows: curl -v \ -X POST \...
asked by 26.09.2018 / 16:12
2
answers

Check if a file exists, inside an IF in Python [closed]

Good afternoon, I would like to do a verification: If a file exists - delete If there is no follow the flow of the program. I'm using Pycharm, it's returning syntax error, But I've already put 4 spaces in the bottom line. Note The rest of...
asked by 05.12.2018 / 17:33
1
answer

How to calculate 'end time' in Python?

qpd = int(input('Quantidade produzida: ')) # qpd = Quantidade Produzida qpg = int(input('Quantidade programada: ')) # qpg = Quantidade Programada qrs = qpg - qpd # qrs = Quantidade Restante qpc = qrs / 550 # qpc = Quantidade por Carro mrs = i...
asked by 15.09.2018 / 01:58
1
answer

Error presented in vscode when trying to execute a code in Python

Person, I'm trying to run some scripts in Python , but in terminal of vscode is showing the following error: bash syntax error near unexpected token (' This error is only happening on the integrated terminal of...
asked by 31.12.2018 / 17:22
1
answer

'str' object has no attribute 'encrypt'

I made a program that generates a public key and another private key, serializes them and saves them to a .key file. Dai I tried to create another program to encrypt and decrypt a message with these two keys generated in the other program, how c...
asked by 19.10.2018 / 21:05
2
answers

Python: How to identify the root of the operating system?

How do I identify the root of the operating system (windows: "C: \", in linux: "/"), exclusively through python commands that apply to both systems?     
asked by 18.10.2018 / 20:47