Python Forum
[Tkinter] add search bar = search for input in all computer directory
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] add search bar = search for input in all computer directory
#1
Hi, it is possible in tkinter to code the searchbar for a search in all the computer for a given input? Can provide some code?
I know the code for specific file path (example "notepad.exe"), but this case is different.
I'm not asking how to create a searchbar, i know that. I'm asking how do we do a full search in windows for given name in the searchbox. Regards, Francisco

import tkinter  
import time  
from tkinter import ttk
from tkinter import *
import tkinter as tk
import time
import sys
import os
import subprocess
import idlelib
import urllib.request
import ctypes
import functools
from tkinter import PhotoImage
import webbrowser
from tkinter import messagebox
import pymsgbox

###################################
master = Tk()
master.configure(background='blue')
master.minsize(1000,400)
master.geometry("1000x400")
###################################

def downloads(): 
    for x in range(1, 110):
            progress_var.set(x)
            time.sleep(0.10)
            master.update()
            progress_var.set(0)

    if True:
        os.startfile("C:/Users/Nelson/Downloads/")

def musicas(): 
    for x in range(1, 110):
            progress_var.set(x)
            time.sleep(0.10)
            master.update()
            progress_var.set(0)

    if True:
        os.startfile("C:/Users/Nelson/Music/")
        
def imagens(): 
    for x in range(1, 110):
            progress_var.set(x)
            time.sleep(0.10)
            master.update()
            progress_var.set(0)

    if True:
        os.startfile("C:/Users/Nelson/Pictures/")

def videos(): 
    for x in range(1, 110):
            progress_var.set(x)
            time.sleep(0.10)
            master.update()
            progress_var.set(0)

    if True:
        os.startfile("C:/Users/Nelson/Videos/")

def documentos(): 
    for x in range(1, 110):
            progress_var.set(x)
            time.sleep(0.10)
            master.update()
            progress_var.set(0)

    if True:
        os.startfile("C:/Users/Nelson/Documents/")

    
progress_var = tkinter.IntVar()
pb = ttk.Progressbar(master, orient="horizontal", length=400, maximum=100, mode="determinate", var=progress_var)

pb.grid(padx=100, pady=300)

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

photo1=PhotoImage(file="downloads.png")
b1 = Button(master,image=photo1, command=downloads, height=200, width=200, compound=LEFT)
b1.place(x = 0, y = 0)# x = mexe na horizontal e y = mexe na vertical

photo2=PhotoImage(file="musica.png")
b2 = Button(master,image=photo2, command=musicas, height=200, width=200, compound=LEFT)
b2.place(x = 200, y = 0)# x = mexe na horizontal e y = mexe na vertical

photo3=PhotoImage(file="imagens.png")
b3 = Button(master,image=photo3, command=imagens, height=200, width=200, compound=LEFT)
b3.place(x = 400, y = 0)# x = mexe na horizontal e y = mexe na vertical

photo4=PhotoImage(file="videos.png")
b4 = Button(master,image=photo4, command=videos, height=200, width=200, compound=LEFT)
b4.place(x = 600, y = 0)# x = mexe na horizontal e y = mexe na vertical

photo5=PhotoImage(file="documentos.png")
b5 = Button(master,image=photo5, command=documentos, height=200, width=200, compound=LEFT)
b5.place(x = 800, y = 0)# x = mexe na horizontal e y = mexe na vertical

####################################    
master.resizable(False, False) 
master.mainloop()
###################################
Reply


Messages In This Thread
add search bar = search for input in all computer directory - by francisco_neves2020 - Apr-11-2019, 01:40 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] Search data in treeview without search button TomasSanchexx 3 1,620 Aug-12-2023, 03:17 AM
Last Post: deanhystad
  search is not finding documentation i want Skaperen 1 900 Aug-26-2022, 08:17 AM
Last Post: Gribouillis
  [PyQt] [Solved]Display Search Results in QTable Extra 5 2,472 Jun-29-2022, 10:20 PM
Last Post: Extra
  [Tkinter] Text.search() regexp not working rfresh737 11 5,023 Apr-16-2021, 06:56 PM
Last Post: rfresh737
  Listbox search code partially works chesschaser 9 3,889 May-05-2020, 01:08 PM
Last Post: chesschaser
  tkinter search box DT2000 3 7,713 Apr-08-2020, 05:59 AM
Last Post: DT2000
  [Tkinter] GUI help for search engine carzymind 0 2,664 Sep-27-2019, 10:49 AM
Last Post: carzymind
  [Tkinter] Problem with tkinter search widget poopcupine 1 2,682 Mar-25-2019, 08:24 AM
Last Post: Larz60+
  Python, Tkinter. How to search a specific file in a folder Roo 3 3,436 Feb-13-2019, 10:41 AM
Last Post: Larz60+
  [WxPython] Search window position in Trelby blackclover 20 9,045 May-07-2018, 05:08 AM
Last Post: blackclover

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020