I have this list A :
A = ['-1', '-2', '-2', '1', '1', '10', '100', '20', '4']
If I put sorted(A) I get this
['1', '1', '-1', '20', '4', '-2', '-2', '10', '100']
I tried this list:
lista = ['3', '2', '5', '6', '7']
and...
I need to open a file that is in another directory that is being worked on, I tried with:
open("../carpeta/subcarpeta1/subcarpeta2/archivo.log")
but when I run the script I get:
FileNotFoundError: [Errno 2] No such file or directory:...
When accessing a web via python, is there a way to show the response code of a javascript? what the user sees I have this:
import mechanicalsoup
browser = mechanicalsoup.StatefulBrowser()
print(browser.open("https://www.web.com/"))
print(br...
When I run my program it gives me this error:
new = colony.Colonia (self .__ tasks, self .__ times)
UnboundLocalError: local variable 'colony' referenced before assignment
my class is the following:
import tareas
import hormiga
imp...
I am connecting to an API in which you return a PDF in bytes format and I want to know if there is any simple way to format it in PDF to be able to download it.
My problem is that it returns a string of data in this format:
b'%PDF-1.7 \n%\x...
Hi, I would like to know how I can capture key combinations in python3 , for example by pressing Ctrl + A execute a method in a class. It's for a console program and this is what I've found so far of information.
#! /usr/bin/env python3...
I have a question about the classes, is it about if having two classes (a father and another daughter) could get a list (global) that is in the father and join new elements from the daughter?
And if that is how I could do it, then I have mana...
Hi, I would like to create and save an object in the database which has arguments args and kwargs . the arguments args and kwargs must obey the format JSON , I have the following:
class ProgramarActividadForm(f...
I have a thread in which I asked how to generate a treeview from a panda dataframe in python. The thread is this:
How to use Tkinter ProgressBar
My problem now is that I do not know how to implement a function that orders each column whe...
I have a dataframe where there is an index and several columns, in the columns there are empty rows (my idea is not to eliminate them, but to fill them, since I do not want to lose so much data) I know a lot of the information of that column (wi...