Questions tagged as 'python-3.x'

1
answer

Python Subprocess checking whenever a new file is added

Need: I need to "observe" a directory, with each new file inserted in this directory I need to make a copy of this file and forward it to an FTP server. What I have: I can send the file via FTP, and I can check the files in the dire...
asked by 19.12.2018 / 22:18
0
answers

No module named 'cx_Oracle' - Python

Hello, good afternoon. I'm trying to make a connection to the oracle database, but when I run my script it gives this error of No module named 'cx_Oracle'. But I have this installed on the machine and I'm using python 3.6. Does anyone know ho...
asked by 21.12.2018 / 19:56
1
answer

Command that replaces time.sleep?

I'm doing a program that does the detection of color and object formats with a camera, when the format and the color are set, the program controls the GPIOS in which I connected a relay module. The problem I am having is that when I use the time...
asked by 19.12.2018 / 06:27
1
answer

Bottle: accessing the same session on different Canister devices

Hello, I'm developing a project for the study character and I'm having a big problem. I'm using: astroid == 2.0.4 bottle == 0.12.13 canister == 1.5.1 colorama == 0.4.0 cymysql == 0.9.12 Cython == 0.29 isort == 4.3.4 lazy-obj...
asked by 10.12.2018 / 03:07
1
answer

Problem using if and elif Python

I'm having a problem using if and elif to create an extract table by taking bank information. If the transaction category is a deposit in the bank, I want it print in a way, but after it has passed the first if , if...
asked by 13.12.2018 / 16:20
1
answer

What is the best way to do the verification? (Try-catch, multiples if, ...?)

I'm reading thousands of XML files with python. The problem is, there is not always the field in every file. resumo_cv = root.find("DADOS-GERAIS").find("RESUMO-CV").get("TEXTO-RESUMO-CV-RH") resumo_cv_ingles = root.find("DADOS-GERAIS")...
asked by 14.12.2018 / 15:14
0
answers

Group data with pandas

I have this code: import pandas as pd df = pd.read_csv('dados.csv') ndf = df.set_index('Codigo').T ndf That returns: WhatIwantedwasforhimto"flip" information from Codigo to use as an index. In this case, one code per line, an...
asked by 14.12.2018 / 16:51
1
answer

unittest.mock: How can I move datetime.datetime.now with different calls in the same method?

How can I proceed with a mock test in datetime.datetime.now with different calls in the same method? In my test, the current date is returned. Following is an example of the code to help you. Thank you in advance. from datetime import da...
asked by 14.12.2018 / 18:11
1
answer

How to remove a tuple from within a list

Good afternoon, I have a problem with a job that is as follows: I have a function that needs lists to organize multiple elements according to predefined characteristics. My question is how do you pull a tuple from within a list as shown in the e...
asked by 08.12.2018 / 15:50
1
answer

How to eliminate noise in an image?

In relation to the image presented, I want to leave only the main trunk and branches (secondary) of the plant (tomato) very visible. Asaresultofmyattempts,whatseemstometobethemostencouragingresultsisthereductionoftheimagearea,followedbytheCa...
asked by 06.12.2018 / 01:46