Questions tagged as 'python'

1
answer

Array always receiving the same value [Loop in two arrays simultaneously]

My program traverses an image and assigns the color values R, G, B to variables that were compared to matrices containing the R, G, B colors of asphalt and earth called auxAsfalto and auxTerra . The question is: when I run the i...
asked by 02.01.2019 / 13:44
2
answers

Data entry without echoing on the screen

entrada = input("digite a senha") If I use the input function, what the user types will be echoed on the screen. How to make sure nothing is shown on the screen?     
asked by 10.08.2016 / 17:36
1
answer

Equation of second degree in Python

The following code computes roots, vertices, and delta of second-degree equations. The code runs clean the first time, but when I loop it to restart it gives an error: Traceback (most recent call last): File "python", line 58, in <modu...
asked by 10.09.2016 / 19:07
3
answers

How to call external command with Python?

How can I call an external command in Python, as if it were executed in the Unix shell or at the Windows prompt?     
asked by 21.08.2014 / 17:50
1
answer

Doubt in string comparison and list value for all rows

I have a table of 5 rows and 5 columns. For each column I have a name, for example: Name, Age, Sex, Weight, Height. And all 5 * 5 cells are filled. I need the following formatting: Idade João - 15 José - 16 Maria - 21 Sexo João - M José -...
asked by 27.08.2014 / 16:24
1
answer

running split () to form a list within another list

I have the following list: [['a:/, b:/, w:/, g:/, f:/, d:/Downloads/Torrent/End, x:/files.2t, y:/files.1t'], ['d:/Dropbox/project/rato_bat'], ['data']] But I wanted it to be a list inside another list because I did this: for a in lldi...
asked by 26.07.2016 / 20:41
3
answers

How can I convert snake_case to camelCase (and vice versa) in Python?

How can I convert a string pythonic to snake_case in%% possible? Example: snake1 = 'minha_string_snake_case' # minhaStringSnakeCase snake2 = '_teste_string' # _TestString     
asked by 03.07.2015 / 13:53
1
answer

Organize list with more than one criterion in case of a tie

I'm using sorted to organize a list, however I need two criteria to organize it for tie cases, so I call sorted( ) twice. Can you do this organization by calling sorted( ) only once? Basically, the code is as follows: l...
asked by 01.07.2015 / 03:52
2
answers

How do I make a program written in python open with two clicks made an executable?

An example: #!/usr/bin/python3 # coding: utf-8 # window.py from gi.repository import Gtk class App(Gtk.Window): def __init__(self): super(Gtk.Window, self).__init__(title='Hello World') self.set_position(Gtk.WindowPositi...
asked by 19.01.2016 / 20:03
2
answers

How to make a request by sending cookie data?

I want to make a GET request for a given URL, but I want to send cookie data as a web browser does. For example, in the code below: from urllib import request req = request.Request('http://servidor/pagina.html') response = request....
asked by 05.02.2014 / 16:01