Questions tagged as 'python'

1
answer

How to start a Python code correctly

I'm still learning Python and once I saw a guy starting a Python code with something ____init___ , with a if ___init___ ... == True . I asked him why he started the code in such a way, he told me that was the right way. Anyway, fo...
asked by 21.04.2018 / 04:09
1
answer

Scraping parameters from a post method, with scrapy in python!

I need to collect information from a site using spiders within ScraPy in Python, however the site is a post method and I am learning the language while developing the project. I found a template for post but I'm not able to run it correctl...
asked by 07.05.2018 / 13:34
1
answer

Bubble Sort Algorithm in Python

def bubble_sort(lista): elementos = len(lista)-1 ordenado = False while not ordenado: ordenado = True for i in range(elementos): if lista[i] > lista[i+1]: lista[i], lista[i+1] = lista[i+1],lista[i] ordenado...
asked by 19.03.2018 / 14:58
2
answers

Problem with importing files into diferenter directories

I have a problem with using different files in different directories, this is the directory tree of my project: DeatHash ├── deathash │   ├── deathash.py │   ├── dictionaries │   │   ├── dictionary_test.txt │   │   └── dictionary.txt │   ├── f...
asked by 09.03.2018 / 22:40
1
answer

What is the correct way to do the template in Django / python?

This has been my first contact with the framework and with mvc / mvt, and I am in doubt, in terms of good practices and tals, should I make a template for each of the views or should I just make a template and change the template content dynamic...
asked by 16.03.2018 / 18:14
1
answer

Query with date in sql includes the day in question?

I have a question about the exact days that SQL includes, and my system once per day performs the following query on the system: SELECT id,nome FROM products WHERE created_date between \'"+last_date+"\' and \'" + now+"\' Where to...
asked by 22.02.2018 / 16:27
2
answers

Autocomplete does not always work on Pycharm

I'm starting to use Pycharm, creating a test with Pygame. I realize that some Pygame methods do not appear in Pycharm AutoComplete. For example, if I want to put a pygame.mask.from_surface() , typing pygame.mas will not do any...
asked by 14.06.2018 / 03:29
1
answer

Prime numbers in letters a-z A-Z in python

In this problem you should read a set of words, where each word is composed only of letters in the range a-z and A-Z. Each letter has a specific value, the letter a is worth 1, the letter b is worth 2, and so on up to the letter z, which is 26....
asked by 28.03.2018 / 03:22
2
answers

Changing a value with the pandas library

I am opening a .csv file with the pandas library, however I am informed at the time of opening this file that a particular column presents values of different types. I know the character "/" was used in this file to denote missing data, this is...
asked by 11.02.2018 / 15:52
1
answer

Python language format function in C #

int varvalor; int var01 = varvalor * 1; Console.Write("Digite um número para ser multiplicado: "); var01 = Convert.ToInt32 (Console.ReadLine()); Console.WriteLine(); I wanted to write in Console.WriteLine(); these lines of code that is...
asked by 13.02.2018 / 00:39