It is common to find several apis that make use of KeyWordArgument of python. My question is how to use this refuse for object attributes.
Sometimes when I use an API and I pass a parameter named param=True and the class I'm instan...
I installed the chronometer module 1.0 for python 3.4: chronometer module
I tried to use the start () attribute of the Chronometer method, but it gives an error: it requires a 'self' argument
>>>from chronometer import Chronomete...
I'm trying to override the save method of models so that when a new workbook is created it will be saved and exported immediately to a .json file, this would be a form of automatic backup, but when you register a new workbook it exports all the...
I'm currently starting a web system project using Python 3.5 and the Django 1.9.1 framework, with the intention of integrating them with a database PostgreSQL 9.5 , all installed on a machine running Windows 10 x64 OS.
The installation of Py...
What would be the best way to stop a generator? Example:
>>> def get_fruits():
fruits = ['Mamão', 'Abacate', 'Melão', 'Banana', 'Maçã', 'Uva']
for fruit in fruits:
yield fruit
>>> my_bag = []
&g...
The database driver I'm using, returns the data of a record in the form of tuple example ('João', 32, False) .
I'm thinking of a pythonic way of passing this data to the constructor of a Person class, to create an object with the data cont...
If I want to convert between integers and characters, I use chr and ord :
>>> chr(10)
'\n'
>>> ord('$')
36
However, I need to do a test with binary strings , something new in Python 3, and I - which I onl...
Good evening.
I have a text file where I have already converted your content to lists.
Each line of the file has become a [] list, but now I need those lists all to be inside an array.
This way I can not concatenate because there is only one var...
line = 'nobody:*:-2:-2:Unprivileged User:/var/empty:usr/bin/false'
uname, *fields, homedir, sh=line.split(':')
print fields
I was doing studies in Python and I'll deal with the line so, when trying to compile I get the following message
Synt...