Skip to content

Latest commit

 

History

History
172 lines (120 loc) · 2.79 KB

0.x_en.md

File metadata and controls

172 lines (120 loc) · 2.79 KB

Meo v0.x - Document

You can find the introduction of almost all modulars here.

Context

Usage

import meo

io

I/O for your file.

io.load_json()

data = meo.load_json("your/file/path")

io.to_json()

meo.to_json(obj, "your/path/to/save")

io.load_file()

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')

flask

flask.allow_cors()

allow cors

from flask import Flask
import meo

app = Flask("__main__")
meo.flask.allow_cors(app)

net

net.UserAgent

screen

screen.red_font():

print text in terminal with red color.

meo.screen.red_font("meo")

screen.green_font():

print text in terminal with green color.

meo.screen.green_font("meo")

screen.blue_font():

print text in terminal with blue color.

meo.screen.blue_font("meo")

screen.sformat():

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)

screen.clear_screen():

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: ")

sound

play sound

sound.WindowsBeeper

nitialize a Windows beep instance

sound.Beeper

nitialize a beep instance (windows-only now)

play sound in 1000 freq and 500ms duration:

beeper = meo.sound.Beeper(1000)
beeper.play(500)

sound.beep()

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
)