Questions tagged as 'python'

3
answers

What is with in Python?

I'm giving a study on Python and I came across this with . I know it from javascript, but I do not know how it works on Python Most of the examples I've seen show it being used in reading files. Example: with open(...
asked by 03.02.2015 / 15:57
0
answers

Python, Selenium and PhantomJs

I'm using Selenium with Python and PhantomJS. I want to click a button of the youtube page, but it always gives an error. Can someone help me?     
asked by 29.04.2017 / 15:04
0
answers

Problems generating executable

I've never seen the need to generate an .EXE file, because my programs were tested on my own machine, but now I need to generate an EXE to test on other computers. In my program I have imported the following libraries: from pygame import m...
asked by 11.05.2017 / 20:21
1
answer

TelnetLib does not properly close the socket

I'm developing a script in python that sends sms using a telnet connection to a portech mv-372. The script works correctly but after some time the telnet connection drops and throws an "[Errno 32] Broken pipe" exception. As the script is runn...
asked by 09.05.2017 / 15:35
1
answer

Create new DF based on a Pandas column

I'm new to Python and Pandas I have a DF that with 3 columns, as in the example below: SRC Data1 Data2 AAA 180 122 BBB 168 121 CCC 165 147 DDD 140 156 EEE 152 103 AAA 170 100 CCC 166...
asked by 09.05.2017 / 22:50
1
answer

2 types of products in the same view

How can I list 2 product types in index (Pizzas and Drinks) by defining an order by and dividing% divs of the pizzas), follow what I have: class IndexListView(ListView): model = Product template_name = 'inicio.html' con...
asked by 21.04.2017 / 17:37
1
answer

Print dictionary using matplotlib

Hello, I have a dictionary of type: and I would like to print a line chart with the key k as x and v as y. I tried a number of things but kept getting errors: plt.plot(lr.keys(),lr.values()) plt.title('ID modelo:'+str(Index)+' model accu...
asked by 15.04.2017 / 22:54
2
answers

how to make time appear in the window (label)?

I have the following code for a "timer", but it does not appear in the window, just in the Python 3.6 console. How do I get it printed in the window? (note: the window only opens when the preset time ends) from tkinter import* from datetime im...
asked by 07.05.2017 / 01:39
0
answers

NIM Game - PYTHON

My question was not so clear from the last time, so I decided to re-read it here, and I think I know where I'm going wrong, but I do not know what I'm missing. In the question says:    "You should write a program in the Python language, ve...
asked by 13.04.2017 / 22:09
1
answer

"missing scheme" error using Scrapy

When I run my spider, the scrapy returns the following error:    ValueError: Missing scheme in request url h import scrapy class QuotesSpider(scrapy.Spider): name = "Mineracao" def start_requests(self): link = "ht...
asked by 06.05.2017 / 21:04