Python Beginner Projects #1

  • Shutdown Mac with Python
  • Random Password Generator with Python
  • Wall Clock Design with Python
  • QR-Code Generator with Python

Shutdown Mac with Python

import os
os.system("shutdown /s /t 1")

Random Password Generator with Python

import randomlower = "abcdefghijklmnopqrstuvwxyz"
upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
numbers = "0123456789"
symbols = "[]{}()*;/,_-"
all = lower + upper + numbers + symbols
length = 16
password = "".join(random.sample(all,length))
print(password)

Wall Clock Design with Python

import turtleimport randomclass analog:def __init__(self):self.color1 = random.random(), random.random(), random.random()self.color2 = random.random(), random.random(), random.random()turtle.screensize(canvwidth=600, canvheight=600)turtle.speed(10)turtle.ht()turtle.pensize(2)turtle.up()turtle.goto(-300, -300)turtle.color("blue")turtle.down()for _ in range(4):turtle.fd(600)turtle.lt(90)turtle.updef clockhand(self):turtle.goto(0, 0)turtle.lt(60)turtle.down()for i in range(1, 13):turtle.pensize(3)turtle.color("black")turtle.fd(250)turtle.write(i, font=("verdana", 15, "normal"))turtle.goto(0, 0)turtle.rt(30)def arrow(self):turtle.rt(90)turtle.begin_fill()for i in range(3):turtle.forward(8)turtle.left(120)turtle.forward(8)turtle.lt(90)turtle.end_fillif __name__ == "__main__":turtle.clearscreen()clock = analog()hour = 24hour = hour * 100minute = 1440clock.clockhand()from time import sleepsleep(90)

QR-Code Generator with Python

import pyqrcodeimport pngfrom pyqrcode import QRCodeQRstring = "https://www.instagram.com/p/CIPXGuTAXRD/"url = pyqrcode.create(QRstring)url.png('Desktop\\qr.png', scale = 8)

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

3 Things you might not know SASS can do

.Net Core Email Sender Library with Razor Templates contained in it — Caching Templates

Real-time Monitoring with Icinga2

How to start Symbol harvesting (staking) on the desktop wallet

Bringing Agile to an organization

Getting User Data from Snapchat API

How to fix Remote session was disconnected because there are no Remote Desktop client access…

Staty: View’s State Switching within MVVM Architecture

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Michelangelo Foschi

Michelangelo Foschi

More from Medium

Python for everyone: Mastering Python The Right Way

Learning Python in 2022

3 Reasons For Choosing Python as Your First Programming Language

Codechef Solutions — Beginner Level (Python) PART 3