This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import socket | |
import string | |
import os | |
servidor="irc.freenode.net" | |
porta=6697 | |
nick="zeldani" | |
ident="zeldani" | |
realname="zeldani" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import smtplib | |
print "\n=============[ Zeldani's Mail ]=============\n" | |
destinatario = raw_input('\nDe:') | |
para = raw_input('\nPara: ') | |
mensagem = raw_input('\nMensagem: ') | |
usuario = '[email protected]' | |
senha = 'senha' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
url = raw_input("Site: ") | |
usock = urllib2.urlopen(url) | |
data = usock.read() | |
usock.close() | |
print data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import optparse | |
import sys | |
parser = optparse.OptionParser() | |
# O add_option adiciona uma opcao, o action='help' mostra as opcoes de ajuda. | |
parser.add_option('-?', action='help', help="Mostra a mensagem de ajuda.") | |
parser.add_option('--esse-eh-um-argumento-mtoooo-longooooooooo', metavar='algumacoisa', help='Exemplo de um argumento longo, que funciona numa boa nos manuais!!', action='help') | |
parser.add_option('-z', '--zeldani', help='Visite: zeldani.blogspot.com ;D', metavar='Zeldani', action='help') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import math | |
import sys | |
print "_________________________________________________" | |
print "Calculadora Simples de OHMs" | |
print "Criado por: zeldani.blogspot.com\n" | |
print " (___()'`; " | |
print " /, /` " | |
print " \\''--\\ Say hello to Tiby!\n " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python: | |
import thread | |
import time | |
def print_time (nomedothread, delay): | |
conta = 0 | |
while conta < 5: | |
time.sleep(delay) | |
conta += 1 | |
print "%s: %s" % (nomedothread, time.ctime(time.time()) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import threading | |
import time | |
logging.basicConfig(level=logging.DEBUG, | |
format='[%(levelname)s] (%(threadName)-10s) %(message)s', | |
) | |
def imagem(): | |
logging.debug('Iniciando') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Queue | |
class Tarefa(object): | |
def __init__(self, prioridade, descricao): | |
self.prioridade = prioridade | |
self.descricao = descricao | |
print 'Nova tarefa:', descricao | |
return | |
def __cmp__(self, outro): | |
return cmp(self.prioridade, outro.prioridade) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
import time | |
import sys | |
from threading import Thread | |
class testit(Thread): | |
def __init__ (self,ip): | |
Thread.__init__(self) | |
self.ip = ip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class matematica: | |
a = 2 | |
b = 5 | |
def conta(self, x): | |
return matematica.a*x+matematica.b | |
objeto = matematica() | |
print matematica.a | |
print matematica.b | |
print objeto.conta(3) |
OlderNewer