易于使用的实用程序:警报、日志记录、运行后台进程、文件和目录检查

easy-utils的Python项目详细描述


我在多个项目中使用过的函数,在本自述文件中有更多信息

#alert(alarm, x) counts down from x and prints int x and a string alarm to console

alert('Till countdown', 10)

#check_dir(child, parent) looks for a child directory in a parent directly, if there is no child dir then one is created 

check_dir('log', '~')

#check_file(fname, file_dest) ensures that a file is not in a directory, if it is not in the directory then the a path is provided for file creation 

check_file('somefile.txt', '~/projects')

#log_it(text, dest_dir) takes in string text and a string file destination folderand creates a file named with timestamp

log_it('this is a test', './log/')

#run_in_background(args) takes in a string shell command and runs it as a background process
 run_in_background('firefox')

#limit_proc(proc,limit) takes in a string process name and an int limit, limit represents a threshold of a certain process. If limit is reached then a simple spinlock activates and activly waits until the process count is no longer at the limit

limit_proc('curl', 5)

#kill_proc(proc) takes in a string process name and kills processes with that name

kill_proc('curl')

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何在带注释的SpringMVC中验证模型中图像的mime类型?   java无法打开Google地图活动。安卓   在另一个类文件中调用时返回空值的java getter   spring引导服务中的java线程   什么版本的Java可以使用Liquibase Maven插件?   原因:java。lang.UnsupportedOperationException:BigQuery源必须在读取之前拆分   需要java模式建议(Hibernate+Guice)   java如何在netbeans中的两个帧之间传输数据?   java在Eclipse中创建新项目,然后将其添加到Mercurial repo中   为什么打印0100用Java打印64?   java如何使用Jackson@JsonFormat注释在序列化时格式化字符串?   bash如何将java库包含到shell脚本中   java如何使我的片段利用我的活动数据?   JButton中的java波动