I am Learning Python.

I want to screen scrape

https://speakerdeck.com/pycon2017 Slides from Py.com 2017

https://speakerdeck.com/pycon2017/al-sweigart-yes-its-time-to-learn-regular-expressions?slide=8

Installing Visual Studio Code Editor for Python https://code.visualstudio.com/docs/python/python-tutorial

Firedays (Why did I not document the code to do this)

I found the code to the firedays program

There is this concept of the pythonic way of doing things which is codified in stuff like PEP8 and other python enhancement proposals. Possibly worth having a read as there are some good tricks and practices in there.

Automate Python Scripts in Windows

Learn Ptyhon The Hard Way Subscription details Learn Ptyhon the hard way Book

The login is my email address
rupert@rupert.id.au

The  video tutorials are online at: https://shop.learncodethehardway.org/products/contents/9/

 

 

>>> import pyautogui
>>> pyautogui.mouseInfo()

https://automatetheboringstuff.com/2e/chapter20/

 

 

 

https://automatetheboringstuff.com/

Order complete

Your order is complete! Your order number is 182069. Thank you for shopping at No Starch Press. Your current order has been attached to the account we found matching your e-mail address. Login to view your current order status and order history. Remember to login when you make your next purchase for a faster checkout experience! If your order included any ebooks, you can download them at any time from the Files tab in your account. Learn more about ebooksReturn to the front page.

rupert,
Thank you for registering at No Starch Press. You may now log in to https://nostarch.com/user using the following username:
username: rupert

Automate2e PDF

Automate2e Mobi

Automate2e ePub

 

>>> import pyautogui

>>> pyautogui.mouseInfo()

 

 

 

Run Power Shell

Change Diectory to C:\Doc\p\python

python ex1.py

 

Power Shell Commands eg: Get-CimInstance -ClassName Win32_ComputerSystem

 

 

From: https://www.youtube.com/watch?v=0sOfhhduqks&feature=emb_err_woyt

 

 

Counting Things:

https://codefisher.org/catch/blog/2015/04/22/python-how-group-and-count-dictionaries/

from collections import Counter
names = ["mark", "john", "john", "mark", "fred", "paul", "john", "rupert", "rupert","rupert","rupert",]
d = Counter(names)
print(d)

 

this returns a dict-like object (a dict subclass actually), which should be good enough for our purposes, so we’ll stick with it.

 

Count and sort

 

 

---

 

Hotkeys for AIKEN file conversion

#! python3
# Automatically replace
# a with ANSWER: A
# b with ANSWER: B
# c with ANSWER: C
# d with ANSWER: D

# https://pypi.org/project/keyboard/

import keyboard
import pyautogui

def on_triggered_1():
pyautogui.press('backspace')
pyautogui.press('enter')
pyautogui.press('enter')
pyautogui.press('enter')
pyautogui.write('ANSWER: A')
pyautogui.press('enter')

keyboard.add_hotkey('a', on_triggered_1)

def on_triggered_2():
pyautogui.press('backspace')
pyautogui.press('enter')
pyautogui.press('enter')
pyautogui.press('enter')
pyautogui.write('ANSWER: B')
pyautogui.press('enter')

keyboard.add_hotkey('b', on_triggered_2)

def on_triggered_3():
pyautogui.press('backspace')
pyautogui.press('enter')
pyautogui.press('enter')
pyautogui.press('enter')
pyautogui.write('ANSWER: C')
pyautogui.press('enter')

keyboard.add_hotkey('c', on_triggered_3 )

def on_triggered_4():
pyautogui.press('backspace')
pyautogui.press('enter')
pyautogui.press('enter')
pyautogui.press('enter')

pyautogui.write('ANSWER: D')
pyautogui.press('enter')

keyboard.add_hotkey('d', on_triggered_4 )

def on_triggered_5():
pyautogui.press('backspace')
pyautogui.press('enter')
pyautogui.press('enter')
pyautogui.press('enter')

pyautogui.write('ANSWER: E')
pyautogui.press('enter')

keyboard.add_hotkey('e', on_triggered_5 )

print("Press ESC to stop.")
keyboard.wait('esc')