Questions tagged as 'python'

1
answer

Error in sorting text with tree

I'm trying to sort, but it's giving the error. Follow the code, then the error. #coding=UTF-8 import io import os import pandas as pd from sklearn.feature_extraction.text import CountVectorizer from sklearn import tree pasta="c:/u...
asked by 11.11.2017 / 16:48
0
answers

Display message (QmessageBox) from another class other than the main one in PyQt4

Friends, I ask you for help, I suppose it's simple but I'm having difficulty, because I'm still learning object orientation with PyQt4. I have a main class (Application) separate from the class that forms the main screen (in the ui_principal.py...
asked by 21.11.2017 / 18:45
0
answers

Problem installing Seaborn

Well, I would like to install Seaborn to plot some graphics in Python, but when running: $ pip install seaborn The following error appears: Collecting seaborn Using cached seaborn-0.8.1.tar.gz Collecting pandas (from seaborn) Using ca...
asked by 20.11.2017 / 20:48
1
answer

Ways to find out the highest and least number entered in the input by the user in a for

Well briefly, I have a question if there is a way to make this code any more "simple". The code itself is already simple but wanted to know if there is another way using less lines or without using the power. This was the only way I could get...
asked by 04.11.2017 / 22:02
1
answer

How far can I use Instagram data in a crawler? [closed]

I'm just curious, but these days Instagram has given me some doubts. I've made a simple crawler using BeautifulSoup to extract date and receive daily information from new posts. The question is if I can extract access information to my profile?...
asked by 25.05.2018 / 18:36
1
answer

Single lists with at least 2 elements of difference

Considering the numbers: 01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25 How do I generate lists of 15 items (numbers quoted above), and they must have at least 2 items of difference between them. For example: 0...
asked by 29.05.2018 / 03:02
2
answers

Python code using HMAC library

I'm doing a job on encryption for college using HMAC along with SHA256, and I would like to understand what this code does on each line, I'm a bit confused. #!/usr/bin/env python3 import hashlib import hmac from math import ceil hash_len = 32...
asked by 10.06.2018 / 18:02
1
answer

Problems with indentation rules PEP8

I'm using the autopep8 extension in sublime text 3 and it suggests to me that the following line looks like this: self.buttons = [Button(self.fonts["alfa_slab_one_regular_40"], "JOGAR", midtop=[self.screen_rect.centerx,...
asked by 02.12.2017 / 14:05
0
answers

Project Structure in Django

I installed Django in a project and would like to leave the folder structure somewhat similar to Laravel. I can organize myself better like this. But I do not know if it's possible using such a framework. I would like this: PROJETO --- venv...
asked by 27.12.2017 / 14:27
2
answers

How to print text in the same line in Python

list = open("list.txt", "w") list = list.readlines() for i in list: print i I wanted to print i on the same line without getting down, type replacing the current word     
asked by 26.05.2017 / 20:14