Template:Py
Jump to navigation
Jump to search
A little code box.
Usage
Each codeblock starts with a {{py|begin}}
and ends with a {{py|end}}
. Inside, you can specify some code which is specified by using {{py|[text]|[type]}}
, [type]
is optional.
{{py|indent}}
specifies one level of indent.
Example usage
import numpy as np
## comment1
if __name__ == "main":
print("Hello, world!")
{{py|begin|color=#404041}} {{py|import|key}} {{py|numpy}} {{py|as|key}} {{py|np}} {{py|## comment1|comment}} {{py|if|key}} {{py|__name__}} {{py|==|op}} {{py|"main"|str}}{{py|:}}<br /> {{py|indent}}{{py|print|func}}{{py|(}}{{py|"Hello, world!"|str}}{{py|)}} {{py|end}}