Questions tagged as 'python'

0
answers

How to read .csv file and use as list in Python

I need Python to read a CSV file and use the data in it as a list. Sample CSV data francisco, carlos, melo, luis, claudia, I need to read Python after reading this data as follows: lista = (['francisco','carlos','melo','luis','claudia'...
asked by 16.03.2018 / 01:34
2
answers

problem UnboundLocalError: local variable 'num' referenced before assignment

def fnum_aleatorio(a, b, m, semente=None): if semente != None: num=semente num_aleatorio = (num*a+b)%m if num_aleatorio <= a//2: return 0 else: return 1 I'm trying to do a function that has a final...
asked by 24.03.2018 / 20:13
0
answers

Is there a pro pycharm library that can handle gpu?

In case I wanted to process a calculation using my gpu, however, I did not find anything. Would I have another way? I'm doing a mining in python and I want to use my gpu to perform the calculation. Preferably a library that works with AMD     
asked by 24.03.2018 / 16:51
1
answer

What is the function of "use_aliases = True" in emoji.emojize?

I'm following a Python course and explained how to import libraries and such, and to use this library (as an example) was said to use this command print(emoji.emojize('Python is :thumbsup:', use_aliases=True)) But I did not understand thi...
asked by 28.03.2018 / 19:23
1
answer

Redirect Http to Https - Nginx with let's encrypt

Currently, the domino link is working, but can not redirect link to Link using let's encrypt . I am following this tutorial: Link Below my setting: server { listen 80; listen 443 ssl; server_name meudominio.com www.m...
asked by 21.03.2018 / 14:30
0
answers

Fields not required with PUT in rest framework

In my api built with rest_framework (python) I can perform the update of a record however I have to pass all fields that this record has for example if I want to update only the email with record 1 I have to inform all fields in the reque...
asked by 15.03.2018 / 17:12
0
answers

Get the html code of a certain class in django

I have some classes, among them the following: class Processo(models.Model): TIPO_PROCESSO = ( ('NORMAL', 'NORMAL'), ('TRANSMUTACAO', 'TRANSMUTACAO'), ('2a VIA', '2a VIA'), ) usuario = models.ForeignKey(User, blank=True) processo =...
asked by 13.03.2018 / 02:59
1
answer

python: Wait for keyboard event with minimized script?

I wonder if there is a way to detect events on the keyboard with my minimized script. I have tried several methods like msvcrt.getch() , input("") and others but they only work with the focus in the script window. The program...
asked by 15.03.2018 / 14:57
0
answers

OpenCV '' Circular buffer overrun '' Stream UDP

I'm trying to capture a video and run it in an OpenCV code, but after a few seconds the video hangs and this error appears: [udp @ 0x1a2d020] Circular buffer overrun. To avoid, increase fifo_size URL option. To survive in such case, use overru...
asked by 11.03.2018 / 20:44
1
answer

Lines break in txt file - Python

I have a file that selects the main words cited in the code I have prepared. But at the time of sending to my .txt file it loses the line break that would be most important for this document. Code: f = open(r"C:\Users\guilgig\Desktop...
asked by 20.03.2018 / 20:31