Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 19bf3c6

Browse files
Merge branch 'master' into Domain
2 parents 8ffa307 + 1f3c3c3 commit 19bf3c6

File tree

148 files changed

+1347
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+1347
-3
lines changed

‎.github/Floating text effect/README.md

Lines changed: 47 additions & 0 deletions

‎.github/Floating text effect/script.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import time
2+
3+
# Function to print floating text
4+
5+
6+
def print_floating_text(text):
7+
for char in text:
8+
print(char, end='', flush=True)
9+
time.sleep(0.05) # Adjust the sleep duration for desired speed
10+
print()
11+
12+
13+
# Installation process
14+
print_floating_text("Hi, I am Shivansh Jain.")
15+
time.sleep(1) # Simulating a delay
16+
print_floating_text("I am a Computer Science student.")
17+
time.sleep(1) # Simulating a delay
18+
print_floating_text(
19+
"I have added this python script which creates floating text effects.")
20+
time.sleep(1) # Simulating a delay
21+
print_floating_text(
22+
"I know full stack web development using HTML, CSS, Javascript, Django.")
23+
time.sleep(1) # Simulating a delay
24+
print_floating_text("I like cricket, music and mythology.")
25+
26+
# Further code execution
27+
print("Continuing with further code execution...")
28+
# ... Rest of the code ...
-3.75 KB
-55.5 KB
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import tkinter as tk
2+
3+
def convert_temperature():
4+
try:
5+
temperature = float(entry.get())
6+
if var.get() == 0: # Celsius to Fahrenheit
7+
result = temperature * 9/5 + 32
8+
output_label.configure(text=f"{temperature}°C = {result}°F")
9+
elif var.get() == 1: # Fahrenheit to Celsius
10+
result = (temperature - 32) * 5/9
11+
output_label.configure(text=f"{temperature}°F = {result}°C")
12+
except ValueError:
13+
output_label.configure(text="Invalid input")
14+
15+
# Create the main window
16+
window = tk.Tk()
17+
window.title("Temperature Converter")
18+
19+
# Create input label and entry widget
20+
input_label = tk.Label(window, text="Enter temperature:")
21+
input_label.pack()
22+
entry = tk.Entry(window)
23+
entry.pack()
24+
25+
# Create radio buttons for temperature conversion options
26+
var = tk.IntVar()
27+
celsius_to_fahrenheit = tk.Radiobutton(window, text="Celsius to Fahrenheit", variable=var, value=0)
28+
celsius_to_fahrenheit.pack()
29+
fahrenheit_to_celsius = tk.Radiobutton(window, text="Fahrenheit to Celsius", variable=var, value=1)
30+
fahrenheit_to_celsius.pack()
31+
32+
# Create convert button
33+
convert_button = tk.Button(window, text="Convert", command=convert_temperature)
34+
convert_button.pack()
35+
36+
# Create output label for displaying result
37+
output_label = tk.Label(window)
38+
output_label.pack()
39+
40+
# Run the main event loop
41+
window.mainloop()

‎Automatic Jokes generator/Jokes.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import pyjokes
2+
import pyttsx3
3+
4+
engine = pyttsx3.init()
5+
voices = engine.getProperty('voices')
6+
engine.setProperty('voice', voices[1].id)
7+
rate = engine.getProperty('rate')
8+
engine.setProperty('rate', rate+-20)
9+
10+
def speak(audio):
11+
engine.say(audio)
12+
engine.runAndWait()
13+
14+
def joke():
15+
speak(pyjokes.get_joke())
16+
17+
if __name__ == "__main__":
18+
joke()

‎Automatic Jokes generator/laugh.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import pyjokes
2+
import pyttsx3
3+
4+
engine = pyttsx3.init()
5+
voices = engine.getProperty('voices')
6+
engine.setProperty('voice', voices[1].id)
7+
rate = engine.getProperty('rate')
8+
engine.setProperty('rate', rate+-20)
9+
10+
11+
def speak(audio):
12+
engine.say(audio)
13+
engine.runAndWait()
14+
15+
16+
def joke():
17+
speak(pyjokes.get_joke())
18+
19+
if __name__=="__main__":
20+
joke()
Lines changed: 34 additions & 0 deletions
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# imports
2+
import sys
3+
from spellchecker import SpellChecker
4+
from nltk import word_tokenize
5+
6+
# create an instance of the spellchecker
7+
spell = SpellChecker()
8+
9+
# tokens --> stores the tokenized words
10+
tokens = []
11+
12+
13+
def readTextFile(textFilename):
14+
"""This function is used to read the input file"""
15+
global tokens
16+
words = []
17+
inputFile = open(textFilename, "r")
18+
tokens = word_tokenize(inputFile.read())
19+
20+
# Create a list of words from these tokens checking if the word is alphanumeric
21+
words = [word for word in tokens if word.isalpha()]
22+
inputFile.close()
23+
return words
24+
25+
26+
def findErrors(textWords):
27+
"""This function is used to detect the errors in file if any"""
28+
misspelledWords = []
29+
for word in textWords:
30+
# correction() --> method of spellchecker module to correct the word
31+
if spell.correction(word) != word:
32+
misspelledWords.append(word)
33+
34+
return misspelledWords
35+
36+
37+
def printErrors(errorList):
38+
"""This function is used to print the errors"""
39+
print("---------------------")
40+
print("Misspelled words are:")
41+
print("---------------------")
42+
for word in errorList:
43+
# candidates() --> method of spellchecker module to find suitable corrections of the word
44+
print(f"{word} : {spell.candidates(word)}")
45+
46+
47+
def correctErrors(errorList):
48+
"""This function is used to correct the errors and
49+
write the corrected text in output.txt file"""
50+
# open a new file to write the corrected text
51+
outputFile = open("output.txt", "w")
52+
for word in tokens:
53+
if word in errorList:
54+
# if word is incorrect we replace it with the corrected word
55+
word = spell.correction(word)
56+
57+
# this writes text to the new output.txt file
58+
outputFile.write(" ".join(tokens))
59+
60+
outputFile.close()
61+
62+
63+
def main():
64+
"""This is the main function"""
65+
textFile = input("Enter text file: ")
66+
67+
textList = readTextFile(textFile)
68+
errorList = findErrors(textList)
69+
70+
# if there are no errors
71+
if len(errorList) == 0:
72+
print("No errors detected")
73+
return
74+
75+
# call to printErrors function
76+
printErrors(errorList)
77+
78+
# ask if user needs to correct the text
79+
user_answer = input("Do you want to auto correct the errors, Y/N ? ")
80+
81+
if user_answer.lower() == "y" or user_answer.lower() == "yes":
82+
# call to correctErrors function
83+
correctErrors(errorList)
84+
print("-------------------------------------------------")
85+
print("Check the output.txt file for the corrected text.")
86+
print("-------------------------------------------------")
87+
print("Thankyou for using spelling checker program.")
88+
else:
89+
print("--------------------------------------------")
90+
print("Thankyou for using spelling checker program.")
91+
print("--------------------------------------------")
92+
93+
94+
# call to the main function
95+
main()
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
This free software tool helps you automaticaly produce misspelled text from the correct one.
2+
Pytohn is an intrepreted high-leelv genreal-puprsoe prgoramimng language. Pyhton's design philospohy emhpasizes code readabiilty with its ntaoble ues of sginiifcant indentation. Its lanugage constructs as wlel as its obejtc-orientde approach ami to hlep prgroammres write clear, lgocial code fro samll adn lrage-scale projcets.[30]
3+
4+
Ptyhon is dynamically-typde adn garbage-colcleted. It supoprts mlutiple prgoramimng paardigms, including strcutrued (paritcluarly, procedural), ojbect-oriented adn funcitonal programming. Pytonh is often descbried as a "batetires incluedd" language due to ist copmrehensive standard library.[31]
5+
6+
Giduo van Rossum began wokring on Pythno in the laet 198s0, as a succsesor to the ABC prgoarmming lagnuage, and frist released it in 1919 as Ptyhon 0.9.0.[32] Pyhton 2.0 was releasde in 2000 and introduced nwe featrues, schu as list comprehenisons adn a garbage colcletion ssytme usngi refrenece coutnnig adn was dsicontinued with version 2.7.18 in 2002.[33] Pythno 3.0 wsa releasde in 2008 and wsa a major rveiison of the lagnuage taht is nto comlpetely bacwkard-compatible and much Pytohn 2 cdoe does not run unmodified on Python 3.
7+
8+
Python consistetnly ranks as one of teh mots populra prorgamming lagnuages.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /