Questions tagged as 'python-2.7'

0
answers

Python - Pygame

Personal in python when I write the following command import pygame to import pygame the following error appears: Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> import pygame ImportError: No...
asked by 08.07.2016 / 20:42
1
answer

Infinite Loop in Exercise Using Classes

I'm doing an exercise in Python, which is a game using classes. It happens that when you get into the "EscapePod ()" room and select the correct POD, the looping becomes infinite, not the reason. from sys import exit from random import randint...
asked by 26.06.2016 / 17:22
0
answers

Selecting and deleting random csv lines in python [closed]

I need to make a small python script that meets the following requirements: Open a csv file; Exclude from reading the first line and the first column, because it contains information that will not be necessary in this computation itself;...
asked by 24.07.2016 / 04:55
0
answers

Thread Synchronization in python

I'm doing a program that should simulate file synchronization between two threads, but I do not know much about the python language. I've already created threads, lock methods, and files. However I can not make the run select a file at the sourc...
asked by 27.04.2016 / 15:44
1
answer

Working in Python 2.7

How do I leave a bold item? print ('Company Soon Young Viana') How do I enter an income tax sheet? print ('PRODUCT' '\ t'u' UNIT COVER '' \ t''QUANTITY '' \ t'u'FULL TIME '' \ t''ICMS ')     
asked by 22.11.2015 / 17:37
2
answers

List List List

I have the following list of lists: lista = [['a', '1'], ['c', '3'], ['b', '2']] And I want to sort this list according to the numbers, that is, I want it to look like this: listaOrdenada = [['a','1'], ['b','2'], ['c','3']]     
asked by 30.11.2015 / 19:42
1
answer

Increment URL through concatenation and using urllib2.urlop

I'm using the code below to access and do the scrapp of emails that, at least as far as I've seen, are in three identical URLs that only vary Numconsulta_cadastro= . By running the code below, he can pick up the emails from the first pag...
asked by 17.10.2014 / 01:31
1
answer

Error reading JSON

I'm trying to read the JSONs from a folder and get the proper values, I already tested all the JSONs to see if they were valid. The folder with the JSONs is called 'test' for dirname, dirnames, filenames in os.walk('test'): for filename in...
asked by 10.11.2014 / 16:23
2
answers

Concatenate items in a vector

I have the following vector, which I get after querying a database: a = ['[[10, 20], 10]'] When I try to access their values through the indexes, I can not. For example, if you type: print(a[0][0]) . Returned '[' I've tri...
asked by 12.10.2017 / 01:09
2
answers

Encoding problems

I have a coding problem that I can not solve. I've tried several suggested things, but none works: Script: # -*- coding: utf-8 -*- import sys line = ["Oi tudo bem com você","eu GOSTO de café", "esta situação é Terrível"] def sup...
asked by 10.07.2018 / 12:48