Questions tagged as 'python'

1
answer

How to do Scrapping a page that has a javascript's using python?

I need to scrape a page, however in the page entry has a button (apparently a Javascript) that gives access to the entire content of the page itself. Using the traditional libs (urllib2, requests, BeatifulSoap) I can not "pull" the content I nee...
asked by 09.03.2017 / 15:46
1
answer

What's wrong with the function of sending messages to twitter?

import urllib.request import time def send_to_twitter(msg): password_manager = urllib.request.HTTPPasswordMgr() password_manager.add_password("Twitter API","http://twitter.com/statuses","usuário","senha") http_handler = urllib.reques...
asked by 29.12.2016 / 18:46
1
answer

This program in Tkinter does not display your widgets. Can someone explain why?

from tkinter import * class Autenticar(object): def __init__(self, toplevel): self.Lab1 = Label(main, text = "Usuário", fg = "Blue") self.Lab1.pack() self.Entr1 = Entry(main) self.Entr1.pack() self.Lab2 = Label(...
asked by 29.12.2016 / 00:28
2
answers

How to create a virtualenv with a different python path than the ones installed?

I am using virtualenv to install some packages of my projects so that they do not conflict, but I need to use a version of python that is not installed on the system, as I use linux the same already comes with 2.7 and to 3.5 installed, but I nee...
asked by 17.12.2016 / 02:06
1
answer

How to save a hash to a file?

Code: h = {} arquivo = open("Tabela nome-idade.txt") r = True while r: nome = str(input("Nome: ")) if nome == '': r = False print(h) break idade = str(input("Idade: ")) h[nome] = idade My question is...
asked by 24.02.2017 / 02:43
1
answer

How to select and print a value from a list created by a "def"

The title is already self explanatory, how do I select and choose given str or int / float within a list that was created by my registry function def registro(cadastroaluno): matricula = input("Número de Matrícula: ") telefone = in...
asked by 23.02.2017 / 09:09
1
answer

Manipulation of arrays in python with numpy module

How do I do a rows swap of arrays using numpy? I need this to implement the Gauss-Jordan method of partial pivotal linear systems.     
asked by 28.11.2016 / 23:43
1
answer

Python: problem with list

Would anyone know how to explain and how to fix the problem in the output below when I use repeated numbers? Thank you! The return must be presented in reverse and without displaying the "0" lista=[]n=int(input("Digite um número: ")) while n...
asked by 28.02.2017 / 23:21
2
answers

Popular select a partit from another select using python and django

Good night, I'm new to the forum, and I started doing a small project with python and django. I'm trying to fill a select according to the selected option in another. But since I'm a beginner, I do not know how to do that. <div class="form-...
asked by 27.02.2017 / 00:10
1
answer

How to change the value of an object in .json in python

How do I change the value of an object in .json in python (without rewriting it all)? Ex: { "Nome": "Henrique Antônio de Oliveira" "Cidade": "São Paulo" "Estado": "São Paulo" "Idade": "23" "Número do Pedido:": "457835" }...
asked by 19.11.2016 / 20:24