Questions tagged as 'python'

1
answer

Inner Join ORM Django

I have 2 models: class MdlCourse(models.Model): id = models.BigAutoField(primary_key=True) category = models.ForeignKey(MdlCourseCategories, on_delete=models.CASCADE) sortorder = models.BigIntegerField() fullname = models.CharF...
asked by 08.01.2018 / 17:33
1
answer

Binary Tree Size

I need to develop a method to calculate the size of a Binary Tree but I'm getting compiler error. Code: class No: def __init__(self, dado): self.esq = None self.dir = None self.dado = dado class Arvore: def __init__(self):...
asked by 06.01.2018 / 02:38
1
answer

how to disappear CMD window after using os.system in python

I have a code in Python 2.7 that opens a PDF with os.system('meuarquivo.pdf') and it opens up right. However when opening the file it also opens an empty CMD window. Is there any way I can close this window or prevent it from appearing?...
asked by 27.12.2017 / 17:00
1
answer

Integrate Python language into websites. As? [closed]

Hello, :-) I am an apprentice in Python, and I have the following question: How can I start integrating the Python language into websites? if possible, what procedures should I follow?     
asked by 26.01.2018 / 19:38
1
answer

print ("...") is running multiple times

I made a program to verify that the CPF entered is valid, but a bug is occurring: When I type a valid CPF immediately, the message "The Cpf ...." is printed once. When I type a wrong CPF and then type the valid one, the message "The Cpf .....
asked by 28.01.2018 / 16:31
2
answers

Questions about python

I'm new to python, and I'm trying to make a system, where you fill out a questionnaire, and consequently it already prints in html to just paste in the forum. What I put together was this: from datetime import datetime now=datetime.now() ano...
asked by 01.01.2018 / 17:13
1
answer

Dictionary problem - AttributeError: 'int' object has no attribute 'get'

I'm starting to learn the basics in Python, and one of the examples on dictionary lists asks for something like this: inventory = {'a' : 1 , 'b' : 6 , 'c' : 42 , 'd' : 1 , 'e' : 12} def DisplayInventory(stuff): for k,v in stuff.items():...
asked by 29.12.2017 / 06:51
1
answer

bytes-like object is required, not 'str'

I'm trying to run this code: import time import urllib.request from urllib.request import urlopen ibov = ['BBAS3.SA', 'PETR4.SA'] def yahooKeyStats(stock): try: sourceCode = urllib.request.urlopen ('https://finance.yahoo.com/quote/......
asked by 31.12.2017 / 07:50
1
answer

how to handle a json that contains multiple results using python

Hello, I'm doing a python script that takes the name of a movie and returns some data to the user (title, year etc). I'm using api omdbapi, but my question is not with regards to it but how to handle the following json link , when I use the par...
asked by 18.01.2018 / 23:52
1
answer

How to avoid error Max retries exceeded in scraping in Python?

In Python 3 I made a program to wipe table rows from a multipage public site (97893). And I create a list with the rows of each column and I put sleep to try to avoid that the scraping stops, but even using several times is not working...
asked by 19.01.2018 / 12:41