You can find the introduction of almost all modulars here.
import meo
I/O for your file.
data = meo.load_json("your/file/path")
meo.to_json(obj, "your/path/to/save")
read in bytes
data = meo.load_file("your/file/path", 'rb')
Read the file in the specified encoding format.
data = meo.load_file('your/file/path', 'r', 'utf8')
allow cors
from flask import Flask
import meo
app = Flask("__main__")
meo.flask.allow_cors(app)
print text in terminal with red color.
meo.screen.red_font("meo")
print text in terminal with green color.
meo.screen.green_font("meo")
print text in terminal with blue color.
meo.screen.blue_font("meo")
Apply one or more styles to text
for example, following code can print text with red color and yellow background color.
import meo.screen as screen
style_text = screen.sformat(
"meo",
screen.FORMAT_FONT_RED,
screen.FORMAT_BG_YELLOW
)
print(style_text)
clear your terminal like ctrl
+ L
in linux
meo.screen.clear_screen()
screen.hidden_input()
hide user input. Usually used in ask password.
pwd = meo.screen.hidden_input("Please input your psw: ")
play sound
nitialize a Windows beep instance
nitialize a beep instance (windows-only now)
play sound in 1000 freq and 500ms duration:
beeper = meo.sound.Beeper(1000)
beeper.play(500)
Function call beep, supporting multi-threaded operation
import meo
meo.sound.beep(
1000, # freq
500, # duration
2, # play count
1000, # interval
True # play in new thread
)