Questions tagged as 'python'

1
answer

Problems with Decode and Arduino

Hello, People I have the following code in Arduino if((digitalRead(4) != 1)||(digitalRead(5) != 1)) { Serial.print("\t"); Serial.print(analogRead(A0)); Serial.print(","); Serial.print(millis()); Serial.print(...
asked by 17.04.2018 / 05:38
1
answer

How to check the existence of a file and the amount of lines written in Python?

What is the best way to check if the file exists and the number of lines within the file.     
asked by 23.01.2018 / 13:11
2
answers

Password Validation with Python

I have the following requirement to validate a password in the registry: Size: 10 characters Uppercase: 2 Lower case: 2 Number: 1 Symbol: 2 How do I do this with python? For the time being I have only been able to do this, sinc...
asked by 08.03.2018 / 14:52
1
answer

Start a virtualenv with .bat file

I have the following .bat cd C:\Users\SERVIDOR-ARQUIVOS\Documents\workspace\email\.venv\Scripts activate.bat cd C:\Users\SERVIDOR-ARQUIVOS\Documents\workspace\email\src python manage.py (comando personalizado) It goes to the folder but clos...
asked by 19.02.2018 / 21:49
1
answer

In pandas, how to merge two dataframes, but only a two-column stretch?

In Python 3 and Pandas I have two dataframes eleitos_d_doadores_d.info() <class 'pandas.core.frame.DataFrame'> Int64Index: 16090 entries, 16 to 26412 Data columns (total 23 columns): uf_x 16090 non-null object p...
asked by 21.02.2018 / 18:03
2
answers

Ignore any white space in the middle of a string

I'm trying to create a regex that is able to find a string in a text even though there is some white space in the middle of the words. For example, I search the text for the following excerpts "impaired conciliation" or even "irreconcilable"...
asked by 30.01.2018 / 16:29
1
answer

Concatenate pandas dataframes with different column names

I have two Pandas DataFrames that I would like to combine into one. They have the same number of columns, in the same order, but have headers with different names. Is there any approach to efficiently combining these dataframes? df1 index Dat...
asked by 31.01.2018 / 17:00
1
answer

PYTHON - how to use a loop without stopping the Tkinter

I have this program which is a kind of 'AirForce' (I automated a click process in a place, type a number, and click elsewhere with @Pyautogui), I need to use a loop but when the loop starts Tkinter, so I could not think of how to do something to...
asked by 06.02.2018 / 21:37
1
answer

For i uses only the last variable - Python

Good morning! I have a project that I am improving and would like to do a For i to run all the variables within the project, however when running it applies the project only to the last variable. Code: for i in ['1', '2', '3']: a...
asked by 26.04.2018 / 15:20
1
answer

A solution to break / continue a loop in Python?

The question is this, I can not find a solution that will override console usage for my small application. What happens is: My application runs in the eternal loop, but after it executes the loop, it should stop to ask if I want to stop the l...
asked by 27.04.2018 / 06:53