How can I create a command line tool in Python that works like ls of Linux or dir of Windows?
How would I start a script like the one that will later be compiled as an executable?
I am writing a program that receives a specific amount of values, and returns the lowest value in the list and its position. It is as follows:
quantidade = int(raw_input())
numeros = raw_input()
NumerosNaLista = numeros.split()
if len(NumerosN...
How do you create methods of type dot notation, those that are called object.show () instead of show ( objec ) , or do they apply only to strings, if so why exactly?
I'm starting to program in python and I've been trying to use best practices: virtualenv, pip, etc.
One of the packages I have used (pelican) has different help pages for each version. How do I know which version I am using?
I installed it with...
How can I use list comprehension for this case:
>>> a = 'A'
>>> lista = [1, 2, 8, 5, 10]
>>> l = [a, num for num in lista if num%2 == 0]
File "<stdin>", line 1
l = [a, num for num in lista if num%2 == 0...
In codeacademy, I'm having the error with the following code:
# Tenha certeza que the_flying_circus() retorna True
def the_flying_circus():
if 5==5 : # Comece seu codigo aqui!
return True
# Nao esqueca de recuar
# o...
The client:
from socket import *
serverHost = 'localhost'
serverPort = 50007
# Menssagem a ser mandada codificada em bytes
menssagem = [b'Ola mundo da internet!']
# Criamos o socket e o conectamos ao servidor
sockobj = socket(AF_INET, SOCK...
I have the following problem: I am trying to fill in the fields
public place, city and state with the informed zip.
They are all input.
I'm using link
My project is in Django, but I think you can return the data directly on the html page (fron...
I have the following strings:
"The.Office.US.S {SE} AND {EP} .The.Dundies.720p.srt"
"The Office [{SE}. {EP}] The Fight.srt"
This string is a template of the name of a file, the files will be in the following form
"The.Offi...
I would like to ask the user to type something and find out what type of what he wrote. So far I only know input() , but input() only returns String type. If I by int(input()) or float(input()) fall into the sam...