diff --git a/README.md b/README.md index 16131c4..50a345b 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Contents **   ** **1. Collections:** ** ** **[`List`](#list)**__,__ **[`Dictionary`](#dictionary)**__,__ **[`Set`](#set)**__,__ **[`Tuple`](#tuple)**__,__ **[`Range`](#range)**__,__ **[`Enumerate`](#enumerate)**__,__ **[`Iterator`](#iterator)**__,__ **[`Generator`](#generator)**__.__ **   ** **2. Types:** **          ** **[`Type`](#type)**__,__ **[`String`](#string)**__,__ **[`Regular_Exp`](#regex)**__,__ **[`Format`](#format)**__,__ **[`Numbers`](#numbers)**__,__ **[`Combinatorics`](#combinatorics)**__,__ **[`Datetime`](#datetime)**__.__ **   ** **3. Syntax:** **         ** **[`Args`](#arguments)**__,__ **[`Inline`](#inline)**__,__ **[`Closure`](#closure)**__,__ **[`Decorator`](#decorator)**__,__ **[`Class`](#class)**__,__ **[`Duck_Types`](#duck-types)**__,__ **[`Enum`](#enum)**__,__ **[`Exceptions`](#exceptions)**__.__ -**   ** **4. System:** **        ** **[`Print`](#print)**__,__ **[`Input`](#input)**__,__ **[`Command_Line_Arguments`](#command-line-arguments)**__,__ **[`Open`](#open)**__,__ **[`Path`](#path)**__,__ **[`Command_Execution`](#command-execution)**__.__ +**   ** **4. System:** **        ** **[`Print`](#print)**__,__ **[`Input`](#input)**__,__ **[`Command_Line_Arguments`](#command-line-arguments)**__,__ **[`Open`](#open)**__,__ **[`Path`](#path)**__,__ **[`Command_Execution`](#oscommands)**__.__ **   ** **5. Data:** **             ** **[`CSV`](#csv)**__,__ **[`SQLite`](#sqlite)**__,__ **[`JSON`](#json)**__,__ **[`Pickle`](#pickle)**__,__ **[`Bytes`](#bytes)**__,__ **[`Struct`](#struct)**__,__ **[`Array`](#array)**__,__ **[`MemoryView`](#memory-view)**__,__ **[`Deque`](#deque)**__.__ **   ** **6. Advanced:** **   ** **[`Threading`](#threading)**__,__ **[`Operator`](#operator)**__,__ **[`Introspection`](#introspection)**__,__ **[`Metaprograming`](#metaprograming)**__,__ **[`Eval`](#eval)**__,__ **[`Coroutine`](#coroutine)**__.__ **   ** **7. Libraries:** **      ** **[`Progress_Bar`](#progress-bar)**__,__ **[`Plot`](#plot)**__,__ **[`Table`](#table)**__,__ **[`Curses`](#curses)**__,__ **[`Logging`](#logging)**__,__ **[`Scraping`](#scraping)**__,__ **[`Web`](#web)**__,__ **[`Profile`](#profiling)**__,__ @@ -1613,8 +1613,8 @@ cwd = Path() ``` -Command Execution ------------------ +OS Commands +----------- ### Files and Directories * **Paths can be either strings, Paths, or DirEntry objects.** * **Functions report OS related errors by raising either OSError or one of its [subclasses](#exceptions-1).** @@ -1684,6 +1684,8 @@ b'.\n..\nfile1.txt\nfile2.txt\n' CSV --- +**Text file format for storing spreadsheets.** + ```python import csv ``` @@ -1949,16 +1951,16 @@ from array import array Memory View ----------- -* **Memory View is a seqence that points to the memory of bytes, bytearray or array objects.** -* **Each element can reference a single or multiple consecutive bytes.** -* **Referenced elements can be narrowed down with slicing.** +* **A seqence object that points to the memory of another object.** +* **Each element can reference a single or multiple consecutive bytes, depending on format.** +* **Order and number of elements can be changed with slicing.** ```python = memoryview() = [] # Can be int or float. = [] # Mview with rearanged elements. - = .cast('') # Cast a memoryview to a new format. -.release() # Releases the buffer. + = .cast('') # Casts a memoryview to a new format. +.release() # Releases the object's memory buffer. ``` ```python @@ -2237,6 +2239,7 @@ def printer(): reader(adder(printer())) # 100, 101, ..., 109 ``` +
Libraries diff --git a/index.html b/index.html index 90a5ee7..6e7a246 100644 --- a/index.html +++ b/index.html @@ -213,7 +213,7 @@ pre.prettyprint { '1. Collections': [List, Dictionary, Set, Tuple, Range, Enumerate, Iterator, Generator], '2. Types': [Type, String, Regular_Exp, Format, Numbers, Combinatorics, Datetime], '3. Syntax': [Args, Inline, Closure, Decorator, Class, Duck_Types, Enum, Exceptions], - '4. System': [Print, Input, Command_Line_Arguments, Open, Path, Command_Execution], + '4. System': [Print, Input, Command_Line_Arguments, Open, Path, Command_Execution], '5. Data': [CSV, SQLite, JSON, Pickle, Bytes, Struct, Array, MemoryView, Deque], '6. Advanced': [Threading, Operator, Introspection, Metaprograming, Eval, Coroutine], '7. Libraries': [Progress_Bar, Plot, Table, Curses, Logging, Scraping, Web, Profile, @@ -1469,7 +1469,7 @@ value = args.<name> <Path> = <Path>.parent # Returns path without final component. <file> = open(<Path>) # Opens the file and returns a file object. -

#Command Execution

Files and Directories

    +

    #OS Commands

    Files and Directories

    • Paths can be either strings, Paths, or DirEntry objects.
    • Functions report OS related errors by raising either OSError or one of its subclasses.
    import os, shutil
    @@ -1515,9 +1515,10 @@ shutil.copytree(from, to)          # Copies the entir
     0
     
    -

    #CSV

    import csv
    +

    #CSV

    Text file format for storing spreadsheets.

    import csv
     
    +

    Read

    <reader> = csv.reader(<file>, dialect='excel', delimiter=',')
     <list>   = next(<reader>)           # Returns next row as a list of strings.
     <list>   = list(<reader>)           # Returns list of remaining rows.
    @@ -1728,14 +1729,14 @@ db = connector.connect(host=<str>, user=<str>, password=<str>,
     
     
     

    #Memory View

      -
    • Memory View is a seqence that points to the memory of bytes, bytearray or array objects.
    • -
    • Each element can reference a single or multiple consecutive bytes.
    • -
    • Referenced elements can be narrowed down with slicing.
    • +
    • A seqence object that points to the memory of another object.
    • +
    • Each element can reference a single or multiple consecutive bytes, depending on format.
    • +
    • Order and number of elements can be changed with slicing.
    <mview> = memoryview(<bytes/bytearray/array>)
     <num>   = <mview>[<index>]                     # Can be int or float.
     <mview> = <mview>[<slice>]                     # Mview with rearanged elements.
    -<mview> = <mview>.cast('<typecode>')           # Cast a memoryview to a new format.
    -<mview>.release()                              # Releases the buffer.
    +<mview> = <mview>.cast('<typecode>')           # Casts a memoryview to a new format.
    +<mview>.release()                              # Releases the object's memory buffer.
     
    @@ -1943,6 +1944,7 @@ ValueError: malformed node or string reader(adder(printer())) # 100, 101, ..., 109
    +


    Libraries

    #Progress Bar

    # $ pip3 install tqdm
     from tqdm import tqdm
     from time import sleep
    diff --git a/parse.js b/parse.js
    index f7bf668..f0a3054 100755
    --- a/parse.js
    +++ b/parse.js
    @@ -22,7 +22,7 @@ const TOC =
       '    \'1. Collections\': [List, Dictionary, Set, Tuple, Range, Enumerate, Iterator, Generator],\n' +
       '    \'2. Types\':       [Type, String, Regular_Exp, Format, Numbers, Combinatorics, Datetime],\n' +
       '    \'3. Syntax\':      [Args, Inline, Closure, Decorator, Class, Duck_Types, Enum, Exceptions],\n' +
    -  '    \'4. System\':      [Print, Input, Command_Line_Arguments, Open, Path, Command_Execution],\n' +
    +  '    \'4. System\':      [Print, Input, Command_Line_Arguments, Open, Path, Command_Execution],\n' +
       '    \'5. Data\':        [CSV, SQLite, JSON, Pickle, Bytes, Struct, Array, MemoryView, Deque],\n' +
       '    \'6. Advanced\':    [Threading, Operator, Introspection, Metaprograming, Eval, Coroutine],\n' +
       '    \'7. Libraries\':   [Progress_Bar, Plot, Table, Curses, Logging, Scraping, Web, Profile,\n' +