Questions tagged as 'python'

3
answers

Delete space when reading a text in python

I'm having problems reading a file, it's a vector with a series of numbers, I want to operate with that data, but when I read it, it adds a "\ n" line break that is not in my text file, I am using the following code: infile=open('uncarb.txt')...
asked by 27.07.2017 / 22:38
0
answers

create several files with different names in python

I have to create several undefined files when the Internet is disconnected and await a json inside each of those files, but I do not create several files I do not know how to create file_1, then file_2, so consecutively since it does not I know...
asked by 29.06.2017 / 23:32
0
answers

Run the following project in python

I'm trying to start the next project: project I'm trying to start Basically what I do is start the pyvoicechanger.py: but it always shows me the same error:    C: \ Users \ Desktop \ New folder   (3) \ pyvoicechanger-master \ py...
asked by 27.06.2017 / 20:09
1
answer

Change values of an RDD

How can I change all the letters A to a 9 and all the letters B to an 8 in an RDD with a lambda function. I tried this but it does not work: rdd.map(lambda a: 9 if a == "A" else a == a) rdd.map(lambda a: 8 if a == 'B' else a == a) My exampl...
asked by 22.06.2017 / 18:49
1
answer

Problem installing spyder

I am trying to install spyder directly without resorting to something anaconda or winpy. For this, I have installed python 2.7.13 and PyQt4. With that installed I tried to launch the command pip install spyder But I get the following error...
asked by 23.06.2017 / 17:21
3
answers

python loop for a xml

I have a file where with a regular expression I get 3 data that can be repeated up to 30 times matches = tools.findall(pattern, html, re.MULTILINE) for match in matches: pattern = 'umber\":(.*?),\"g' dato1 = tools.findall(pattern, mat...
asked by 21.06.2017 / 17:43
1
answer

Run snippet of code at a specific time / date in a running script

In my program ( Python 3.5 ) I want to execute a function at a certain time regardless of which phase of the code it is. But I do not know any sentence that verifies all the time (even in the course of the program) what time it is and if i...
asked by 08.12.2016 / 17:00
1
answer

I have an error when trying to open a python program in the cmd

I use sublime text as a text editor, but when I want to run a program that asks for data the user does not leave me and I think it is part of sublime; then following a facilitated code course I am learning to execute my programs with the Cmd; bu...
asked by 15.06.2017 / 03:14
0
answers

Add interfaces ui to main window (python)

class MenuA(QMainWindow): def __init__(self): QMainWindow.__init__(self) uic.loadUi("Interfaces/MenuAdmi.ui",self) self.actionAgregar.triggered.connect(self.AgregarInvent) def AgregarInvent(self): AgregarI...
asked by 15.06.2017 / 00:40
0
answers

error 1136 with new columns in mysql table

I am working with tables in mysql, it was working well for me, but I created 2 new columns and when I run it, I get an error.? This is part of my code that I execute, I made new records when I had 5 columns and well, but add 2 new columns to...
asked by 15.07.2017 / 18:41