forked from AadarshChaurasia/desktop_assistant_v1.1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.py
109 lines (70 loc) · 2.09 KB
/
search.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import file_search
import os
i = 0
def finder(str):
for i in range(1):
# try:
# file_search.set_root('C:\\')
# input__ = str
# files = file_search.searchFile(input__)
# os.startfile(files[0])
# except Exception as c:
# print('oops! File not found in C drive.')
# i = i+1
try:
file_search.set_root('E:\\')
input__ = str
files = file_search.searchFile(input__)
os.startfile(files[0])
break
except Exception as e:
print('oops! File not found in E drive.')
# i = i+1
try:
file_search.set_root('F:\\')
input__ = str
files = file_search.searchFile(input__)
os.startfile(files[0])
break
except Exception as f:
print('oops! File not found in F drive.')
break
# i = i+1
# if i == 3:
# print("Soory! File not found")
if __name__ == "__main__":
a = input("Enter: ")
finder(a)
# def e(val, val2, val3):
# file_search.set_root('E:\\')
# try:
# input__ = val
# files = file_search.searchFile(input__)
# except expression as identifier:
# pass
# try:
# input__ = val2
# files = file_search.searchFile(input__)
# except expression as i:
# pass
# try:
# input__ = val3
# files = file_search.searchFile(input__)
# except expression as ide:
# pass
# try:
# os.startfile(files[0])
# except Exception as e:
# print('oops! File not found.')
# def val_find(name):
# low = name.lower()
# hig = name.upper()
# length_ = int(len(name))
# p1 = name[0]
# p2 = p1.upper()
# p3 = name[1:length_]
# p4 = p3.lower()
# total = p2+p4
# e(low, hig, total)
# a = "aadarsh"
# val_find(a)