What s the coolest thing you ve ever done using Python

+7 votes

Python is a very versatile programming language and can be used in almost any field today. So, unsurprisingly, people all around the world have managed to build extraordinary games, applications, projects, and software on Python.

Edureka community would like to give you the opportunity to showcase your Python knowledge and your ability to build something awesome.

Post your coolest Python code here and get a chance to win the Edureka t-shirt and a self-paced course.

The deadline for submissions is 25th December 2019

Nov 21, 2019 in Python by Edureka
• 2,960 points
I have made a Restaurant Management System project in Python using the Python's GUI library Tkinter. It is my first ever project in Python.
Hey @Riya, I hope you are doing well.

Could you please post this as an answer instead of a comment. Also, please describe your project in detail and if possible share the code(you can hide the sensitive data).

Thank you

4 answers to this question.

+2 votes
I have made a Flask chatbot using python's Chatterbot library that responds to the questions in the template.

I have also made a speech to text, model using the python's speechrecognition library that takes speech as input and also opens a webpage using the query taken from the speech.
answered Nov 22, 2019 by Mohammad
• 3,230 points
Hi @Mohammad, can you please share the code or your GitHub repo, wherever the code exists.

You need to either show the code or the screenshots of your app to qualify for this contest.
+1 vote

As a kid, I am sure everybody has played the famous snake game. As a matter of fact, it was one of the first mobile games that came into the market. Wouldn’t it be cool to build it by yourself? Hell Yeah! I have used Python’s Turtle Module to build the game from scratch.

There are two elements in this game – snake and food. The player has to move the snake such that it touches(eats) the food and grows in size. The snake dies if it touches its own body or the boundaries of the window. On an obvious note, the player needs to win and hence avoid dying.

import turtle
import time
import random

delay = 0.1

# score
score = 0
high_score = 0

#set up the screen
wn = turtle.Screen()
wn.title("snake game")
wn.setup(width=600, height=600)

#Snake Head
head = turtle.Turtle()
head.goto(0, 100)
head.direction = "stop"

# Snake food
food = turtle.Turtle()
food.shapesize(0.50, 0.50)
food.goto(0, 0)

segments = []

pen = turtle.Turtle()
pen.goto(0, 260)
pen.write("Score: 0 High Score: {}".format(high_score), align="center", font=("Courier", 24, "normal"))

# Functions

def go_up():
    if head.direction != "down":
        head.direction = "up"

def go_down():
    if head.direction != "up":
        head.direction = "down"

def go_right():
    if head.direction != "left":
        head.direction = "right"

def go_left():
    if head.direction != "right":
        head.direction = "left"

def move():
    if head.direction == "up":
        y = head.ycor() #y coordinate of the turtle
        head.sety(y + 20)

    if head.direction == "down":
        y = head.ycor() #y coordinate of the turtle
        head.sety(y - 20)

    if head.direction == "right":
        x = head.xcor() #y coordinate of the turtle
        head.setx(x + 20)

    if head.direction == "left":
        x = head.xcor() #y coordinate of the turtle
        head.setx(x - 20)

# keyboard bindings
wn.onkey(go_up, "w")
wn.onkey(go_down, "s")
wn.onkey(go_right, "d")
wn.onkey(go_left, "a")

# Main game loop
while True:

    # Check for collision
    if head.xcor() > 290 or head.xcor() < -290 or head.ycor() > 290 or head.ycor() < -290:
        head.goto(0, 0)
        head.direction = "stop"

        # Hide the segments
        for segment in segments:
           segment.goto(1000, 1000)

        # clear segment list
        segments = []

        # reset score
        score = 0

        # update score
        pen.write("score: {} High Score: {}".format(score, high_score), align="center", font=("Courier", 24, "normal"))

    if head.distance(food) < 15:
        # move the food to a random position on screen
        x = random.randint(-290, 290)
        y = random.randint(-290, 290)
        food.goto(x, y)

        # add a segment
        new_segment = turtle.Turtle()

        # Increase the score
        score = score+10

        if score > high_score:
            high_score = score

    # move the end segment in reverse order
    for index in range(len(segments)-1, 0, -1):
        x = segments[index-1].xcor()
        y = segments[index-1].ycor()
        segments[index].goto(x, y)

        # Move segment 0 to where the head is
    if len(segments) > 0:
        x = head.xcor()
        y = head.ycor()
        segments[0].goto(x, y)


    # Check for head collision
    for segment in segments:
        if segment.distance(head) < 20:
            head.goto(0, 0)
            head.direction = "stop"

    # Hide the segments
            for segment in segments:
                segment.goto(1000, 1000)

    # clear segment list

    # reset score
            score = 0

    # update score
            pen.write("score: {} High Score: {}".format(score, high_score), align="center", font=("Courier", 24, "normal"))
answered Nov 26, 2019 by Kalgi
• 52,360 points
+2 votes

Python is an extremely interesting language. you can experiment and do so much with just few lines of code. I have used python for various projects. One of them was A Text to Speech recognition system which converted the texts into speech. so you could write anything and that would be converted into an audio file. the code was entirely written in python and it was quite simple and less chaotic!

# Requires PyAudio and PySpeech.
import speech_recognition as sr
from time import ctime
import time
import os
from gtts import gTTS
import pyglet
import subprocess
def speak(audioString):
    tts = gTTS(text=audioString, lang='en')
    #os.system("mpg321 audio.mp3")

    wmp = r"C:\Program Files (x86)\Windows Media Player\wmplayer.exe"
    media_file = os.path.abspath(os.path.realpath("C:\\Users\\sundush_n\\Desktop\\Text2speech\\audio.mp3"))
    p = subprocess.call([wmp, media_file])
def recordAudio():
    # Record Audio
    r = sr.Recognizer()
    with sr.Microphone() as source:
        print("Say something!")
        audio = r.listen(source)
    # Speech recognition using Google Speech Recognition
    data = ""
        # Uses the default API key

        # To use another API key: `r.recognize_google(audio, key="GOOGLE_SPEECH_RECOGNITION_API_KEY")`
        data = r.recognize_google(audio)
        print("You said: " + data)
    except sr.UnknownValueError:
        print("Google Speech Recognition could not understand audio")
    except sr.RequestError as e:
        print("Could not request results from Google Speech Recognition service; {0}".format(e))
    return data
def stan(data):
    if "how are you" in data:
        speak("I am fine")
    if "what time is it" in data:
    if "where is" in data:
        data = data.split(" ")
        location = data[2]
        speak("Hold on Tini, I will show you where " + location + " is.")
        os.system("chromium-browser https://www.google.nl/maps/place/" + location + "/&amp;")

# initialization
speak("Hi Tini, what can I do for you?")
while 1:
   data = recordAudio()
answered Nov 27, 2019 by Tini
0 votes

Well, I've been using Python as a tool for around 2 years. It's pseudocode like syntax is helps you to write short and easy to understand codes. There is one script I have created using google api which was capable of fetching data from my google drive. It is quite easy with all the documentation there: https://developers.google.com/drive/api/v3/quickstart/python. You have to enable the API beforehand: https://developers.google.com/drive/api/v3/enable-drive-api

answered Nov 28, 2019 by Sumeet
• 140 points

Related Questions In Python

+2 votes
3 answers

How can I play an audio file in the background using Python?

down voteacceptedFor windows: you could use  winsound.SND_ASYNC to play them ...READ MORE

answered Apr 4, 2018 in Python by charlie_brown
• 7,720 points
0 votes
2 answers

how to print the current time using python?

print(datetime.datetime.today()) READ MORE

answered Feb 14, 2019 in Python by Shashank
• 1,370 points
0 votes
1 answer

What's the canonical way to check for type in Python?

To check if o is an instance ...READ MORE

answered Aug 24, 2018 in Python by Priyaj
• 58,090 points
+1 vote
1 answer

What's the difference between eval, exec, and compile in Python?

exec is not an expression: a statement ...READ MORE

answered Aug 28, 2018 in Python by Priyaj
• 58,090 points
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,221 views
0 votes
1 answer
+5 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,790 points
0 votes
1 answer

how do I check the length of an array in a python program?

lets say we have a list mylist = ...READ MORE

answered Mar 12, 2019 in Python by Mohammad
• 3,230 points
0 votes
2 answers

what is the procedure to the version of python in my computer?

Execute the following command on your terminal: python ...READ MORE

answered Mar 20, 2019 in Python by Alia
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP