Advanced python - Python Projects for beginners Part 1

PYTHON

Python Projects for beginners 
Fun with python


1. Music player in python

from pygame import mixer
from pygame import mixer
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html

mixer.init()
mixer.music.load("Surviva-SenSongsMp3.Co.mp3")
mixer.music.set_volume(0.7)
mixer.music.play()
while True:
    print("press p to press r to resume")
    print("press e to exit")
    query=input(">>>")
    if query=='p':
        mixer.music.pause()
    elif query=='r':
        mixer.music.unpause()
    elif query=='e':
        mixer.music.stop()
        break
press p to press r to resume
press e to exit
>>>e


2. emojis module

      You can implement emojis by using emojis python module.

import emojis

print(emojis.encode(":boat:"))
print(emojis.encode(":heart:"))
print(emojis.encode(":sunny:"))
print(emojis.encode(":star:"))

Output:
⛵
❤️
☀️
⭐



3. youtube downloader using python

pytube3 python library is very useful to download yotube videos.

pip install pytube3 
Collecting pytube3
Downloading pytube3-9.6.4-py3-none-any.whl (38 kB)
Collecting typing-extensions
Downloading typing_extensions-3.7.4.2-py3-none-any.whl (22 kB)
Installing collected packages: typing-extensions, pytube3
Note: you may need to restart the kernel to use updated packages.
Successfully installed pytube3-9.6.4 typing-extensions-3.7.4.2


from pytube import YouTube

YouTube('https://www.youtube.com/watch?v=0zz172zODiY').streams.get_highest_resolution().download()
'C:\\Users\\dinakaran\\MoviePy Tutorial 4 Combine videos.mp4'


For more about pytube3 library click here:

4 Notifier in python
By using win10toast package in python, we can create desktop notifications.

from win10toast import ToastNotifier

from win10toast import ToastNotifier

toast = ToastNotifier()

toast.show_toast("Notification","droidtutorials1.blogspot.com,duration=20")

True

Output:



5. Text to Speech:
pyttsx3 is a text to speech conversion python library.

1. Text to Speech

pyttsx3 is a text to speech conversion python library. For developing a personal assistant like ALEXA.

2.  For changing speech rate



3. For changing volume


6. pyautogui

pyautogui module is very useful to control mouse and keyboard. It is used to automate mouse cliks and keyboard press tasks.
Click here for more about pyautogui python module:

7. moviepy

moviepy python library is very useful to cutting, concat, editing, title insertions, video compositing, video processing, and creation of custom effects.moviepy can read and write all the most video and audio and gif formats.

1. Extract audio from video:

above code extract audio from video.

8. socket

To know your ip and hostname:

>>>import socket

>>>socket_type = socket.gethostname()
>>>ip  = socket.gethostbyname(socket_type)

>>>print("System Name:", socket_type)
>>>print("ip address:", ip)

Output:
System Name: albert
ip address: 192.168.43.70

9. Open a URL

To simply open a url:


import webbrowser

webbrowser.open("wwe.com")


Run the above code in Jupyter Notebook

10. pywhatkit


It is a python library for sending whatsapp message and other it has other features too.



1. To perform google search:




Above code perform google search.





For more about pywhatkit click here:

https://cyborgtutorials.blogspot.com/2020/05/pywhatkit-python-library.html

11. Sending email using python

install smtplib by using this command:
pip install secure_smtplib


import smtplib

message = 'Enter you message here’

#create SMTP session

s = smtplib.SMTP('smtp.gmail.com:587')
# Start TLS for security
s.starttls()

# Autentication
s.login(username,password)
s.sendmail(fromaddr, toaddrs, msg)

s.quit()

12. PYTHON libraries for Cyber security

  • impacket
  • Socket
  • mona
  • Requests/beautifulsoup
  • Scap/dpkt+pcapy
  • Python Nmap (libnmap)
13. Zip Extractor using python

from zipfile import ZipFile

filepath = r"C:\Users\system\Adventur.zip"

with  ZipFile(filepath,'r') as zip:
    zip.printdir()
    zip.extractall()

File Name                                             Modified             Size
Adventur.xml                                   2018-09-08 02:09:02       490038
Ask Your Question.txt                          2016-03-30 07:43:24          350
Blogger Templates.url                          2017-08-15 20:41:04           56
Date Setting Format.png                        2018-08-23 09:43:38        33268
How To Install Blogger Template.url            2017-08-15 20:40:42           88
Logo.png                                       2018-08-23 09:42:58         2723
Adventur Documentation.url                     2018-08-23 09:43:58          110
Adventur Video Documentation.url               2018-08-23 09:44:22           86





Comments