On 08/06/2008, at 13:46, Felipe Fonseca wrote:

2008/6/8 Fernando Henrique <[EMAIL PROTECTED]>:
Paciência é meu sobrenome, e serenidade é o nome do meio :)

<história antiga>
e o putômetro, vendeu?
</história antiga>

;)



O putometro agora é GPL, e ta em anexo X-D


#!/usr/bin/env python
""" PyPutometro 0.1 (GPL2) -- http://www.liquuid.net --

Usage : ./putometro.py <percentage of rage>
"""


import sys
import getopt

global width
width=80

def main():
    try:
        opts, args = getopt.getopt(sys.argv[1:], "h", ["help"])
    except getopt.error, msg:
	print msg
        print "for help use --help"
        sys.exit(2)
    for o, a in opts:
        if o in ("-h", "--help"):
            print __doc__
            sys.exit(0)
    for arg in args:
	draw(arg)

def gaugebar(per):
	if int(per)*int(width)/100 > int(width):
		per = 100
	decoration()
	string=''
        for i in range(int(per)*int(width)/100):
                string=string+'#'
	print string
	decoration()
	print

def decoration():
	string='<:='
	for i in range(width-6):
		string=string+'-'
	print string+'=:>'

def draw(per):
	print "putancy factor : "+per+"%"
	gaugebar(per)
	


if __name__ == "__main__":
    main()


--
// Random generator in debian systems
int random(){
        return 4;
}

http://www.liquuid.net

_______________________________________________
Lista de discussão da MetaReciclagem
Envie mensagens para [email protected]
http://lista.metareciclagem.org

Responder a