Advertisement
mateon1

Random functions...

May 26th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.97 KB | None | 0 0
  1. import time
  2.  
  3. def weirdprint(mess,slp):
  4.     n=0
  5.     cons=78
  6.     nmode=1
  7.     while True:
  8.         if n<0:
  9.             nmode=1
  10.             n+=1
  11.         if nmode:
  12.             n+=1
  13.         else:
  14.             n-=1
  15.         if n>cons-len(mess):
  16.             nmode=0
  17.             n-=1
  18.         print " "*n+mess+" "*(cons-n-len(mess))+"\r",
  19.         time.sleep(slp)
  20.        
  21. def leetize(string,leetz=("etiolsazbg","3710154289"),shorts={
  22.     "you":"U","You":"U","YOU":"U",
  23.     "too":"2","Too":"2","TOO":"2",
  24.     "to":"2","To":"2","TO":"2",
  25.     "are":"R","Are":"R","ARE":"R",
  26.     "awesome":"awsum","Awesome":"Awsum","AWESOME":"AWSUM",
  27.     "for":"4","For":"4","FOR":"4",
  28.     "at":"@","At":"@","AT":"@",
  29.     "laugh":"lol","Laugh":"lol","LAUGH":"LOL",
  30.     }):
  31.     res=""
  32.     for i in shorts:
  33.         string=string.replace(i,shorts[i])
  34.     for i in string:
  35.         if i.lower() in leetz[0]:
  36.             res+=leetz[1][leetz[0].index(i.lower())]
  37.         else:res+=i
  38.     return res
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement