Questions tagged as 'python-3.x'

1
answer

Requests, BeautifulSoup Tables

I have a website that I want to extract specific data from a table Iwanttoextractalltheinformationthathas"PROLONG" element. My difficulty is that all tables have the same name in the "class" class="field". how do I extract the data related t...
asked by 10.05.2018 / 01:21
1
answer

How to play a background audio?

I'm doing a python program that runs within an infinite loop .. Under certain conditions I need to play an audio, but I can not wait for the audio to finish to continue the process. I thought of something async, that is, while I'm running the...
asked by 31.05.2018 / 23:41
2
answers

how to compile a python script in an executable

What is the best way to compile a python script for an executable running on a linux (ubuntu), windows, and mac operating system.     
asked by 01.06.2018 / 03:48
1
answer

How to separate each element from a list, with a String, on a line

The problem is simple, I'd like to add an element to a real-time generated list for each given iteration. For example, if list 1 is generated through [x for x in range(10) if x%2==0] , then I want the 'a' character to appear between each e...
asked by 03.06.2018 / 20:32
4
answers

Identify missing value in numerical sequence

There is a set of cards numbered from 1 to N. Within this set a card was lost, determine the number of the lost card based on the remaining cards. Given an N number, followed by N-1 integer values representing the numbers of the remaining car...
asked by 16.05.2018 / 22:15
1
answer

How to hide a Widget?

I need to know some way that by clicking on Button "hide" a widget (a Label for example) from my window, being possible to use it later; Using place on the widget that I wish to "hide" (Yes, it NEEDS to be .place ). OBS:...
asked by 21.09.2018 / 22:08
1
answer

Python string corrupted with character \

I have a program that creates another program on the user's computer. In a snippet, I define the directory to which the new program will be destined as diret = "C:\Users\" + d_user where d_user is the rest of the directory. However when it...
asked by 11.04.2018 / 02:49
1
answer

Python import file from variable

If I define a variable as the directory from which I will import a file, such as: a = 'C:\Users\Windows 7\Desktop\Program10.py If I try to from a import foo , I'm given ModuleNotFoundError: No module named 'a'. In context,...
asked by 12.04.2018 / 14:09
1
answer

Displaying full Fractions result

I'm generating number simplifications through the Fractions package. All right until you find numbers where the simplification goes to the maximum, ie reducing one of the terms to "1". When this happens, the program skips this value, displ...
asked by 27.02.2018 / 02:44
1
answer

Tkinter function being executed even without clicking the button

Here is my code: from tkinter import * from tkinter import messagebox def add(a, b): messagebox.showinfo("Resultado", a.get()+b.get()) win=Tk() win.geometry('300x200') a=StringVar() b=StringVar() in1=Entry(win, textvariable=a) in2=Entry(wi...
asked by 13.02.2018 / 18:18