Questions tagged as 'python'

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

Pre-validation using the CreateView form

I am using the generic views of Django to register / enter a product, the idea or the question is how I can evaluate previously said form sent to your view, my code to create is the following: class CrearProducto(CreateView): model = Prod...
asked by 28.12.2018 / 16:44
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

missing 1 required positional argument - python

I am practicing with classes, objects and databases. I can not make this code work and I'm not sure what I'm doing wrong. I receive TypeError: nuevo_articulo() missing 1 required positional argument: 'precio' Here is my code: import mysql...
asked by 16.12.2018 / 20:27
1
answer

AttributeError: 'NoneType' object has no attribute 'destroy'

Good friends, I have the following problem:    AttributeError: 'NoneType' object has no attribute 'destroy' To avoid placing all the code, I will recreate the error in a shorter way: import tkinter as tk ventana = tk.Frame().pack() str_...
asked by 02.09.2016 / 03:34
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

How do I use .get in Selenium? Python

I'm doing a program and I need to open a web page from python, I'm using the selenium module. This is the code: from selenium import webdriver browser=webdriver.Chrome browser.get("https://facebook.com") The problem is that when I try it, I...
asked by 06.12.2018 / 22:17
1
answer

Why using flask_login despite connecting to the system that is disconnected at random when making a page change?

I am using Flask for an application, it is deployed on an Ubuntu server with NGINX and GUNICORN. The problem that occurs is that although I enter the system correctly using the login form, when wanting to access any other page or even updatin...
asked by 12.12.2018 / 20:08
1
answer

Pymongo find by _id field

I'm trying to check my Mongo database to find a value for the "_id" field with the value returned by the url_for () function from the template. Although I have verified that the value that appears in the URL and the one that passes to the router...
asked by 04.12.2018 / 16:24