Questions tagged as 'python-3.x'

1
answer

How to detect if one color is similar to another in opencv?

The most probable thing is that the wording of the question is not correct, but I can not think of how to write it. Adobe Premiere Pro has the green screen option and you can tell it to erase the color you selected and all the similar colors wit...
asked by 02.01.2019 / 00:01
1
answer

To know what folders and how many are inside another folder

I want to analyze items that are inside folders. For this I see that I need to use the library glob . Googleando I have learned to know what elements or how many there is of a specific extension within a folder. jpg = glob.glob('carpeta/...
asked by 23.12.2018 / 19:56
1
answer

Problem writing to the Python file

I have an arduino that sends values through the serial port, what I want to do is read the data and save it in a .txt file but it does not save the data. Can you help me? import time try: import serial arduino = serial.Serial('COM...
asked by 31.12.2018 / 16:28
1
answer

Why do you show me errors when importing tkinter into VSC?

It's very strange because my code is running well but this kind of error keeps coming up:     
asked by 18.12.2018 / 11:35
1
answer

why can not I release my exception

Good evening I'm starting on the issue of raise exeptions and I'm trying to perform a simple operation however it does not work this is what I tried: class errores(Exception): def __int__(self,numero1,numero2): self.num1 = numero1...
asked by 31.12.2018 / 06:05
1
answer

Error in deploy with NameError: name 'static' is not defined

When uploading files to the server in pythonanywere I get the following error line. Any ideas on how to solve it? File "/home/factura/wp/wp/wp/urls.py", line 36, in <module> urlpatterns += static(settings.MEDIA_URL, document_root=se...
asked by 07.12.2018 / 23:32
1
answer

Know if a row of a dataframe has a NaN value - Pandas

I am trying to learn and get loose with pandas (which is costing me). I have a dataframe similar to this one: If I want to know if there is any NaN, None or NaT value in the set I apply the following code. t = df.isnull().any().any()...
asked by 10.12.2018 / 20:52
1
answer

How to configure Frame widget in Tkinter?

I've been learning to create Gui in Python with Tkinter for almost a week. When creating free space around or creating a box and determining the measures of the widget by using the Frame container, you can not modify the attributes such a...
asked by 15.04.2017 / 05:19
2
answers

I can not solve the error: TypeError: Object of type method-wrapper is not JSON serializable

# Import(s) # import json from chat import message_handler as me import random ############# mind = {"message": "null","mID": 0,"reply": "null"} def learn(m): getMessage = m getReply = me.reply strReply = getReply.__str__ min...
asked by 17.11.2018 / 22:37
1
answer

I want to write to a file without replacing the text with a "dict" without the "" of the string

mind = {"message": "null", "mID": "0", "reply": "null"} mind["mID"] = random.randint(0,1000000000000) mind["message"] = getMessage mind["reply"] = strReply Assuming a hypothetical operation only, you would want to get that by calling the...
asked by 18.11.2018 / 00:49