├── 001_LogoOrVirus
├── Demo
│ ├── minipss1.1.png
│ ├── minipss1.2.png
│ ├── minipss1.3.png
│ └── minipss1.png
├── README.md
└── draw_logo_or_virus.py
├── 002_Electron_Configuration_App
├── Demo
│ ├── demo1.png
│ ├── demo2.png
│ ├── demo3.png
│ ├── demo4.png
│ └── demo5.png
├── README.md
└── electron.exe
├── README.md
└── tkshortcut.py
/001_LogoOrVirus/Demo/minipss1.1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spider-yamet/Mini-Project-Python_2022/846cef16bbef1d00e2167161a4bbee258612f723/001_LogoOrVirus/Demo/minipss1.1.png
--------------------------------------------------------------------------------
/001_LogoOrVirus/Demo/minipss1.2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spider-yamet/Mini-Project-Python_2022/846cef16bbef1d00e2167161a4bbee258612f723/001_LogoOrVirus/Demo/minipss1.2.png
--------------------------------------------------------------------------------
/001_LogoOrVirus/Demo/minipss1.3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spider-yamet/Mini-Project-Python_2022/846cef16bbef1d00e2167161a4bbee258612f723/001_LogoOrVirus/Demo/minipss1.3.png
--------------------------------------------------------------------------------
/001_LogoOrVirus/Demo/minipss1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spider-yamet/Mini-Project-Python_2022/846cef16bbef1d00e2167161a4bbee258612f723/001_LogoOrVirus/Demo/minipss1.png
--------------------------------------------------------------------------------
/001_LogoOrVirus/README.md:
--------------------------------------------------------------------------------
1 | # Mini-Project-1 (Very Simple GUI with Tkinter and Turle Module)
2 | ## Let me tell you about this project -
3 |
4 | - You Have to use the python file.
5 | - You will need to run it
6 | - Then you will find a window
7 | - There will be 2 Button to choice
8 |
9 |
10 |
11 |
12 | ### After Getting the Code simply run it.
13 |
14 |
15 |
16 | After run the code this kind of window will open up.
And here 2 options are available.
17 |
18 |
Next by clicking " DRAW MY LOGO " button my logo will exicuted by Turtle .
19 | Like Below -->>
20 |
21 |
22 |
23 | " DRAW A VIRUS " will draw a virus in that window
Like This ==>>
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/001_LogoOrVirus/draw_logo_or_virus.py:
--------------------------------------------------------------------------------
1 | import turtle
2 | ttl = turtle.Turtle()
3 | import tkinter as tk
4 |
5 | def ehashiq(p1,p2,d):
6 |
7 | ttl.color('cyan')
8 | ttl.pensize(4)
9 | ttl.penup()
10 | ttl.goto(p1,p2)
11 | ttl.pendown()
12 | ttl.pencolor('maroon')
13 | ttl.turtlesize(1)
14 | # ttl.shape('circle')
15 | displaay = turtle.Screen()
16 | displaay.screensize(canvwidth=900, canvheight=800)
17 | displaay.bgcolor('gold')
18 | displaay.title("Ashiq's Logo")
19 | ttl.speed(10)
20 | ttl.forward(150)
21 | ttl.backward(150)
22 | ttl.right(90)
23 | ttl.forward(150)
24 | ttl.left(90)
25 | ttl.forward(150)
26 | ttl.backward(150)
27 | ttl.right(90)
28 | ttl.forward(150)
29 | ttl.left(90)
30 | ttl.forward(150)
31 | ttl.left(90)
32 | ttl.forward(150)
33 | ttl.backward(150)
34 | ttl.right(90)
35 | ttl.forward(150)
36 | ttl.right(90)
37 | ttl.forward(150)
38 | ttl.right(180)
39 | ttl.fd(150)
40 | ttl.left(90)
41 | ttl.fd(150)
42 | ttl.left(90)
43 | ttl.fd(150)
44 | ttl.right(180)
45 | ttl.fd(150)
46 | ttl.right(90)
47 | ttl.fd(150)
48 | ttl.left(90)
49 | ttl.fd(150)
50 | ttl.left(90)
51 | ttl.forward(150)
52 | ttl.left(90)
53 | ttl.forward(290)
54 | ttl.penup()
55 | ttl.goto(0,-250)
56 | ttl.left(90)
57 | ttl.fd(50)
58 | ttl.pendown()
59 | ttl.circle(d)
60 |
61 | button2.config(state=tk.DISABLED)
62 |
63 |
64 | def clicking():
65 | d = 270
66 | p=-100;q=250
67 | for _ in range(4):
68 | ehashiq(p,q,d)
69 | p -=5;q-=5
70 | d+=1
71 |
72 |
73 |
74 | def drawign():
75 | n = 200
76 | ttl.speed(7)
77 | ttl.color('cyan')
78 | while n >0:
79 | ttl.forward(n)
80 | ttl.left(n)
81 | n -=1
82 | button1.config(state=tk.DISABLED)
83 |
84 | def press():
85 | drawign()
86 |
87 | if __name__ == "__main__":
88 | screen = turtle.Screen()
89 |
90 | screen.title("GUI+Turtle")
91 | screen.bgcolor("black")
92 | canvas = screen.getcanvas()
93 |
94 | button1 = tk.Button(canvas.master,text="Click to draw my LOGO :)".upper(),
95 | font= ('consolas',10,'bold'),
96 | bg='yellow',
97 | fg='blue',
98 | command=clicking)
99 | button1.pack(side=tk.LEFT)
100 | button2 = tk.Button(canvas.master,text="Click to draw a virus :)".upper(),
101 | font= ('consolas',10,'bold'),
102 | bg='yellow',
103 | fg='blue',
104 | state=tk.ACTIVE,
105 | command=press)
106 | button2.pack(side=tk.RIGHT)
107 | headline = tk.Label(text='What Do You want to Draw ?'.upper(),
108 | font= ('consolas',12,'bold'),
109 | fg= ("cyan"),
110 | bg='black',
111 | )
112 |
113 | headline.pack(side=tk.BOTTOM )
114 |
115 | turtle.done()
--------------------------------------------------------------------------------
/002_Electron_Configuration_App/Demo/demo1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spider-yamet/Mini-Project-Python_2022/846cef16bbef1d00e2167161a4bbee258612f723/002_Electron_Configuration_App/Demo/demo1.png
--------------------------------------------------------------------------------
/002_Electron_Configuration_App/Demo/demo2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spider-yamet/Mini-Project-Python_2022/846cef16bbef1d00e2167161a4bbee258612f723/002_Electron_Configuration_App/Demo/demo2.png
--------------------------------------------------------------------------------
/002_Electron_Configuration_App/Demo/demo3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spider-yamet/Mini-Project-Python_2022/846cef16bbef1d00e2167161a4bbee258612f723/002_Electron_Configuration_App/Demo/demo3.png
--------------------------------------------------------------------------------
/002_Electron_Configuration_App/Demo/demo4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spider-yamet/Mini-Project-Python_2022/846cef16bbef1d00e2167161a4bbee258612f723/002_Electron_Configuration_App/Demo/demo4.png
--------------------------------------------------------------------------------
/002_Electron_Configuration_App/Demo/demo5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spider-yamet/Mini-Project-Python_2022/846cef16bbef1d00e2167161a4bbee258612f723/002_Electron_Configuration_App/Demo/demo5.png
--------------------------------------------------------------------------------
/002_Electron_Configuration_App/README.md:
--------------------------------------------------------------------------------
1 | # Mini-Project-2 (Simple Software with Tkinter)
2 |
3 | ## Download Precedure :
4 |
5 | ### After Click the download button in github, after complete downloading you may face this kind of problem so simply keep the app to run.
Thank You.
6 |
7 |
8 |
9 |
10 | ## Let me tell you about this project -
11 |
12 | - You Have to do nothing.
13 | - Just download the exe
14 | - Try to download from other browser cz Chrome will say its a virus , But it's absolutely Safe.
15 |
16 |
17 |
18 |
19 | ### Click The exe file to run. After run it you will see below window----->>
20 |
21 |
22 |
23 |
24 | ### Enter The mass of the Electron. Name is optional
25 |
26 |
27 |
28 | That's it. This is the simple app for my mini project .
29 | You can see the electron configuration -->>
30 |
31 |
32 |
--------------------------------------------------------------------------------
/002_Electron_Configuration_App/electron.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spider-yamet/Mini-Project-Python_2022/846cef16bbef1d00e2167161a4bbee258612f723/002_Electron_Configuration_App/electron.exe
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # MY MINI PROJECTS LIST
2 |
3 |
4 | | Table of Contents |
5 | |--|
6 | |[1 - Draw Logo or Virus](https://github.com/emhash/Mini-Project-Python_2022/tree/main/001_LogoOrVirus) |
7 | |[2 - Electron Configuration Genaretorn App](https://github.com/emhash/Mini-Project-Python_2022/tree/main/002_Electron_Configuration_App) |
8 |
9 |
10 | ## Check the content. And Watch Demo and Use it. DON'T FORGOT TO GIVE A STAR 😊
11 |
--------------------------------------------------------------------------------
/tkshortcut.py:
--------------------------------------------------------------------------------
1 | from tkinter import *
2 | from PIL import Image,ImageTk
3 | import os
4 | from time import *
5 | import sys
6 | import os
7 |
8 | '''
9 | I HAVE WRITTEN THESE SIMPLE CODE TO USE SHORT CUT FOR MY PERSONAL TKINTER PROJECT
10 |
11 | © ---> EMHASH <---
12 | (em#)
13 |
14 | '''
15 |
16 |
17 | # --------------------- THIS FUNCTION TO CONVERT IMAGE INTO EXE ------------------------------
18 |
19 | def resource_path(relative_path):
20 | """ Get absolute path to resource, works for dev and for PyInstaller """
21 | try:
22 | # PyInstaller creates a temp folder and stores path in _MEIPASS
23 | base_path = sys._MEIPASS
24 | except Exception:
25 | base_path = os.path.abspath(".")
26 | return os.path.join(base_path, relative_path)
27 |
28 | # -------------------------------- FUNCTION END -----------------------------
29 |
30 |
31 |
32 | def tkCenter(the_window):
33 | ''' This is nothing but centerize the window in display
34 | all we just need to do is pass the root or window class as a parameter of tkCenter.
35 | As -->
36 | tkcenter(Name of the Tk() class's object )
37 | Examole ==>
38 |
39 | window = Tk()
40 | tkCenter(window)
41 | '''
42 | # CODE --->
43 | the_window.update_idletasks()
44 | width = the_window.winfo_width()
45 | frm_width = the_window.winfo_rootx() - the_window.winfo_x()
46 | win_width = width + 2 * frm_width
47 | height = the_window.winfo_height()
48 | titlebar_height = the_window.winfo_rooty() - the_window.winfo_y()
49 | win_height = height + titlebar_height + frm_width
50 | x = the_window.winfo_screenwidth() // 2 - win_width // 2
51 | y = the_window.winfo_screenheight() // 2 - win_height // 2
52 | the_window.geometry('{}x{}+{}+{}'.format(width, height, x, y))
53 | the_window.deiconify()
54 |
55 |
56 |
57 |
58 | def tkSplash(splash_x, splash_y,GIF_name, loop, speed):
59 | ''' IF YOU WANT TO TRY WITH NEW GIF AFTER FIRST ATTEMP THEN DON"T FORGET TO DELETE THE ' Frame_of_GIF '
60 | FOLDER FROM YOUR YOUT WORKING ENVOIRNMENT .....
61 | Here tkSplash - this is very helpfull to create a splash screen in tkinter.
62 | For that we just simply need to a GIF file . If we want to use our personal video
63 | than we have to convert that video into GIF file first . I use GIF file Cz splash screen
64 | remains for few seconds and a GIF file is enough for that.
65 |
66 | Parameters ==> X exis of GIF, Y exis of GIF, GIF_name.extension (String with upper comma), Loop number , speed of frame(sec)
67 |
68 | Example:
69 |
70 | root = Tk()
71 | tkSplash(150, 150, "mygif.gif", 1, 0.5)
72 |
73 | © ---> EMHASH <---
74 | '''
75 |
76 | the_window = Tk()
77 | the_window.geometry(f"{splash_x}x{splash_y}")
78 | the_window.wm_overrideredirect(True)
79 |
80 | the_window.update_idletasks()
81 | width = the_window.winfo_width()
82 | frm_width = the_window.winfo_rootx() - the_window.winfo_x()
83 | win_width = width + 2 * frm_width
84 | height = the_window.winfo_height()
85 | titlebar_height = the_window.winfo_rooty() - the_window.winfo_y()
86 | win_height = height + titlebar_height + frm_width
87 | x = the_window.winfo_screenwidth() // 2 - win_width // 2
88 | y = the_window.winfo_screenheight() // 2 - win_height // 2
89 | the_window.geometry('{}x{}+{}+{}'.format(width, height, x, y))
90 | the_window.deiconify()
91 |
92 | gif = Image.open(resource_path(GIF_name))
93 | length_of_frames = gif.n_frames
94 |
95 | try:
96 | os.mkdir(resource_path( 'frame_of_GIF'))
97 | frame_of_GIF = []
98 | gif = Image.open(resource_path( GIF_name))
99 | length_of_frames = gif.n_frames
100 |
101 | for i in range(length_of_frames):
102 | gif.seek(i)
103 | gif.save(os.path.join("frame_of_GIF",f"gif{i}.png"))
104 | frame_of_GIF.append(os.path.join("frame_of_GIF",f"gif{i}.png"))
105 |
106 | except:
107 | pass
108 |
109 | while loop > 0:
110 | for i in range(length_of_frames):
111 |
112 | # Resize img and use ==>
113 | img= (Image.open( f"frame_of_GIF/gif{i}.png"))
114 | resized_image= img.resize((splash_x,splash_y), Image.Resampling.LANCZOS)
115 | new_image= ImageTk.PhotoImage(resized_image)
116 |
117 | # USING THE IMAGES OF GIF AS SPLASH ===============================================>>>
118 | sample = Label(the_window, image=new_image,bd=0)
119 | sample.place(x=0,y=0)
120 | the_window.update()
121 | sleep(speed)
122 | loop=loop-1
123 |
124 | the_window.destroy()
125 | the_window.mainloop()
126 |
127 |
128 | def click_to_go_right(range_of_loop, sleep_speed_in_loop, variable_name_of_img_label):
129 | ''' UNCOMPLETE . Still need more modify'''
130 |
131 | for i in range(range_of_loop):
132 | variable_name_of_img_label.place(x=variable_name_of_img_label.winfo_x()+1, y= variable_name_of_img_label.winfo_y())
133 | sleep(sleep_speed_in_loop)
134 | variable_name_of_img_label.update_idletasks()
135 |
136 | def click_to_go_left(range_of_loop, sleep_speed_in_loop, variable_name_of_img_label):
137 | ''' UNCOMPLETE . Still need more modify'''
138 |
139 | for i in range(range_of_loop):
140 | variable_name_of_img_label.place(x=variable_name_of_img_label.winfo_x()-1, y= variable_name_of_img_label.winfo_y())
141 | sleep(sleep_speed_in_loop)
142 | variable_name_of_img_label.update_idletasks()
143 |
144 |
--------------------------------------------------------------------------------