Questions tagged as 'python-3.x'

1
answer

Error getting data in Python

I have this code in a Python 3.7.0 program that theoretically should not give an error: import pyodbc import csv conn = pyodbc.connect('DSN=EDISOFT') cursor = conn.cursor() for row in cursor.execute ("select top 100 isbn,ean, titulo, pvp...
asked by 20.09.2018 / 08:39
0
answers

Avoid with exception the interruption of the script due to failure of the connection or internet

Greetings I made the following script that brings me the states of the web through a txt file. I do not know if it's the fastest way but it works for me, the issue is that I do not know very well the issue of exceptions with socket. I have the t...
asked by 14.09.2018 / 23:52
0
answers

How to enter a value in the middle of a list already created

Insertion sort I have a list already created and ordered ascending. a = [10,20,30,40,50] adding a 0 in the last position a.append (0) I have to ask for an example number 25 I have to place it in the list without losing the ascending order, so I...
asked by 18.09.2018 / 02:40
0
answers

Error in LOAD DATA INFILE in Python3.4?

I have the following script in python3.4 to insert data into a MySQL table: import pymysql connection = pymysql.connect(host='localhost',user='root',password='',db='bd',charset='utf8mb4',cursorclass=pymysql.cursors.DictCursor) cur...
asked by 18.09.2018 / 04:59
1
answer

Return an 8-bit array in Python

I'm doing a program for a Vúmetro in python where I need to return an array of values in 8-bit binary, but when I run my program it returns the array but in a way that the 8 0's are executed first and then a 1 with 7 0's , two 1's with 6 0's, .....
asked by 23.09.2018 / 19:20
1
answer

Django: url error when saving a record from admin

I tell you my problem. I am deploying a web (Python 3.4 and Django 2.0.4), it has already saved data in several models from the admin panel logged in as superuser, but when I came to an app called About, with a model of the same name, I is ju...
asked by 14.09.2018 / 11:23
1
answer

Save a get () in a variable

I am programming in Python3 with tkinter and when I try to save the result of a text box (an Entry) in a .get () and use that variable in a Label, it does not appear, for example: varNum=IntVar() cadrotexto=Entry(root) numeroRecogido=cuadrotex...
asked by 14.09.2018 / 16:06
1
answer

Error django_session

I am deploying my application and when I try to login it gives me this error, my application works with 2 database 1 with postgresql and the other sql server that is on an external server, the users are at the base data postgres , t...
asked by 19.09.2018 / 15:54
2
answers

Get the number of common elements from two lists

I am implementing the python code for this statement: Implement a function called cantAparicionesSub that take two integer lists as a parameter, and calculate the amount of elements of the first list that are also in the second. Also return a li...
asked by 25.09.2018 / 05:27
0
answers

Robobrowser to login in a form

I'm trying to login in a web form: from robobrowser import RoboBrowser s = requests.Session() browser = RoboBrowser(session=s, history=True, parser='html.parser') browser.open('https://www.miweb.com/') print(str(browser.parsed)) form = brows...
asked by 13.09.2018 / 10:17