Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions Python_Mini_Project/Game_Hangman.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import random
# library that we use in order to choose
# on random words from a list of words

name = input("What is your name? ")
# Here the user is asked to enter the name first

print("Good Luck ! ", name)

words = ['rainbow', 'computer', 'science', 'programming',
'python', 'mathematics', 'player', 'condition',
'reverse', 'water', 'board', 'geeks']

# Function will choose one random
# word from this list of words
word = random.choice(words)


print("Guess the characters")

guesses = ''

# any number of turns can be used here
turns = 12


while turns > 0:

# counts the number of times a user fails
failed = 0

# all characters from the input
# word taking one at a time.
for char in word:

# comparing that character with
# the character in guesses
if char in guesses:
print(char)

else:
print("_")

# for every failure 1 will be
# incremented in failure
failed += 1


if failed == 0:
# user will win the game if failure is 0
# and 'You Win' will be given as output
print("You Win")

# this print the correct word
print("The word is: ", word)
break

# if user has input the wrong alphabet then
# it will ask user to enter another alphabet
guess = input("guess a character:")

# every input character will be stored in guesses
guesses += guess

# check input with the character in word
if guess not in word:

turns -= 1

# if the character doesn’t match the word
# then “Wrong” will be given as output
print("Wrong")

# this will print the number of
# turns left for the user
print("You have", + turns, 'more guesses')


if turns == 0:
print("You Loose")
31 changes: 31 additions & 0 deletions Python_Mini_Project/Guess_The_Number.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import random

player_name = input("Hello There, Enter your name\n")
print(f'\nWelcome {player_name}, to the Guessing Game')
while True:
number = random.randint(1, 20)
print(f'{player_name}, I\'m thinking a number between 1 to 20.\nYou have 6 chances to guess it right, Good Luck')

for guessTaken in range(0, 6):
print("Take a guess")
guessed_number = int(input())
if 5 <= number - guessed_number > 0:
print("The number is too low.")
elif 5 > number - guessed_number > 0:
print("The number is a little low.")
elif 5 > guessed_number - number > 0:
print("The number is a little high.")
elif 5 <= guessed_number - number > 0:
print("The number is a too high.")
else:
break

if number == guessed_number:
print(f'Well Done, {player_name} You guessed correct in {guessTaken} guesses')
else:
print(f'The chance is over. The number I was thinking of is {number}')

choice = input("Do you want to play again(y/n):")
if choice != 'y':
print("Thank You for playing!!")
break
80 changes: 80 additions & 0 deletions Python_Mini_Project/guess the movie.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import random
list=["LAGAAN","ANAND","3IDIOTS","DANGAL","SWADES","AWEDNESDAY","UDAAN","SPECIAL26","SULTAN","HAIDER","QUEEN","BARFI","GURU","SARKAR","DRISHYAM","BABY","PK","AIRLIFT","HOLIDAY","GOODNEWWZ","KAHANI","BLACK","GOLMAAL","CHUPKECHUPKE","SHOLAY","DEEWAR","KESHARI","SHAHENSHAH","SHARABI","COOLIE","WAZIR","MANJHI","DON","ANDHADUN","PINK","LOOTERA","BADLA","AGNEEPATH","HUM","NEERJA","THELUNCHBOX","VEERZARA","MSDHONI","MANN","DIL","DHADKAN","ISHQ","KHILADI","ANARI","BADSHAH","BAZIGAR"]
#print(len(list))
movie=random.choice(list)
#print(movie)
n=(len(movie))
f=0
k=0
arr=[]
for i in range(0,n):
arr.append("_")

print("The rule of the game is:")
print("You have got 7 trials to enter the movie name .")
print("If u cant guess the name, then you can simply enter a letter.")
print()
for i in range(0,n):
print(arr[i]," ",end="")
tr=1
while(tr<=7):
print("Guess the movie if u can else enter a letter!")
inp=input()
print()
if(len(inp)==n or arr==movie):
if(inp == movie):
print("Hurray! You won. Yes the answer was",movie)
f=1
break
else:
print("Sorry,thats not right.")
print("You still have",7-tr," turns left.Try again.")
print()
for i in range(0,n):
print(arr[i]," ",end="")
print()
inp=input()
tr=tr+1
continue
elif(len(inp)==1):
for i in range(0,n):
c=movie[i]
if(inp==c):
arr[i]=c
k=1
for i in range(0,n):
print(arr[i]," ",end="")
print()
if(k==1):
print("Yes ",inp," is presnt in d movie name")
print("You still have",7-tr," turns left.Try again.",end=" ")
print("Keep going")
else:
print("Sorry",inp," is not there.")
print("You still have",7-tr," turns left.Try again.")
k=0
tr=tr+1
continue

print("Sorry,thats not right. Try again.")
print("You still have",7-tr," turns left.Try again.")
print()
inp=input()
tr=tr+1


print()
if f!=1:
print("Sorry,the answer was",movie)












1 change: 1 addition & 0 deletions Python_Mini_Project/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

167 changes: 167 additions & 0 deletions Python_Mini_Project/jarvis2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
import pyttsx3 #pip install pyttsx3
import speech_recognition as sr #pip install speechRecognition
import datetime
import wikipedia #pip install wikipedia
import webbrowser
import os
import smtplib
import pyautogui
import psutil

engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
# print(voices[1].id)
engine.setProperty('voice', voices[0].id)


def speak(audio):
engine.say(audio)
engine.runAndWait()


def wishMe():
hour = int(datetime.datetime.now().hour)
if hour>=0 and hour<12:
speak("Good Morning sir!")

elif hour>=12 and hour<18:
speak("Good Afternoon sir!")

else:
speak("Good Evening sir!")

speak("Hello I am Jarvis. speed one terabite, cpu 12ssr4. Please tell me how may I help you")

def takeCommand():
#It takes microphone input from the user and returns string output

r = sr.Recognizer()
with sr.Microphone() as source:
print("Listening...")
r.pause_threshold = 1
audio = r.listen(source)

try:
print("Recognizing...")
query = r.recognize_google(audio, language='en-in')
print(f"User said: {query}\n")

except Exception as e:
# print(e)
print("Say that again please...")
return "None"
return query

def sendEmail(to, content):
server = smtplib.SMTP('smtp.gmail.com', 587)
server.ehlo()
server.starttls()
server.login('[email protected]', 'your-password')
server.sendmail('[email protected]', to, content)
server.close()

def screenshot():
img = pyautogui.screenshot()
img.save("C:\\Users\\Aritro chakraborty\\Desktop\\ss.png")

def cpu():
usage = str(psutil.cpu_percent())
speak('cpu is usage at' + usage +"GB")
def battery():
battery = psutil.sensors_battery()
speak("Battery is percentage is")
speak(battery.percent)

if __name__ == "__main__":
wishMe()
while True:
# if 1:
query = takeCommand().lower()

# Logic for executing tasks based on query
if 'wikipedia' in query:
speak('Searching Wikipedia...')
query = query.replace("wikipedia", "")
results = wikipedia.summary(query, sentences=2)
speak("According to Wikipedia")
print(results)
speak(results)

elif 'open youtube' in query:
webbrowser.open("youtube.com")

# elif 'open google' in query:
# speak('what should i search..!')
# edge ='C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe %s'
# search = takeCommand().lower()
# webbrowser.get(edge).open_new_tab(search+'.com')

elif 'open google' in query:
webbrowser.open("google.com")

elif 'open stack overflow' in query:
webbrowser.open("stack overflow.com")

elif 'remember that' in query:
speak("What shpuld i remember ? ")
data = takeCommand()
speak("you said me to remember that"+data)
remember = open('data.txt','w')
remember.write(data)
remember.close()

elif 'do you know anything' in query:
remember = open('data.txt','r')
speak("you said me to remember that" +remember.read())

elif 'play music' in query:
music_dir = 'D:\\Favorite Songs2'
songs = os.listdir(music_dir)
print(songs)
os.startfile(os.path.join(music_dir, songs[0]))

elif "cpu" in query:
cpu()

elif "battery" in query:
battery()

elif 'time' in query:
strTime = datetime.datetime.now().strftime("%H:%M:%S")
speak(f"Sir, the time is {strTime}")

elif 'thank you' in query:
speak("it's my pleasure sir..")

elif 'screenshot' in query:
speak("taking ..")
screenshot()
speak("it's done sir ! please check it in desktop..")

elif 'open code' in query:
codePath = 'C:\\Users\\Aritro chakraborty\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe'
os.startfile(codePath)

elif 'date' in query:
year = int(datetime.datetime.now().year)
month = int(datetime.datetime.now().month)
date = int(datetime.datetime.now().day)
speak("Today is")
speak(date)
speak(month)
speak(year)

elif 'offline' in query:
speak("going to offline.. i was happy to help you..")
quit()

elif 'email' in query:
try:
speak("What should I say?")
content = takeCommand()
to = "[email protected]"
sendEmail(to, content)
speak("Email has been sent!")
except Exception as e:
print(e)
speak("i am extremly Sorry sir. I am not able to send this email")
8 changes: 8 additions & 0 deletions Python_Mini_Project/jokes-desktop-notifier.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import pyjokes
import time
from win10toast import ToastNotifier

while 1:
notify = ToastNotifier()
notify.show_toast("Time to laugh!", pyjokes.get_joke(), duration = 20)
time.sleep(1800)
18 changes: 18 additions & 0 deletions Python_Mini_Project/source-code-color.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from colorama import init
init()
from colorama import Fore , Back , Style # Fore- font color | Back- Background

print(Fore.GREEN,"hello qxresearcher")

print(Back.RED,"hello qxresearcher")

#to get back to boring B&W: print(Styoe.RESET_ALL)

```
All Variaton on Colors:

Fore: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE RESET
Back: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE RESET
Style: DIM NORMAL BRIGHT RESET_ALL

```
3 changes: 3 additions & 0 deletions Python_Mini_Project/source-code-custom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import win10toast
toaster = win10toast.ToastNotifier()
toaster.show_toast("python","success ! This is working!", duration=10)
Loading