Questions tagged as 'python-3.x'

1
answer

Filter results Serializer Django

Good, I have a problem because I want to filter the data of an FK in a serializer. class ProductoArmarioSerializer(serializers.ModelSerializer): imagenes = FotoSerializer(many=True) tallas = StockSerializer(many=True) class Meta:...
asked by 28.12.2017 / 09:27
1
answer

How to get values of a model in flask?

I'm trying to get the values of a model in flask, I want to access the values of my model, not a " render_template " record = MyModel.query.filter_by(id=222) But with this I get an SQL query back. The idea is to access as i...
asked by 12.12.2017 / 01:02
3
answers

How to identify decimal and integer in Python

Good morning / afternoon / evening, I come here with the question of how to identify decimal and integer in python. Because I enter numbers with the float in case the user enters the decimal number. Then I want it to show an integer number in ca...
asked by 22.01.2018 / 17:25
1
answer

ID Alfanumerico Django

good: I'm trying to generate unique ID's with letters and numbers but all the methods I've tried return strings that can give the possibility of repeating and cause the application to fail. Right now I have this: class Comentario(models.Mod...
asked by 26.01.2018 / 17:06
1
answer

Problem with 'glob' in Python

Hello, I have a problem with glob , and it is that you are not giving me the files in an orderly way, it is a simple code: import glob filenames = glob.glob("C:\Users\LuisMiguel\Downloads\Faces\/*.jpg") filenames.sort() What gives me...
asked by 29.11.2017 / 01:40
2
answers

problem to separate attributes by columns in .csv file

The program should read "a table" in python and then write it in a csv file, what I have until now is: What is above the main code are functions that simply serve to add names, ages and scores (I do not see it necessary to add it). ########...
asked by 01.11.2017 / 05:12
1
answer

sublists in python

Good morning, I need help with this statement: "Modify the previous program so that it takes into account the gender of the recipient, for that, they will have to receive a list of lists, with name and gender." The previous program is as f...
asked by 23.11.2017 / 17:08
1
answer

configure python 3.6.2 and pycharm professional in ubuntu 16.04

I'm trying to configure python3.6.2 (the one I already have installed) in professional pycharm, and when I try to change the python version when creating a project only versions 2.7 and 3.5 appear. How can I configure this version in pycharm...
asked by 03.08.2017 / 16:51
1
answer

Save file with QLineEdit data using getSaveFileName

I am writing an application using pyqt4 and python 3 . The data entry is by QLineEdit , mainly, and QTextEdit , the data is operated and the results are shown in other QLineEdit . On the monitor works well. Now I w...
asked by 02.07.2017 / 19:57
1
answer

Insert a document in HCP with python

Hello I hope you are well, I have problems uploading a document to HCP (Hitachi) this is the code that I'm occupying import http.client projectName = "Prueba" hcpConn = ".prueba.local.mex" headers = {'Authorization': 'HCP ZONud4M=:85e704...
asked by 09.06.2017 / 18:40