Skip to content

Commit cd500eb

Browse files
committed
Update calculator
Changes committed: new file: .vscode/settings.json modified: Milestone Project 1/Advance.py modified: Milestone Project 1/Tic_tac.py modified: Python_GUI/TIC TAC/TIC_TAC.py modified: README.md new file: YoutubeDownloader/YoutubeDownloader.py
1 parent 2725c9a commit cd500eb

File tree

6 files changed

+74
-18
lines changed

6 files changed

+74
-18
lines changed

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"python.formatting.provider": "autopep8"
3+
}

Milestone Project 1/Advance.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def win_check(board,mark):
3939

4040
def random_player():
4141
return random.choice((-1, 1))
42-
42+
4343
def space_check(board,position):
4444
return board[position] == ' '
4545

@@ -49,18 +49,18 @@ def full_board_check(board):
4949

5050
def player_choice(board,player):
5151
position = 0
52-
52+
5353
while position not in [1,2,3,4,5,6,7,8,9] or not space_check(board, position):
5454
try:
5555
position = int(input('Player %s, choose your next position: (1-9) '%(player)))
5656
except:
5757
print("I'm sorry, please try again.")
58-
58+
5959
return position
6060

6161

6262
def replay():
63-
63+
6464
return input('Do you want to play again? Enter Yes or No: ').lower().startswith('y')
6565

6666

@@ -78,7 +78,7 @@ def replay():
7878
display_board(available,theBoard)
7979
position = player_choice(theBoard,player)
8080
place_marker(available,theBoard,player,position)
81-
81+
8282
if win_check(theBoard,player):
8383
display_board(available,theBoard)
8484
print(f"Congratulations ! player {player} wins!..")
@@ -98,4 +98,4 @@ def replay():
9898
available = [str(num) for num in range(0,10)]
9999

100100
if not replay():
101-
break
101+
break

Milestone Project 1/Tic_tac.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
def display_board(board):
55
"""
6-
Display the Tic Tac Toe Board on screen
6+
Display the Tic Tac Toe Board on screen
77
88
"""
99
os.system("cls")
@@ -102,7 +102,7 @@ def player_choice(board):
102102
def replay():
103103
choice = input("Do You want to play Again? Yes or No : ")
104104
return choice == 'Yes'
105-
105+
106106

107107

108108
if __name__ == "__main__":
@@ -118,10 +118,10 @@ def replay():
118118
game_on = True
119119
else:
120120
game_on = False
121-
121+
122122
while game_on:
123123
if turn =='Player 1':
124-
124+
125125
display_board(the_board)
126126
position = player_choice(the_board)
127127
place_marker(the_board,player1_marker,position)
@@ -152,7 +152,6 @@ def replay():
152152
game_on =False
153153
else:
154154
turn = 'Player 1'
155-
155+
156156
if not replay():
157157
break
158-

Python_GUI/TIC TAC/TIC_TAC.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def SetLayout(id,player_symbol):
4242
b9.state(['disabled'])
4343

4444
def CheckWinner():
45-
global mov
45+
global mov
4646
winner = -1
4747

4848
if(1 in p1) and (2 in p1) and (3 in p1):
@@ -86,13 +86,13 @@ def CheckWinner():
8686
winner = 2
8787

8888
if winner ==1:
89-
messagebox.showinfo(title="Congrate.",
89+
messagebox.showinfo(title="Congrate.",
9090
message="Player 1 is the winner")
9191
elif winner ==2:
92-
messagebox.showinfo(title="Congrate.",
92+
messagebox.showinfo(title="Congrate.",
9393
message="Player 2 is the winner")
9494
elif mov ==9:
95-
messagebox.showinfo(title="Oops :(",
95+
messagebox.showinfo(title="Oops :(",
9696
message="It's a Draw!! Try Again...")
9797

9898
def ButtonClick(id):

README.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1+
12
# PYTHON_PROJECTS
3+
24
This repository contains **Some mini projects** implemented in **Python**
35

46
## Python_GUI
7+
58
* Python GUI(Graphical User Interface) applications using **Tkinter** python library.
6-
* TIC TAC TOE game
7-
* Python Calculator
9+
* TIC TAC TOE game
10+
* Python Calculator
11+
12+
![image](https://raw.githubusercontent.com/its-Kumar/Python_Projects/master/Python_GUI/PYTHON%20CALCULATOR/calc.png)
813

914
---
15+
1016
## Author
17+
1118
[Kumar Shanu](https://github.com/its-Kumar/)
+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Import Libraries
2+
from tkinter import *
3+
from pytube import YouTube
4+
5+
# misc
6+
import os
7+
import shutil
8+
import math
9+
import datetime
10+
11+
12+
# ================ App ==================
13+
root = Tk()
14+
root.title("Youtube Downloader")
15+
16+
# =========== Global Area ==============
17+
url = StringVar()
18+
video = None
19+
20+
21+
def download(text):
22+
global url
23+
url = text
24+
print(url)
25+
global video
26+
video = YouTube(str(url))
27+
print(video.streams.all())
28+
29+
30+
label = Label(root, text='Online Video Downloader')
31+
label.pack()
32+
33+
entry = Entry(root, textvariable=url, text='Paste your video link here... ')
34+
entry.pack(side=LEFT)
35+
btnDownload = Button(root, text="Download",
36+
command=lambda: download(entry.get()))
37+
38+
39+
# video.streams.all()
40+
41+
#video.streams.filter(file_extension = "mp4").all()
42+
43+
# video.streams.get_by_itag(18).download()
44+
45+
btnDownload.pack()
46+
root.mainloop()
47+
# ============== End ============================

0 commit comments

Comments
 (0)