0% found this document useful (0 votes)
19 views

Akshay Puniya Presentation On The Topic of Python

Industrial training report

Uploaded by

myfakex47
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Akshay Puniya Presentation On The Topic of Python

Industrial training report

Uploaded by

myfakex47
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Conclusion of presentation on

the topic of python


In conclusion, Python's simplicity, versatility,
and powerful features make it an ideal choice
for both beginners and experienced
developers. Its clean syntax and readability
ensure a smooth learning curve, while its
extensive libraries and community support
provide robust tools for various applications,
from web development to data science and
artificial intelligence. Python's ability to
integrate with other technologies and its high
demand in the job market further solidify its
position as one of the best programming
languages available today.

By embracing Python, you open the door to


endless opportunities and a bright future in
the world of programming. Thank you for your
attention, and I hope this presentation has
highlighted why Python stands out as a
remarkable and invaluable tool in the tech
industry.
Python code for playing music
import pygame

from tkinter import *

from tkinter import filedialog

from tkinter.ttk import Progressbar

root=Tk()

state=''

pygame.mixer.init()

def update():

pos=pygame.mixer.music.get_pos()/1000

prg['value']=(pos/music_length)*100

root.after(1000,update)

def playm():

global state

global music_length

file1=filedialog.askopenfilename()

pygame.mixer.music.load(file1)

music_length=pygame.mixer.Sound(file1).get_length()

pygame.mixer.music.play()

state='playing'

update()

def stopm():

pygame.mixer.music.stop()

def pausem():

global state
if (state=='playing'):

pygame.mixer.music.pause()
b2['text']='unpause'

state='pause'

elif (state=='pause'):

pygame.mixer.music.unpause()

b2['text']='pause'

state='playing'

b=Button(text="play",command=playm)

b.pack()

b1=Button(text="stop",command=stopm)

b1.pack()

b2=Button(text="pause",command=pausem)

b2.pack()

prg=Progressbar(value=70)

prg.pack(side='bottom',fill='x')

root.mainloop()
Python code that shows time
on your device
from tkinter import *

from tkinter import messagebox

from tkinter import *

from time import strftime

root = Tk()

def update():

l['text']=strftime('%H:%M:%S %p')

l=Label(bg="black",fg="white",font=("Arial",20,"bold"))

l.pack()

update()

root.mainloop()

root = Tk()

turn=1

def winner():

if (buttons[0]['text']==buttons[4]['text']==buttons[8]['text']!=''or

buttons[2]['text']==buttons[4]['text']==buttons[6]['text']!=''or

buttons[0]['text']==buttons[1]['text']==buttons[2]['text']!=''or

buttons[3]['text']==buttons[4]['text']==buttons[5]['text']!=''or

buttons[6]['text']==buttons[7]['text']==buttons[8]['text']!=''or

buttons[0]['text']==buttons[3]['text']==buttons[6]['text']!=''or

buttons[1]['text']==buttons[4]['text']==buttons[7]['text']!=''or

buttons[2]['text']==buttons[5]['text']==buttons[8]['text']!=''):

if turn%2==0:

messagebox.showinfo("Success","User 2 wins")
#print("user 2 wins")

else:

messagebox.showinfo("Success","User 1 wins")

#print("user 1 wins")

def click(pos):

global turn

if buttons[pos]['text']=='':

if turn %2==0:

buttons[pos]['text']='X'

buttons[pos]['bg']='blue'

winner()

else:

buttons[pos]['text']='O'

buttons[pos]['bg']='red'

winner()

turn+=1

#print("hello",pos)

buttons=[]

for i in range(0,3):

for j in range(0,3):

b=Button(text="",height=2,width=5,command=lambda x=len(buttons) :click(x))

b.grid(row=i,column=j)

buttons.append(b )
print(buttons)

root.mainloop()
rock paper & scissor
import random

import tkinter as tk

def game(user):

li = ["rook","peper","scissor"]

# start wihle loop

while True:

# choice random element from the list

n2 = random.choice(li)

if user == n2:

print(f"{user} == {n2}")

elif user == "rook" and n2 == "scissor" or user == "peper" and n2 == "rook" or user == "scissor" and
n2 == "peper" :

root1 = tk.Tk()

root1.title("calculater")

root1.geometry("400x400")

tk.Label(root1,text=f"Arjun win = {user} : {n2}").pack()

# rook['rook'] = f"{e.get()} win"

# paper['paper'] = f"{e.get()} win"

# scissor['scissor'] = f"{e.get()} win"

# paper["bg"] = +e.get()

break

else:

root1 = tk.Tk()

root1.title("calculater")
root1.geometry("400x400")

tk.Label(root1,text=f"Boot win = {user} : {n2}").pack()

break

# create window

root = tk.Tk()

root.title("Rook - Paper - Scessor : GAME")

root.geometry("400x400")

e=tk.Entry(text= "enter your name", border=4).grid(row=1, column=2)

# btn 1 rook

rook = tk.Button(root , text="rook",fg='blue', padx=15 , pady=10, command= lambda:game("rook"))

rook.grid(row=4, column=3)

# btn 2 paper

paper = tk.Button(root , text="paper",fg='red',padx=15 , pady=10, command=lambda:game("paper"))

paper.grid(row=4, column=6)

# btn 3 scissor

scissor = tk.Button(root , text="scissor",fg='green',padx=15 , pady=10,


command=lambda:game("scissor"))

scissor.grid(row=4, column=9)

root.mainloop()
In conclusion, Python's simplicity, versatility, and powerful features make it an ideal choice for both
beginners and experienced developers. Its clean syntax and readability ensure a smooth learning curve,
while its extensive libraries and community support provide robust tools for various applications, from
web development to data science and artificial intelligence. Python's ability to integrate with other
technologies and its high demand in the job market further solidify its position as one of the best
programming languages available today.

By embracing Python, you open the door to endless opportunities and a bright future in the world of
programming. Thank you for your attention, and I hope this presentation has highlighted why Python
stands out as a remarkable and invaluable tool in the tech industry.

You might also like