Learn shortcuts to automate simple, everyday tasks.
Check if you have python3 installed by typing the following in the cmd or terminal.
$ python3 --version
Follow the guide by Django Girls
- trello-youtube-dl
- address-finder
- pretty-episode-name
What you usually do is,
- Navigate to the folder & display the list of files
- Enter the extension of the files to rename
- Get the SEASON NUMBER from the old name
- List old name and new name & confirm RENAMING
With python3 active on your terminal or cmd use the following commands to learn:
# basics of os and navigation
import os
os.name
os.getcwd()
os.chdir('path') # windows (C:\Desktop\csi-python-scripts) & use "" for spaces
os.path.splitext(x)[-1] # to get the file extension
for x in os.listdir():
print(os.path.splitext(x)[-1],'\n')
# Let's rename the cover photo:
os.rename('cover.jpg', 'art.jpg')
# Regex - identify the season name
for i in os.listdir():
print(re.findall("S..E..",i))
- What are packages or modules in python?
- Why use pip?
- Tutorial
import bs4
from bs4 import BeautifulSoup as soup
from urllib.request import urlopen as uReq
my_url="http://www.cricbuzz.com/"
Client=uReq(my_url)
html_page=Client.read()
Client.close()
soup_page=soup(html_page,"html.parser")
score_box=soup_page.findAll("div",{"class":"cb-col cb-col-25 cb-mtch-blk"})
l = len(score_box)
print(l)
for i in range(l):
print(score_box[i].a["title"])
print(score_box[i].a.text)
print()
- https://github.com/geekcomputers/Python
- https://github.com/realpython/python-scripts
- https://github.com/averagesecurityguy/Python-Examples
- http://www.geeksforgeeks.org/facebook-login-using-python/
- Akshay Gugale - akigugale
- Hitesh Mandhyan - Hitesh-VIT
- Palash Golecha - palashgo
- Pradyun Gedam - pradyunsg