Questions tagged as 'python'

1
answer

Adjusting csv columns with Scrapy

I have a problem, python by default when it generates the csv file separates the columns by comma, however I need the created items to be transformed into the respective columns, but I can not do the same thing, could anyone help me? Here is the...
asked by 17.09.2018 / 06:04
1
answer

Fix Encoding problem when exporting to csv from a scrapy file

How can I fix the encoding problem when saving the file to csv? this problem is only happening when saved in csv. fromscrapyimport*fromprojeto_iruan.itemsimport*importcsvclassimprensaNacional(scrapy.Spider):name='imprensaNacional'start_urls=['h...
asked by 18.09.2018 / 03:27
1
answer

sqlite3.OperationalError: near "": syntax error

Do you know what this error means? Error: sqlite3.OperationalError: near “ ”: syntax error Code: def alterturma(self): bancoturmas = Bancoturmas() #try: c = bancoturmas.conexao.cursor() c.execute(...
asked by 05.08.2018 / 13:55
2
answers

Transition of screens - Tkinter

Let's say there's a three-button screen (Tkinter), each calling another screen when clicked. How to switch between these screens without getting that screen aspect destroyed and a new one appearing? The idea is that it looks like the contents of...
asked by 01.08.2018 / 05:44
2
answers

Chrome bot error - ERROR: platform_sensor_reader_win.cc

I have a python application that performs some repetitive tasks by opening the chrome and using it as a bot (I can not make it available because I work with a stealth agreement), but when I run it, these errors appear and some sometimes the prog...
asked by 09.10.2018 / 19:34
1
answer

Django + Postgresql object has no attribute

I'm trying to do a validation before sending my form, however it returns me the following error: 'StudentForm' object has no termAccepted attribute app models.py: from django.db import models from django import forms from django.forms...
asked by 28.08.2018 / 21:07
1
answer

Doubt with Django 2.0 views and urls [closed]

What is the best way to do these functions in views.py , or does it have to be anyway? from django.shortcuts import render def index(request): return render(request, 'contas/index.html') def cadastro(request): return render(re...
asked by 31.07.2018 / 18:55
1
answer

how do I detect on which side the object is if I draw a line the middle

My friends, I'm discovering computer vision. I'm programmed in python and wanted to know how I do to identify in which position the object is in relation to a line drawn in the middle of the screen. Being more direct, if a line is in the middle...
asked by 23.07.2018 / 18:29
1
answer

Calculate roc curve (sensitivity and specificity) with scklear

Hello. How do I calculate the roc curve in python? I already have part of the code: It is a dataset of tweets that are classified as insecure and others. I'm working with cross validation because there are 400 tweets, 200 for each class....
asked by 22.07.2018 / 23:10
1
answer

Explain template location in Django

I'm using Django for a project, but I came across a question. In my file settings.py I have the following configuration of templates : TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates',...
asked by 25.07.2018 / 02:13