16
loading...
This website collects cookies to deliver better user experience
copy()
and paste()
functions that can send a text to and receive text from your computer’s clipboard. Sending the output of your program to the clipboard will make it easy to paste it on an email, word processor, or some other software pip install pyperclip
# Python program to
# demonstrate pyperclip module
# This will import pyperclip
import pyperclip
pyperclip.copy("Hello, buddies!")
pyperclip.paste()
pyperclip.copy("This is an interesting module!")
pyperclip.paste()
pip install emoji
from emoji import emojize
print(emojize(":laptop:"))
encode()
function can be used from emojis module to convert Unicode to emojis:import emojis
emojified = emojis.encode("There is a :snake: in my boot !")
print(emojified)
pip install wikipedia
import wikipedia
result = wikipedia.page("Python Programming Language")
print(result.summary)
pip install howdoi
howdoi make trees in Python
howdoi commit in git
howdoi
!pip install antigravity
import antigravity
urllib.request
for opening and reading.urllib.robotparser
for parsing robot.txt filesurllib.parse
for parsing URLsurllib.error
for the exceptions raisedpip install urllib
# This will import urlopen
# class from urllib module
from urllib.request import urlopen
page = urlopen("https://mr-unity-buddy.hashnode.dev/")
print(page.headers)
read()
function:# This will import urlopen
# class from urllib module
from urllib.request import urlopen
page=urlopen("http://hashnode.com")
# Fetches the code
# of the web page
content = page.read()
print(content)
# This will import turtle module
import turtle
myTurtle = turtle.Turtle()
myWin = turtle.Screen()
# Turtle to draw a spiral
def drawSpiral(myTurtle, linelen):
myTurtle.forward(linelen)
myTurtle.right(90)
drawSpiral(myTurtle, linelen-10)
drawSpiral(myTurtle, 80)
myWin.exitonclick()