Questions tagged as 'python'

2
answers

help with indentation that is generating error in python 3.6

I'm doing a webcrawler I'm having the following problem. I had to do a separate program to print out how many candidates passed each course. Except that the last line is not being executed, and that it would make the vector names go to the next...
asked by 02.03.2017 / 23:24
2
answers

python manage.py syncdb does not work!

When you try to follow a tutorial I can not continue because the bank was not created, can you help me? Error: Unknown command: 'syncdb' Type 'manage.py help' for usage.     
asked by 02.03.2017 / 01:49
1
answer

How to declare and use methods that are in the same class

Good afternoon. I would like to know how to declare and use methods within the same class. For example, in a class there are 2 methods, which 1 method uses the other. For example: class ClasseEMetodo: def retorna_valor: return '...
asked by 17.05.2018 / 20:17
1
answer

If you have this word in the curl response, print "OK"

I made a curl in python to check some information from my client, it's happening okay, the answer from my api is json, I would like to know how to do if api has, for example "userId", it shows itself an "OK" on the console. import requests...
asked by 18.05.2018 / 00:05
1
answer

Error in relative import in python

I'm trying to test a simple python code using pytest. My hierarchy is as follows: PythonExamples files mymath.py tests test_mymath.py In test_mymath.py, I import mymath as from ..files import mymath as mm def test_...
asked by 16.03.2017 / 20:24
1
answer

Django does not render static files that are in subfolders within / static /

I'm working on a Django project that has static files (css / js / imgs) in the following structure: File Structure django_project | +apps | +django_project | +media | +static |...
asked by 30.01.2017 / 15:11
1
answer

Upload and view PDF's Django admin

I want to ask a question, I'm trying to upload a PDF file, in django, and I wanted to know if you how do I view this pdf, I have the following code: models.py class Edital(models.Model): # ... class DataFile(models.Model): Arquiv...
asked by 08.02.2017 / 06:39
1
answer

How to create a Parser in Python?

For a file-driven project, I wanted to convert from "CFG" to "XML", and I believe Python does not support either of these types. There was a colleague who did the modification manually, so we could study the XML. Here are the respective CFG a...
asked by 14.01.2017 / 14:22
1
answer

Difficulty in developing a game

I'm implementing a game against the computer that follows this format:    Be N the starting part number and M the maximum number of parts that is   possible to withdraw in a round. To ensure that your computer   always consider...
asked by 13.01.2017 / 05:12
1
answer

Python Load Serialization Files

Hello, I have been studying Python for some time and doing some programs to join with Arduino. My question is good practice in loading files. I want to make a program that interprets files. My idea was inspired by the logic of HTML, CSS an...
asked by 06.01.2017 / 14:56