示例#1
0
    def __init__(self):
        master = tk.Tk()

        self.canvas_width = 300
        self.canvas_height = 300
        self.w = tk.Canvas(master, width=self.canvas_width, height=self.canvas_height)
        self.w.pack()
def gui():
    # Make Message
    pymsgbox.alert('Welcome To My App', 'SahandM96')
    win = tk.Tk()
    win.title("Excel to Contact")
    aLabel = ttk.Label(win, text="Open Excel File :")
    aLabel.grid(column=0, row=0)
    # aLabel =ttk.Label(win,text="Convert CSV to VCF")
    # aLabel.grid(column=0,row=1)
    action = ttk.Button(win, text="Convert", command=openfile)
    action.grid(column=1, row=0)
    # action=ttk.Button(win,text="Convert",command=CSV2VCF)
    # action.grid(column=1,row=1)
    win.mainloop()
示例#3
0
文件: view.py 项目: johnwin/nvpy
    def _create_ui(self):

        # these two variables determine the final dimensions of our interface
        #FRAME_HEIGHT=400
        TEXT_WIDTH = 80

        self.root = tk.Tk()
        self.root.title("nvPY")
        #self.root.configure(background="#b2b2b2")

        # with iconphoto we have to use gif, also on windows
        icon_fn = 'nvpy.gif'

        iconpath = os.path.join(self.config.app_dir, 'icons', icon_fn)

        self.icon = tk.PhotoImage(file=iconpath)
        self.root.tk.call('wm', 'iconphoto', self.root._w, self.icon)

        # create menu ###################################################
        self._create_menu()

        # separator after menu ##########################################
        #separator = tk.Frame(self.root, height=2, bd=1, relief=tk.SUNKEN)
        #separator.pack(fill=tk.X, padx=5, pady=2, side=tk.TOP)

        # setup statusbar ###############################################
        # first pack this before panedwindow, else behaviour is unexpected
        # during sash moving and resizing
        self.statusbar = StatusBar(self.root)
        self.statusbar.set_status('%s', 'Welcome to nvPY!')
        self.statusbar.pack(fill=tk.X, side=tk.BOTTOM)

        search_frame = tk.Frame(self.root)

        search_entry.make_style()
        self.search_entry_var = tk.StringVar()
        #self.search_entry = tk.Entry(search_frame, textvariable=self.search_entry_var, style="Search.entry")
        self.search_entry = TriggeredcompleteEntry(
            search_frame,
            self.config.case_sensitive,
            textvariable=self.search_entry_var,
            style="Search.entry")
        #self.search_entry.set_completion_list(self.taglist)
        self.search_entry_var.trace('w', self.handler_search_entry)
        self.search_entry.pack(fill=tk.X, padx=5, pady=5)
        search_frame.pack(side=tk.TOP, fill=tk.X)

        # the paned window ##############################################
        paned_window = tk.PanedWindow(self.root, orient=tk.HORIZONTAL)
        paned_window.pack(fill=tk.BOTH, expand=1)

        left_frame = tk.Frame(paned_window, width=100)
        paned_window.add(left_frame)

        self.notes_list = NotesList(left_frame, self.config.list_font_family,
                                    self.config.list_font_size,
                                    self.config.background_color)
        self.notes_list.pack(fill=tk.BOTH, expand=1)

        right_frame = tk.Frame(paned_window, width=400)
        paned_window.add(right_frame)

        note_meta_frame = tk.Frame(right_frame)
        note_meta_frame.pack(side=tk.BOTTOM, fill=tk.X)

        pinned_label = tk.Label(note_meta_frame, text="Pinned")
        pinned_label.pack(side=tk.LEFT)
        self.pinned_checkbutton_var = tk.IntVar()
        pinned_checkbutton = tk.Checkbutton(
            note_meta_frame, variable=self.pinned_checkbutton_var)
        pinned_checkbutton.pack(side=tk.LEFT)

        tags_label = tk.Label(note_meta_frame, text="Tags")
        tags_label.pack(side=tk.LEFT)
        self.tags_entry_var = tk.StringVar()
        self.tags_entry = tk.Entry(note_meta_frame,
                                   textvariable=self.tags_entry_var)
        self.tags_entry.pack(side=tk.LEFT, fill=tk.X, expand=1, pady=3, padx=3)

        # we'll use this method to create the different edit boxes
        def create_scrolled_text(master):
            yscrollbar = tk.Scrollbar(master)
            yscrollbar.pack(side=tk.RIGHT, fill=tk.Y)

            #f = tkFont.nametofont('TkFixedFont')
            f = tkFont.Font(family=self.config.font_family,
                            size=-self.config.font_size)
            # tkFont.families(root) returns list of available font family names
            # this determines the width of the complete interface (yes)
            text = RedirectedText(master,
                                  height=25,
                                  width=TEXT_WIDTH,
                                  wrap=tk.WORD,
                                  font=f,
                                  tabs=(4 * f.measure(0), 'left'),
                                  tabstyle='wordprocessor',
                                  yscrollcommand=yscrollbar.set,
                                  undo=True,
                                  background=self.config.background_color)
            # change default font at runtime with:
            text.config(font=f)

            text.pack(fill=tk.BOTH, expand=1)

            #xscrollbar.config(command=text.xview)
            yscrollbar.config(command=text.yview)

            return text

        # setup user_text ###############################################
        self.text_note = create_scrolled_text(right_frame)

        # finish UI creation ###########################################

        # now set the minsize so that things can not disappear
        self.root.minsize(self.root.winfo_width(), self.root.winfo_height())

        # call update so we know that sizes are up to date
        self.root.update_idletasks()
示例#4
0
        print(script_full_path)
    else:
        z = filedialog.askdirectory(initialdir="~", title="Select folder")
        db_save_path = z
        print(db_save_path)

    a[m].delete(0, END)
    a[m].insert(tk.END, z)


###################################################################################

if __name__ == "__main__":

    # global section
    root = tk.Tk()
    root.title("Script2DB")
    root.geometry("700x500")
    # root.resizable(False, False)

    script_full_path = ""  #/home/shin/project/csv2db/csv/temp.csv
    db_save_path = ""  #/home/shin/project/csv2db/db

    ############################################################################

    a = [None for i in range(0, 2)]

    Label = ttk.Label(root, text="선택 파일",
                      background="white").grid(row=1,
                                               column=0,
                                               columnspan=3,
示例#5
0
def minesweeper():

    #  window configuration
    global win
    win = tk.Tk()
    win.resizable(False, False)
    win.minsize(500, 500)
    win.title('minesweeper')
    win.configure(bg='gray83')

    game_photo = tk.PhotoImage(file='download.png')  # icon for game
    win.iconphoto(True, game_photo)

    ###############################################################
    # -------------------first page : welcom page ----------------#
    ###############################################################
    global welcom_page_photo
    welcom_page_photo = tk.Label(win,
                                 compound=tk.CENTER,
                                 image=game_photo,
                                 background='gray83')
    welcom_page_photo.image = game_photo
    welcom_page_photo.config(font=("mitra", 25), foreground='darkorange')
    welcom_page_photo.place(x=150, y=200)
    welcom_page_photo.bind('<Button>', lambda _: level_of_game())

    global welcom_page_label
    welcom_page_label = tk.Label(win, text='minesweeper', background='gray83')
    welcom_page_label.config(font=("mitra", 25))
    welcom_page_label.place(x=150, y=100)
    welcom_page_label.bind('<Button>', lambda _: level_of_game())

    pygame.mixer.init()  # music of game
    pygame.mixer.music.load('1.mp3')
    pygame.mixer.music.play(loops=120)

    ###############################################################
    # -------------------------variation--------------------------#
    ###############################################################
    global worn_label
    worn_label = tk.Label(win)
    worn_label.place(x=700, y=700)

    global bomb
    bomb = 0
    global logo_photo1
    logo1 = tk.PhotoImage(file='download-Copy.png')
    logo_photo1 = tk.Label(win, image=logo1, background='gray83')
    logo_photo1.image = logo1

    global board_frame
    board_frame = tk.Frame(win)
    board_frame.config(highlightbackground="gray83",
                       relief="ridge",
                       highlightcolor='gray25',
                       highlightthickness=6)

    global board_frame1
    board_frame1 = tk.Frame(win)
    board_frame1.config(highlightbackground="gray77",
                        relief="ridge",
                        highlightcolor='gray77',
                        highlightthickness=8)

    global files
    global sound_photo1
    files = 'download111.png'
    sound1 = tk.PhotoImage(file=files)
    sound_photo1 = tk.Label(board_frame1,
                            image=sound1,
                            background='gray83',
                            relief="flat")
    sound_photo1.image = sound1
    sound_photo1.bind('<Double-Button>', lambda _: sound())

    global home_photo1
    home1 = tk.PhotoImage(file='download333.png')
    home_photo1 = tk.Label(board_frame1,
                           image=home1,
                           relief="flat",
                           background='gray83')
    home_photo1.image = home1
    home_photo1.bind('<Double-Button>', lambda _: home())

    global reset_btn
    reset = tk.PhotoImage(file='download444.png')
    reset_btn = tk.Label(board_frame1,
                         image=reset,
                         relief="flat",
                         background='gray83')
    reset_btn.image = reset
    reset_btn.bind('<Double-Button>', lambda _: game_page())
示例#6
0
import errno

class PEP8_CodeChecker:
	
	def __init__(self):
		import numbers
	    self.thread_pool = cf.ThreadPoolExecutorasmdasdhnasdhash(multiprocessing.cpu_count())
		self.initial_dir="./"
        self.random = [2+2 ,3, 5]
		self.random[2]
		self.x= 2
		self.x +=5
		self.x+=2
		self.x+= 7
		print("Start parsing!", ([1 ,2] ,3))
		self.window =tk.Tk()
		self.window.geometry("640x480")
		self.window.resizable(False, False)
		self.window.title("PEP8 Code Check")
		self.btn_select_dir = tk.Button(self.window,
										text="Select",
										command=self.select_dir)
		self.btn_select_dir.configure(height=1, width=12)
		self.btn_select_dir.place(x=450, y=47)
		self.btn_start = tk.Button(self.window, text = "Start", command= self.start_parsing)
		self.btn_start.place(x=210, y=320)
		self.btn_start.configure(height=5, width=30)
		self.entry_path = tk.Entry(self.window)
		self.entry_path.insert(12, "Select,path")
		self.entry_path.place(x=75,y=50)
		self.entry_path.configure(width=60)
示例#7
0
    def _create_ui(self):

        # these two variables determine the final dimensions of our interface
        #FRAME_HEIGHT=400
        TEXT_WIDTH=80
        
        self.root = tk.Tk()
        self.root.title("nvPY")
        #self.root.configure(background="#b2b2b2")

        # with iconphoto we have to use gif, also on windows
        icon_fn = 'nvpy.gif'

        iconpath = os.path.join(
            self.config.app_dir, 'icons', icon_fn)

        self.icon = tk.PhotoImage(file=iconpath)
        self.root.tk.call('wm', 'iconphoto', self.root._w, self.icon)

        # create menu ###################################################
        self._create_menu()

        # separator after menu ##########################################
        #separator = tk.Frame(self.root, height=2, bd=1, relief=tk.SUNKEN)
        #separator.pack(fill=tk.X, padx=5, pady=2, side=tk.TOP)

        # setup statusbar ###############################################
        # first pack this before panedwindow, else behaviour is unexpected
        # during sash moving and resizing
        self.statusbar = StatusBar(self.root)
        self.statusbar.set_status('%s', 'Welcome to nvPY!')
        self.statusbar.pack(fill=tk.X, side=tk.BOTTOM)

        search_frame = tk.Frame(self.root)
        
        search_entry.make_style()
        self.search_entry_var = tk.StringVar()
        self.search_entry = tk.Entry(search_frame, textvariable=self.search_entry_var, style="Search.entry")
        self.search_entry_var.trace('w', self.handler_search_entry)
        self.search_entry.pack(fill=tk.X,padx=5, pady=5)
        search_frame.pack(side=tk.TOP, fill=tk.X)
        
        
        # the paned window ##############################################
        paned_window = tk.PanedWindow(self.root, orient=tk.HORIZONTAL)
        paned_window.pack(fill=tk.BOTH, expand=1)
        
        left_frame = tk.Frame(paned_window, width=100)
        paned_window.add(left_frame)
       
        # setup the scrollbar
        self.sb_notes = tk.Scrollbar(left_frame, orient=tk.VERTICAL)
        
        # exportselection=0 means it doesn't automatically export to
        # x selection. with that active, selecting in the text widget
        # removes selection in listbox.
        # thank you http://stackoverflow.com/a/756875
        self.lb_notes = tk.Listbox(left_frame, exportselection=0,
                                   yscrollcommand=self.sb_notes.set)
        
        self.sb_notes.config(command=self.lb_notes.yview)
        self.sb_notes.pack(side=tk.RIGHT, fill=tk.Y)
        
        # need both fill and expand to make it fill all avail area
        self.lb_notes.pack(fill=tk.BOTH, expand=1)

        right_frame = tk.Frame(paned_window, width=400)
        paned_window.add(right_frame)

        # we'll use this method to create the different edit boxes
        def create_scrolled_text(master):
            yscrollbar = tk.Scrollbar(master)
            yscrollbar.pack(side=tk.RIGHT, fill=tk.Y)

            #f = tkFont.nametofont('TkFixedFont')
            f = tkFont.Font(family=self.config.font_family, size=-self.config.font_size)
            # tkFont.families(root) returns list of available font family names
            # this determines the width of the complete interface (yes)
            text = RedirectedText(master, height=25, width=TEXT_WIDTH,
                                  wrap=tk.WORD,
                                  font=f, tabs=(4 * f.measure(0), 'left'), tabstyle='wordprocessor',
                                  yscrollcommand=yscrollbar.set,
                                  undo=True)
            # change default font at runtime with:
            text.config(font=f)

            text.pack(fill=tk.BOTH, expand=1)

            #xscrollbar.config(command=text.xview)
            yscrollbar.config(command=text.yview)

            return text


        # setup user_text ###############################################
        self.text_note = create_scrolled_text(right_frame)

#        def cb_ut_fi(event):
#            self.set_current_text(CURTEXT_USER)
#
#        self.user_text.bind('<FocusIn>', cb_ut_fi)
#
#        def cb_ut_m(event):
#            self.set_user_mode(MODE_MODIFIED)
#
#        self.user_text.bind('<<Change>>', cb_ut_m)
#
#        # setup sys_text ################################################
#        self.sys_text, self._sys_mode_label_var = \
#                      create_scrolled_text(bottom_frame, "System Environment")
#
#        def cb_st_fi(event):
#            self.set_current_text(CURTEXT_SYS)
#
#        self.sys_text.bind('<FocusIn>', cb_st_fi)
#
#        def cb_st_c(event):
#            self.set_sys_mode(MODE_MODIFIED)
#            
#        self.sys_text.bind('<<Change>>', cb_st_c)

        # finish UI creation ###########################################

        # now set the minsize so that things can not disappear
        self.root.minsize(self.root.winfo_width(), self.root.winfo_height())
        
        # call update so we know that sizes are up to date
        self.root.update_idletasks()
示例#8
0
    def __init__(self, width=500, height=300):
        self.w = width
        self.h = height
        self.title = ' VIP视频破解助手'
        self.root = tk.Tk(className=self.title)
        self.url = tk.StringVar()
        self.v = tk.IntVar()
        self.v.set(1)

        #Frame空间
        frame_1 = tk.Frame(self.root)
        frame_2 = tk.Frame(self.root)
        frame_3 = tk.Frame(self.root)

        #Menu菜单
        menu = tk.Menu(self.root)
        self.root.config(menu=menu)
        filemenu = tk.Menu(menu, tearoff=0)
        moviemenu = tk.Menu(menu, tearoff=0)
        menu.add_cascade(label='菜单', menu=filemenu)
        menu.add_cascade(label='友情链接', menu=moviemenu)
        filemenu.add_command(
            label='使用说明',
            command=lambda: webbrowser.open(
                'http://blog.csdn.net/c406495762/article/details/71334633'))
        filemenu.add_command(
            label='关于作者',
            command=lambda: webbrowser.open('http://blog.csdn.net/c406495762'))
        filemenu.add_command(label='退出', command=self.root.quit)

        #各个网站链接
        moviemenu.add_command(
            label='网易公开课',
            command=lambda: webbrowser.open('http://open.163.com/'))
        moviemenu.add_command(
            label='腾讯视频', command=lambda: webbrowser.open('http://v.qq.com/'))
        moviemenu.add_command(
            label='搜狐视频',
            command=lambda: webbrowser.open('http://tv.sohu.com/'))
        moviemenu.add_command(
            label='芒果TV',
            command=lambda: webbrowser.open('http://www.mgtv.com/'))
        moviemenu.add_command(
            label='爱奇艺',
            command=lambda: webbrowser.open('http://www.iqiyi.com/'))
        moviemenu.add_command(
            label='PPTV',
            command=lambda: webbrowser.open('http://www.bilibili.com/'))
        moviemenu.add_command(
            label='优酷',
            command=lambda: webbrowser.open('http://www.youku.com/'))
        moviemenu.add_command(
            label='乐视', command=lambda: webbrowser.open('http://www.le.com/'))
        moviemenu.add_command(
            label='土豆',
            command=lambda: webbrowser.open('http://www.tudou.com/'))
        moviemenu.add_command(
            label='A站',
            command=lambda: webbrowser.open('http://www.acfun.tv/'))
        moviemenu.add_command(
            label='B站',
            command=lambda: webbrowser.open('http://www.bilibili.com/'))

        #控件内容设置
        group = tk.Label(frame_1, text='请选择一个视频播放通道:', padx=10, pady=10)
        tb1 = tk.Radiobutton(frame_1,
                             text='通道一',
                             variable=self.v,
                             value=1,
                             width=10,
                             height=3)
        tb2 = tk.Radiobutton(frame_1,
                             text='通道二',
                             variable=self.v,
                             value=2,
                             width=10,
                             height=3)
        label1 = tk.Label(frame_2, text="请输入视频链接:")
        entry = tk.Entry(frame_2,
                         textvariable=self.url,
                         highlightcolor='Fuchsia',
                         highlightthickness=1,
                         width=35)
        label2 = tk.Label(frame_2, text=" ")
        play = tk.Button(frame_2,
                         text="播放",
                         font=('楷体', 12),
                         fg='Purple',
                         width=2,
                         height=1,
                         command=self.video_play)
        label3 = tk.Label(frame_2, text=" ")
        # download = tk.Button(frame_2, text = "下载", font = ('楷体',12), fg = 'Purple', width = 2, height = 1, command = self.download_wmxz)
        QR_Code = tk.Button(frame_3,
                            text="手机观看",
                            font=('楷体', 12),
                            fg='Purple',
                            width=10,
                            height=2,
                            command=self.QR_Code)
        label_explain = tk.Label(
            frame_3,
            fg='red',
            font=('楷体', 12),
            text='\n注意:支持大部分主流视频网站的视频播放!\n此软件仅用于交流学习,请勿用于任何商业用途!')
        label_warning = tk.Label(frame_3,
                                 fg='blue',
                                 font=('楷体', 12),
                                 text='\n建议:将Chrome内核浏览器设置为默认浏览器\n作者:Jack_Cui')

        #控件布局
        frame_1.pack()
        frame_2.pack()
        frame_3.pack()
        group.grid(row=0, column=0)
        tb1.grid(row=0, column=1)
        tb2.grid(row=0, column=2)
        label1.grid(row=0, column=0)
        entry.grid(row=0, column=1)
        label2.grid(row=0, column=2)
        play.grid(row=0, column=3, ipadx=10, ipady=10)
        label3.grid(row=0, column=4)
        # download.grid(row = 0, column = 5,ipadx = 10, ipady = 10)
        QR_Code.grid(row=0, column=0)
        label_explain.grid(row=1, column=0)
        label_warning.grid(row=2, column=0)