Questions tagged as 'python'

0
answers

How to send multiple commands to a remote server using python

How can I send multiple commands to a remote server using python? I had to learn python for study reasons, so I decided to try to automate the information collection of the bacula consoles. I'm trying to use the following script, but I hav...
asked by 05.10.2017 / 16:20
0
answers

Problem with the data acquisition time function provided by Arduino

I'm doing a plot vs time temperature via Arduino in a graphical interface. The program is catching on. Problem is in the function of time: # -*- coding: utf-8 -*- import matplotlib import matplotlib.pyplot as plt from PyQt4 import QtGui, QtCor...
asked by 18.10.2017 / 18:37
0
answers

Read .xls file

I have a problem reading a .xls file using Python with Flask. My code: from openpyxl import load_workbook wb = load_workbook(filename=settings.MEDIA_ROOT + '/xls/arquivo.xls', read_only=True) ws = wb['Tab 1'] for row in ws.get_squ...
asked by 04.10.2017 / 04:30
0
answers

Error Correction Code (Repetition)

I have some doubts in this code. I would like if someone could explain the functions to me. from scipy.stats import binom import matplotlib.pyplot as plt import numpy as np r=[2*i+1 for i in range(4)] def single_bit_error(r, p=0.05): r...
asked by 04.10.2017 / 01:12
1
answer

IndexError: index 4 is out of bounds for axis 0 with size 4 [closed]

Good evening. I have the following code in Python, but the error quoted appears: import numpy as np x=np.ones((4,1)) for k in range (5,45): x[k]=5.5369*x[k-1]*(x[k-2])**2+0.1931*x[k-3] print(x) The error is: IndexError: index 4 is...
asked by 03.10.2017 / 23:25
2
answers

Pass value from one page to input of another

I have an html page where the user types the email and I carry out the verification. If that email is not in the database, you are a new user and therefore redirect to the registration page. On the registration page I want the email field to...
asked by 04.10.2017 / 20:01
1
answer

How to apply recursive action in csv.DictReader

Hello, I created the following code but it only applies the function to create the txt file using the last record of the CSV table, how do I get it to create a file for each record of that table? import csv import os with open('lista.csv') as...
asked by 13.10.2017 / 10:47
1
answer

Read CSV worksheet data to generate custom files

Friends, I'm having trouble creating a Python code that reads information from a CSV and creates TXT files with custom names according to the content of the CSV (reads the cell item and generates the file esse_name.txt) Can someone give me a lig...
asked by 13.10.2017 / 03:03
1
answer

Convert document word (DOC) to pdf using python

I would like to convert a word document (doc) to pdf using python 2.7 . I have this script, but I did not understand anything about it. import sys import os import comtypes.client wdFormatPDF = 17 in_file = os.path.abspath(sys.argv[1]) o...
asked by 13.10.2017 / 04:09
1
answer

How can I set a range for a float?

Trying to implement Newton's method to find roots in polynomials using Horner's method. n=len(a)-1 print("k\t a\t x\t px") for k in range (0, iterMax): b=a[0] c=b for i in range (n-1,1): b=a[i]+(b*x) c=x*c+b...
asked by 29.09.2017 / 22:17