python_examples
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
python_examples [2018/01/05 15:52] – g00r00 | python_examples [2018/01/05 15:56] – g00r00 | ||
---|---|---|---|
Line 4: | Line 4: | ||
* [[python_examples# | * [[python_examples# | ||
+ | * [[python_examples# | ||
----- | ----- | ||
Line 123: | Line 124: | ||
writeln(" | writeln(" | ||
+ | |||
+ | </ | ||
+ | |||
+ | ----- | ||
+ | ===== MCI Helper Functions ===== | ||
+ | |||
+ | <file python mcihelp.mpy> | ||
+ | |||
+ | import mystic_bbs as bbs; | ||
+ | |||
+ | def stripmci (str): | ||
+ | pos = str.find(" | ||
+ | |||
+ | while pos != -1: | ||
+ | str = str[:pos] + str[pos+3:] | ||
+ | pos = str.find(" | ||
+ | |||
+ | return str | ||
+ | |||
+ | def mcilen (str): | ||
+ | |||
+ | return len(stripmci(str)) | ||
+ | |||
+ | |||
+ | text = " | ||
+ | |||
+ | bbs.rwriteln(stripmci(text)); | ||
+ | bbs.rwriteln(str(mcilen(text))) | ||
+ | |||
+ | bbs.writeln(" | ||
</ | </ |
python_examples.txt · Last modified: 2019/03/09 21:40 by g00r00