Questions tagged as 'python-3.x'

1
answer

How to get return of the amount of a word existing inside a .txt file? [duplicate]

I'm trying to get the number of low-level words (swear words) back in a text, using as base a different .txt file containing the words (profanity). The code I made only returns 1 (one) occurrence, and there are 3 (three). What could I do to im...
asked by 23.05.2018 / 00:12
0
answers

Connect MS SQL Azure with Python (RaspberryPi)

I'm having difficulty connecting to SQL in Raspberry Pi, using Python. I made this class: import pyodbc class MaximoNivel(object): def __init__(self, Ponto): self.Ponto = Ponto def Retorna(self): server = 'tcp:ser...
asked by 15.05.2018 / 18:59
1
answer

Matrix - Python

I'm doing a college job that requires me to play the Space Invaders game. I was able to make the matrix of the game and now I need to put the ships inside it, for now it is like this: Ineedtoprinttheshipssotheylooklikethis:VVVVVVVVNote:Iassign'...
asked by 18.05.2018 / 23:25
0
answers

How do I get my music player to choose an mp3 file and play it?

I'm Difficult to make the program choose music and play selected music from tkinter import * from tkinter import messagebox from tkinter.filedialog import askopenfilename from pygame import * from pygame import mixer jan = Tk() jan.title("JA...
asked by 18.05.2018 / 21:29
1
answer

Meta Class vs. Traditional Descriptor

I've been watching the videos ( example ) by Luciano Ramalho on descriptors with < in> metaclass . I wanted to know what the advantage of this model is over the more traditional implementation of descriptors as this example in the docum...
asked by 12.05.2018 / 17:14
1
answer

Scroll with Selenium in Python: Error

I have a list of items on the screen, in which I need to click one by one to parse data. It happens that, at a certain moment, Selenium can not click anymore, because when it tries, the following error happens: selenium.common.exceptions.WebDr...
asked by 10.05.2018 / 15:45
1
answer

Work with two cursors on the same connection

I need to read two tables in the database so I can compare them later, the code I made is giving error, because I'm passing two queries on the same connection how could I be correcting this? Thank you. import pyodbc conn = pyodbc.connect("DRIV...
asked by 02.05.2018 / 22:21
1
answer

How to display my index.html template in django restframework?

I have a problem with a test that I have to submit to a selective process that I am performing. I've tried every possible and imaginable way but I could not. When trying to call an index.html file that is inside a templates / api folder so that...
asked by 08.05.2018 / 11:37
1
answer

Python - Error in use of import, module - has no attribute

Hello, I'm writing the code for a university project, but when I try to import dependencies for some files, Error. I created some packages that have files that have dependencies, but they do not find those files. The project is all in gith...
asked by 05.05.2018 / 02:08
1
answer

Compare variables in Python

Hello, people! I am starting to learn python and I decided to do a voting program. How do I, for example, compare the results of the votes and print that there was a tie between two candidates? print('Votação') print('Candidatos: ') print('1-C...
asked by 04.05.2018 / 18:11