Skip to content

Instantly share code, notes, and snippets.

@gceylan
Created June 7, 2011 13:49
Show Gist options
  • Save gceylan/1012292 to your computer and use it in GitHub Desktop.
Save gceylan/1012292 to your computer and use it in GitHub Desktop.
sıraya göre isim vererek boş .py uzantısı oluşturmaya yarayan program
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from Tkinter import *
import os
pencere = Tk()
pencere.geometry("200x75+75+50")
pencere.title("Gökhan CEYLAN")
def py_olustur():
for i in range(0, 100):
isim = 'betik' + str(i) + '.py'
if isim not in os.listdir(os.getcwd()):
isim = isim
break
olustur = os.system('touch ' + isim)
dosya = open(isim, 'w')
dosya.write("#!/usr/bin/env python\n#-*- coding: utf-8 -*-")
dosya.close()
dugme_1 = Button(text="py uzantılısı oluştur", command=py_olustur)
dugme_1.place(relx=0.0, rely=0.1, relwidth=1)
dugme_2 = Button(text="çıkış", command=pencere.destroy)
dugme_2.place(relx=0.0, rely=0.5, relwidth=1)
mainloop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment