User Tools

Site Tools


python_examples

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
python_examples [2018/01/05 15:52] g00r00python_examples [2018/01/05 16:01] g00r00
Line 1: Line 1:
 ====== Mystic Python Examples ====== ====== Mystic Python Examples ======
  
-This page contains examples of code using Mystic Python: +This page contains examples of code using Mystic Python.  Use 
- +the table of contents to jump to the various examples below.
-  * [[python_examples#Simple Message Reader|Simple Message Reader]]+
  
 ----- -----
Line 123: Line 122:
  
 writeln("|CR|12Program complete: Press a key|PN"); writeln("|CR|12Program complete: Press a key|PN");
 +
 +</file>
 +
 +-----
 +===== 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 = "|12This is a |14test";
 +
 +bbs.rwriteln(stripmci(text));
 +bbs.rwriteln(str(mcilen(text)))
 +
 +bbs.writeln("|PA")
  
 </file> </file>
python_examples.txt · Last modified: 2019/03/09 21:40 by g00r00

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki