DEV Community

Cover image for Useful Minor Python Projects. Easy to Understand :)
Rizmy Abdulla πŸŽ–οΈ
Rizmy Abdulla πŸŽ–οΈ

Posted on

Useful Minor Python Projects. Easy to Understand :)

1.Auto Capture Screenshot And save

import pyautogui
import time

i = 1
n = 1
while i < 10000:
    #this Pics Will Save Your Desktop
    pg = pyautogui.screenshot('screenshot{}.png'.format(n))
    i=i+1
    n=n+1
    time.sleep(10)
Enter fullscreen mode Exit fullscreen mode
  • import pyautogui this program needs pyautogui package, you can easily install this Package by pip install pyautogui running this command on Your CMD.

  • pg = pyautogui.screenshot() in this line assigning pyautogui.screenshot() function to pg variable.

2.Send Mail Using Python (smtplib)

import smtplib

server = smtplib.SMTP_SSL('smtp.gmail.com', 465)
server.login("your username", "your password")
server.sendmail(
  "from@address.com", 
  "to@address.com", 
  "this message is from python")
server.quit()

Enter fullscreen mode Exit fullscreen mode
  • import smtplib this program needs smtplib package, you can easily install this Package by pip install smtplib running this command on Your CMD.

smtplib.SMTPAuthenticationError: Please log in via your web browser and then try again. Learn more at https://support.google.com/mail/answer/78754

-if You Got this error, there is nothing wrong with the code.You can fix this issue by navigating google less secure app access and allowing less secure apps.

More Projects Updating Soon

Top comments (0)