pysep.misc package

Submodules

pysep.misc.stringf module

Author: Thomas M. Boudreaux

Created: March 2022

Last Modified: March 2022

String formating utilities

Functions

remove_comments(str) -> Tuple[str, list[str]

Record and then remove all comments from a string. Comments are considered anything starting with a # and ending at the new line (not including the newline.

pysep.misc.stringf.remove_comments(string: str) Tuple[str, list]

Record and then remove all comments from a string. Comments are considered anything starting with a # and ending at the new line (not including the newline.

stringstr

String which will have comments recorded and removed

cleanedStringstr

string but with all comments removed. Total number of lines will remain the same

commentslist[str]

List of all comments (without # and

) for use later

>>> testString = "No Comment

# Comment Line Partial # CommentLine “

>>> newString, comments = remove_comments(testString)
>>> print(comments, newString)
[" Comment Line", " CommentLine"], "No Comment

Partial “

Note how the number of lines remained the same

Module contents

Miscellaneous parts of pysep which didnt really have anywhere else to go.