Advertisement
here2share

# Tk_remove_line_numbers.py

Oct 11th, 2016
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. # Tk_remove_line_numbers.py
  2.  
  3. import tempfile
  4. import webbrowser
  5. notepad=tempfile.mktemp(".txt", "_pytemp_")
  6.  
  7. chk=['exec','open','eval']
  8. if any(X in zzz for X in chk):
  9.     print "!!!!! CAUTION !!!!"
  10. zzz=zzz.replace('tkinter','Tkinter')
  11. zzz=zzz.replace('    ','    ')
  12. ccc=1
  13.  
  14. ppp=[]
  15. for z in zzz.splitlines():
  16.     s=str(ccc)
  17.     if s in z:
  18.         z=z[z.index(s)+len(s)+1:]
  19.         ppp.append(z)
  20.         ccc+=1
  21.  
  22. temp=open(notepad, 'w')
  23. zzz='\n'.join(ppp)
  24. temp.write(zzz)
  25. temp.close()
  26. webbrowser.open(notepad)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement