Python Class Random Notes

Table Of Contents

Unity Tweek Tool

Change Python (.py) files to use 4-space indents and no hard tab characters. Also trim excess spaces and tabs from ends of lines, and remove empty lines at the end of files. Also ensure the last line ends with a newline.

using PPA repository

sudo add-apt-repository ppa:freyja-dev/unity-tweak-tool-daily

sudo apt-get update

sudo apt-get install unity-tweak-tool

dir() a Class or Variable

For example:

import logging
dir(logging)

entries in all caps are constants
capitolized items are classes
items that start with lowercase letters are methods
entries starting with 1 or 2 underscores are private entries

Underscore

Understanding the underscore( _ ) of Python
What is the meaning of a single- and a double-underscore before an object name?

Libre Office

Turn off smart Quotes

Modify PATH Environment Variable

vim ~/.profile

find the following line

PATH="$HOME/bin:$PATH"

modify the path

PATH="$HOME/bin:$PATH:path-mod"
OR
 export PATH=$PATH:path-mod

~/.profile and ~/.bashrc

~/.profile is only run by interactive login shells.

~/.bashrc is run every time a bash shell is started.

vim

1. Disable auto indent temporarily to paste

Sometimes you only need to paste some snippet of code that already has indentation:
:set paste
then
:set nopaste