Questions tagged as 'python-3.x'

1
answer

How to show the keys of a dictionary in the order in which they were inserted

I'm trying to show in the idle the keys and their values, but I'd like to do it using the default order, not chance. For example, I have this dictionary: months = {'January':31,'February':28,'March':31,'April':30,'May':31,'June':30,...
asked by 10.11.2014 / 10:06
2
answers

Python 3.5.0 ::: Erase a Label on Tkinter

I have a code that allows me to play the stone-paper-scissors. Here is the tkinter window: The result does not appear every time I play, because the label of this text does not disappear or erase the text. How do I get to see the result...
asked by 10.01.2016 / 18:02
1
answer

Image overlay on Tkinter

I have a problem trying to overlay an existing image in Python 3. from tkinter import * jan = Tk() jan.geometry("500x500") jan.configure(background="#f0f0f0") head = PhotoImage(file = "rosto0.png") label = Label(jan, image = head) label.place...
asked by 28.07.2018 / 13:07
1
answer

Maximum number of rows recommended

Is there a PEP or good practice suggestion that defines what the recommended maximum number of rows a module should be? In my case for example, I keep more than one class per module, obviously classes that are within the same context, domains...
asked by 21.06.2018 / 21:23
1
answer

Save text file in Python

I'm creating a simple text editor with Python and Tkinter and I want to do a function to save what was typed. I did the save function, but it only creates the txt file and does not save what was typed in Text. How can I do this? Here is my co...
asked by 04.02.2018 / 17:52
2
answers

Chatbot in Python with NLTK

I'm a beginner in python, some time I've been interested in Text Mining and would like to ask for help with a question in a project. Some time I've been studying how to use the Python NLTK Library to create a chatbot. I even got to work ou...
asked by 24.01.2018 / 11:46
1
answer

Problems with incorrect data in a dataset (using Pandas)

I have a dataset called Auto.csv, which has the form: mpg cylinders displacement horsepower weight acceleration year origin name 18 8 307 130 3504 12 70 1 chevrolet chevelle malibu 15 8 350 165 3693 11.5 70 1...
asked by 28.05.2018 / 00:41
1
answer

MySQL Connector for Python 3

I'm doing a project with Django and Python 3 but I can not find the appropriate MySQL connector. django.db.backends.mysql works, but only for Python 2, and I wanted to avoid using that version. In the terminal when I type import djang...
asked by 12.03.2015 / 20:37
1
answer

Graph of a denial of service attack in Python

Friends, I generated the following chart: Thecodeusedwasasfollows:importmatplotlib.pyplotaspltimportmatplotlib.datesasdatesfromdatetimeimportdatetime,timedeltax=[]y=[]dataset=open("./datasetDdos10Abril2017_unixtime_slowloris.csv","r") ##s...
asked by 21.08.2017 / 18:18
1
answer

Call progress bar class from another file

I've been trying to find a way to do this, but I can not figure out how to do this, contains a progressbar in pyqt4, I want to call the class of the file passing as a parameter a title, something like: from modules import progressbar progr...
asked by 03.02.2017 / 15:16