-
Notifications
You must be signed in to change notification settings - Fork 30
05 How does cp work
- Introduction
- utils.py
- parse.py
- class Base
- class Logpath
- class Clock
- class Command
- class Call
- class Parser
- main.py
- Summary
If you haven't already, you may want to take a look at the Overview, Getting Started, and What is cp? sections before getting started with this page.
They explain, in a tutorial like fashion, how to get started and may answer any other basic questions you may have. They also set the foundation for the rest of the API descriptions.
Please note that this API is always subject to change if and when a better solution is committed. Think of the code as a guideline rather than a rule of thumb.
This documentation may or may not reflect the current state of the repository. However, the general ideas should remain alive.
I do dive in to weeds on this one and this is all pretty basic stuff as it is. If you haven't learned this stuff already, or failed to have a solid grasp on what was going, this should clear things up for you.
Now, off to the weeds.
This is a simple module. It contains any utility based functions or classes. For example, this module simply holds a single function called clear.
- n/a
from sys import platform
from os import system
def clear():
if 'win32' == platform:
system('cls')
else:
system('clear')
We can load up the module in python like so.
$ pwd
/home/th3ros/Documents/github/atom-python-run/cp
$ python
Python 3.6.3 (default, Oct 24 2017, 14:48:20)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from cp.utils import clear
>>> clear()
> clears the screen <
That's really all this module does. It just clears the screen.