Questions tagged as 'python'

1
answer

Iterate in multiple text files

Good afternoon. I have the following purpose: I have a series of text files and I want to create a script to iterate over all of them and count how many times certain strings appear in them. I was able to script for a single file. But I'm hav...
asked by 16.03.2016 / 19:33
2
answers

TypeError - 'int' object has no attribute '__getitem__' when iterating over list

Problem: Write a function that accepts a list of integers and return a list that is the drawn version (of ascending order) of the original list. (Original list should not be modified). You can not use the built-in sort () or sorted () function...
asked by 21.02.2016 / 17:34
1
answer

How to extract data from plain non-standard texts?

I would like to extract fields to a database from text files. However, the fields are positioned differently in each text and it is difficult to obtain the values by common methods, for example: file 1: PROVA: 2º Corta Mato LOCAL: Pin...
asked by 09.12.2015 / 15:22
1
answer

Difference between tuple and set

I'm working with python and I was wondering what would be the difference between a set () () and a tuple (). I know that both are delimited with '()'. But I tried to assign a set attribute to a tuple, that is: THIS IS MY SET: (OR WHAT I TH...
asked by 19.11.2015 / 20:57
1
answer

Click button does not work [closed]

I have a button made in ext , that it should open a window when Selenium clicked, but it does not happen, I'm doing it as follows. from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait import...
asked by 13.01.2016 / 18:01
1
answer

spyder can not read serial port

I created the following test program: import serial porta = '/dev/ttyUSB0' baud_rate = 9600 try: Obj_porta = serial.Serial(porta, baud_rate) valor = Obj_porta.read() print valor Obj_porta.close() except serial.Se...
asked by 19.08.2015 / 21:09
1
answer

How to rotate a video within a GUI

Good night, I have a problem. I need to run a youtube video inside a GUI interface (with Python). A user of the community helped me by providing the following code: link however, it was written using PyQt4. But all my final project is...
asked by 14.07.2015 / 05:19
1
answer

Go through the entire record

I would like to know if I can get through the whole registry (keys and subkeys, do not need the value of them) of the operating system to find the name of a specific key? If yes, could someone tell me how to do it in python 3.x + or at least...
asked by 29.05.2015 / 05:24
1
answer

Can I become a programmer by studying Python using QPython? [closed]

For example, if possible make money. I have QPython version 2.7 and 3     
asked by 26.07.2015 / 17:53
1
answer

How to convert a "SQLite3 object cursor" to a list (Python)

In a cell of a table in my database I have a list of pairs. I have a Python module that I want to go fetch this list from the database and read it as a list. I tried to run this: interpretation = db.execute("SELECT interpretation FROM music WH...
asked by 26.05.2015 / 23:19