Questions tagged as 'python-2.7'

1
answer

Python 3.4 and Python 2.7: How to remove the preinstalled version of MacBook?

Currently I'm migrating from a Mac to a Windows and today I discovered, when I installed all the features I needed, that I already had a Python 2.X in it and I need to run Python 3.4.3. > How can I remove the old version that is harming me?  ...
asked by 15.07.2015 / 23:05
1
answer

Urllib2, exception handling

I'm a beginner in the art of programming. I'm learning to program in Python through a book,    Learn to Program: The Art of Teaching the Computer (Cesar Brod - Novatec Editora) In one of the exercises, I should use the Urllib2 function li...
asked by 16.04.2015 / 01:42
2
answers

Tkinter focus on a window ignoring the back?

In my code there is a frame with a button and it is called "Open", clicking "Open" will bring up another window. The problem is that if I click on the window that is the "Open" button again, it will open a new window. What I want is to be...
asked by 25.06.2014 / 13:24
1
answer

How to create buttons forward and back QUI PyQt4

Hello, I'm new to PyQt and I have a question, I need to create a program with several steps, or screens, where the user will do their processing on each screen and clicking 'next' to the next screen or if he wants to edit something earlier, it w...
asked by 23.10.2015 / 23:45
4
answers

Generate random values from a distribution in Python

Hello I'm trying to generate random values from a distribution (Gamma, normal and etc) in python, but I'm having trouble importing the library. I am using the following library "import scipy.special as sps", but it is giving error ... using b...
asked by 11.11.2015 / 19:24
1
answer

Lists and dictionaries python

I'm working on Python 2.7. import collections counter_ger=collections.Counter(sub_todaas) a=counter_ger.values() b=counter_ger.keys() sub_ind_novo = [Ntodos.index(i) for i in b if i in Ntodos] (where Nodes contains many names, among which a...
asked by 30.05.2016 / 18:58
0
answers

How to extract information from an HTTP header with Python?

We know that in the HTTP protocol, the end of the header is indicated by " \r\n\r\n ". Example: Forsomereason,theclientmaynotsendthe" \r\n\r\n " to the server (this could be an attack, for example): Suppose I have a netw...
asked by 01.09.2017 / 17:15
1
answer

Help tables python27

Good morning, I'm new to Python / Tkinter and I have some projects in mind, but they all have tables using them, could anyone tell me if some library I could use to create these tables or some way to create them? I tried to use tkintertable but...
asked by 01.07.2014 / 14:12
1
answer

How to install Python 3

I'm new to Ubuntu and I'm learning Python. I have installed Pyhton 2.7.12 on my pc and would like to know how I can upgrade to version 3. I'm doing a course where I need to make use of a lib. import urllib.request But the following er...
asked by 02.09.2016 / 12:44
1
answer

Adding strings of numbers

Well, I have a string of the sort a = ("1234") and I wanted to separate those numbers so I would add them, like this: 1 + 2 + 3 + 4 How can I do this? Thanks for any help:)     
asked by 16.03.2015 / 18:26