Hola, soy nuevo aquí y también nuevo en python, después de leer un rato me decidí a codear este script en python
> funciones
* generar clave segura entre 12 a 18 caracteres.
* generar un archivo *.txt con la password, el nombre del archivo y el comentario son asignados por el usuario.
El *.txt se genera en la mismo directorio donde se esta ejecutando el script.
#!/usr/bin/env python
#-*-encoding: utf-8 -*-
import random, re, os
from random import choice
def main():
"presentation tool"
#os.system('title PX2 Generator V 1.0')
os.system('clear')
#os.system('cls')
print "\n************************************************************ "
print "* Name : PX2 Generator * " # PX2 Generator (Paja Password Generator)
print "* Version : 1.0 * "
print "* Code by : _4L3 * "
print "* Website : http://zonadebit.blogspot.com * "
print "* E-mail : [email protected] * "
print "* License : Creative Commons BY - NC - SA * " # licencia CC: Reconocimiento - No Comercial - Compartir Igual 3.0
print "************************************************************ \n"
def Generator_Password():
"random password generator"
Password = ''
for i in range(3):
Aleatory1 = random.choice ('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
Aleatory2 = random.choice ('|@#_$%-&(>)=?¿/¡!\.,<[]{}^')
Aleatory3 = random.choice ('abcdefghijklmnopqrstuvwxyz')
Aleatory4 = str(random.choice(range(200)))
Password = Password + (Aleatory1 + Aleatory2 + Aleatory3 + Aleatory4)
print chr(27)+"[1;37m","[+]",chr(27)+"[0;37m","Your password has",len(Password),"characters :",chr(27)+"[1;32m",Password, chr(27)+"[0m", "\n\n"
#print " [+] Your password has",len(Password),"characters : ",Password,"\n\n"
Option(Password)
def Option(Password):
option=raw_input(" > In accordance ? if you're not in accordance generates a new password Y/N : ")
if option=='yes' or option=='Yes' or option=='YES' or option=='y' or option=='Y':
Generator_Password()
elif option=='not' or option=='Not' or option=='NOT' or option=='n' or option=='N':
Build_File(Password)
else:
Option(Password)
def Build_File(Password):
File_name = raw_input("\n > Writes the file name : ")
if re.search("[^A-Za-z0-9_ ]",File_name) or File_name == '' :
print"\n > Not accept empty spaces and special characters, only numbers and letters. \n"
Build_File(Password)
else:
File_name = File_name + ".txt"
Comment= raw_input("\n > Comment : ")
try:
Lines = [Comment+"\n\n", "[+] Your password : "+Password]
Archive = open(File_name, "w")
Archive.writelines(Lines)
except IOError, e:
print"Your error is : ",e
exit()
finally:
Archive.close()
raw_input("\n > Thanks for using PX2-Generator, Press the [Enter] key to exit\n")
main()
Generator_Password()
*.exe para windows > http://www.mediafire.com/?ujq4vo6db57bn73 (http://www.mediafire.com/?ujq4vo6db57bn73)
*.py para Gnu/linux > http://www.mediafire.com/?2w3t7oa8vl41o2y (http://www.mediafire.com/?2w3t7oa8vl41o2y)
saludos a esta gran comunidad ;)
Nice, también está el Py2Exe
Aunque nunca he usado algo así...
Py2Exe, exacto man yo escribí el setup.py, luego en la terminal de windows escribí el siguiente comando
>python setup.py py2exe
y listo obtuve mi ejecutable saludos ;D