Questions tagged as 'python-3.x'

1
answer

How to create a list of objects of variable size, and assign their attributes without listing them one by one?

I need to read a file and pass its information to a list of objects. The file is in the format: "attribute1", "attribute2", "attribute3", ..., "attributeN" Each line contains the information for a different object. All objects are of the s...
asked by 28.11.2018 / 15:47
0
answers

Django saves the records only with a default value and not with the value of the form

Good night, I'm having a big problem with django, no matter what I do, it always saves the data I set as the default rather than the data I sent through the form. models.py from django.db import models from django.contrib.auth.models impo...
asked by 22.11.2018 / 06:25
2
answers

How to do string interpolation in Python?

For example, in PHP we can do this: $preco = 200; $unidades = 10; $texto_final = "O produto custa {$preco} reais e restam {$unidades} unidades."; Is it possible to do something similar in Python or do I need to concatenate always?     
asked by 22.12.2017 / 07:10
0
answers

Error: TemplateNotFound Pending

I'm trying to create a basic application, but I'm not able to render the template in the application Project Structure ├── Project │ ├── Controllers │ ├── __init__.py │ ├── __init__.pyc │ ├── Models │ │ └── Conexao │ ├── template...
asked by 24.11.2018 / 20:17
0
answers

Parse data in a file that contains information about the systeminfo

A "txt" file containing return information from the systeminfo command has been generated, and I need to be able to copy some of the file lines, in this case, those containing information about: total physical memory, available physical m...
asked by 26.11.2018 / 17:16
1
answer

Python 3 Tkinter: How to get a value / string from a RadioButton inside a function?

I'd like to get value from the selected sex and print it in the DataSavers window, but it does not work, not even the other data typed as name or age. I have here a main window where it will display two buttons: REGISTER and EXIT. The exit butto...
asked by 27.11.2018 / 13:44
1
answer

Application with login and access control (Error: TypeError: 'NoneType' object is not subscriptable)

I'm putting together a basic application with login and access control, meaning not all users can access the same windows. However I have a problem loading the user information into the window after it has login . When I try to make a funct...
asked by 21.11.2018 / 09:52
2
answers

Get Data in JSON structure with python

I want to access certain information in the JSON code below, with python: { "informacao1": valor_informação1, "informacao2": "{ dado=informação_dado }" print(arquivojson.get("informacao1")) The above print will display the line bel...
asked by 21.05.2017 / 16:42
0
answers

Error after running Python script

Good Night, I come here to ask for help because although there are similar errors to mine on the internet and here in the stack, none of them are the same, and no solution worked, as I am not aware of all that I have left I came here to ask for...
asked by 18.11.2018 / 22:23
0
answers

Inserting data in python

How can I make the file below do what you need in print? import glob, os, codecs, sys, codecs # ================================= # Metodos para Indexacao # ================================= def tokenizacao(documento): # retorna list...
asked by 19.11.2018 / 23:05