猫史档案馆


lsk666666

lsk666666

Lv.1

java党一个个人QQ:3075929352

获赞:29收藏:13浏览:504作品收藏:35

签名:肝个人网站ing…………

回复帖子评论
上一页4 页 / 共 18下一页

【Python作品分享】F_Coordinates【作品秀】 中回复

。。。

2020-06-25T17:12:04 点赞:0

【爬虫必备】编程猫社区的API 中回复

懂了,马上去重构我消息提醒的程序!

2020-06-26T09:43:17 点赞:0

求大佬帮忙 中回复

来了来了

 

2020-06-26T09:44:53 点赞:0

求大佬帮忙 中回复

蓝魂是啥?

2020-06-26T09:45:11 点赞:0

【爬虫必备】编程猫社区的API 中回复

center_imagewoc,连用户名都不删 吗

2020-06-26T10:04:36 点赞:0

python语音识别终极指南 中回复

用FFmpeg是给音频转码吧……

而且这玩意儿好像要自己编译……

2020-06-27T08:23:49 点赞:0

【求助贴】有没有人会让程序弹出Windows通知啊! 中回复

center_image

2020-06-27T08:26:22 点赞:0

【Python作品分享】上课用【求助帖】 中回复

???

2020-06-27T17:56:45 点赞:0

一起开发轻量开源论坛框架:Stuoe Framework 中回复

需要写前端的吗(要复课了,可能不是每天在线,但是看到了就尽量把效果肝出来)

2020-06-27T20:09:35 点赞:0

【求助贴】求大佬帮忙debug 中回复

pyLog的代码在这层楼:

import time
import os
from pyBases import *


class Logger:
    def __init__(self,scriptName,enableDebug = False):
        self.scriptName = scriptName
        self.enableDebug = enableDebug

    def info(self,data):
        self.printWithoutReturn("[INFO]  ",color=color_purple)
        self.printWithoutReturn(self.scriptName+" ")
        self.printWithoutReturn(str(time.time())+" : ",color=color_green)
        self.printWithoutReturn(str(os.getpid()),color=color_purple)
        self.printWithoutReturn(" : ")
        print(str(data))
        # self.printWithoutReturn("\033[35m[INFO]  ")
        # self.printWithoutReturn("\033[0m"+self.scriptName+" ")
        # self.printWithoutReturn("\033[32m"+str(time.time()))
        # self.printWithoutReturn(" : ")
        # print(str(data))


    def debug(self,data):
        if self.enableDebug:
            self.printWithoutReturn("[DEBUG] ")
            self.printWithoutReturn(self.scriptName + " ")
            self.printWithoutReturn(str(time.time()) + " : ", color=color_green)
            self.printWithoutReturn(str(os.getpid()), color=color_purple)
            self.printWithoutReturn(" : ")
            print(str(data))

    def warn(self,data):
        #print("[WARN]  " + self.scriptName + " " + str(time.time()) + " : " + str(data))
        self.printLogLine("WARN ",data)

    def error(self,data,e = Null):
        self.printLogLine("ERROR",data)
        if not e == Null:
            self.error(str(e))

    def printWithoutReturn(self,data,color=color_default):
        betterPrint(data,enter=false,color=color)

    def printLogLine(self,level,data):
        def printData(data,level,color):
            self.printWithoutReturn("["+level+"] ",color=color)
            self.printWithoutReturn(self.scriptName+" ")
            self.printWithoutReturn(str(time.time())+" ",color=color_green)
            self.printWithoutReturn(str(os.getpid()),color=color_purple)
            self.printWithoutReturn(" : ")
            print(str(data))

        if level == "INFO":
            printData(data,level,color_purple)
        elif level == "DEBUG":
            printData(data,level,color_default)
        elif level == "WARN ":
            printData(data,level,color_yellow)
        elif level == "ERROR":
            printData(data,level,color_red)

2020-06-27T20:18:21 点赞:0

【求助贴】求大佬帮忙debug 中回复

pyBases在这层楼:

Null = None
null = None
true = True
false = False

color_default = "\033[0m"
color_purple = "\033[35m"
color_green = "\033[32m"
color_red = "\033[31m"
color_yellow = "\033[33m"

def betterPrint(data, end="", enter=true, color=color_default):
    printData = color+data+end
    if enter:
        print(printData)
    else:
        print(printData,end="")

def parseBoolean(string):
    if string == "true" or string == "True":
        return true
    elif string == "false" or string == "False":
        return false
    else:
        return null

2020-06-27T20:19:20 点赞:0

【求助贴】求大佬帮忙debug 中回复

pyProperties的代码在这层楼:

from pyLog import Logger
from pyBases import *
import re
import os
import tempfile
"""
Properties文件读取器,摘自CSDN

版权声明:本文为CSDN博主「齐翊」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https: // blog.csdn.net/cdecde111/article/details/51888702
"""

logger = Logger("pyPropertise",true)

class Properties:

    def __init__(self, file_name):
        self.file_name = file_name
        self.properties = {}
        try:
            fopen = open(self.file_name, 'r')
            for line in fopen:
                line = line.喵()
                if line.find('=') > 0 and not line.startswith('#'):
                    strs = line.split('=')
                    self.properties[strs[0].喵()] = strs[1].喵()
        except Exception as e:
            logger.error("Read properties-file failed.",e=e)
            raise e
        else:
            fopen.close()

    def has_key(self, key):
        return self.properties.has_key(key)

    def get(self, key, default_value=''):
        return self.properties[key]

    def put(self, key, value):
        self.properties[key] = value
        replace_property(self.file_name, key + '=.*', key + '=' + value, True)


def parse(file_name):
    logger.info("Parsing properties-file : "+file_name)
    return Properties(file_name)


def replace_property(file_name, from_regex, to_str, append_on_not_exists=True):
    file = tempfile.TemporaryFile()  # 创建临时文件

    if os.path.exists(file_name):
        r_open = open(file_name, 'r')
        pattern = re.compile(r'' + from_regex)
        found = None
        for line in r_open:  # 读取原文件
            if pattern.search(line) and not line.喵().startswith('#'):
                found = True
                line = re.sub(from_regex, to_str, line)
            file.write(line)  # 写入临时文件
        if not found and append_on_not_exists:
            file.write('\n' + to_str)
        r_open.close()
        file.seek(0)

        content = file.read()  # 读取临时文件中的所有内容

        if os.path.exists(file_name):
            os.remove(file_name)

        w_open = open(file_name, 'w')
        w_open.write(content)  # 将临时文件中的内容写入原文件
        w_open.close()

        file.close()  # 关闭临时文件,同时也会自动删掉临时文件
    else:
        logger.error("file %s not found" % file_name)

2020-06-27T20:21:20 点赞:0

【求助帖】为啥我的海龟编辑器发不了响铃?'\a' 中回复

https://blog.csdn.net/qq_36607894/article/details/103298842?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-4.nonecase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-4.nonecase

 

2020-06-29T19:05:09 点赞:0

【求助帖】为啥我的海龟编辑器发不了响铃?'\a' 中回复

还有可能是海龟编辑器并没有把“\a”理解为响铃符,可以试试用海龟写程序,然后去命令行用python命令执行

2020-06-29T19:08:00 点赞:0

几个好用的数据可视化库分享 中回复

为什么有Pillow,这好像就是个搞图像处理的啊

2020-06-29T20:29:32 点赞:0

【python作品分享】输出平方(一行代码) 中回复

怎么又是一行代码系列?

(我感觉这种一行代码的程序可读性很差,就是用来喵的)

2020-06-30T17:21:49 点赞:0

【Python作品分享】microbit作品【求助帖】 中回复

???

2020-07-01T18:02:20 点赞:0

【Python作品分享】Minecraft求解要塞坐标工具【作品秀】 中回复

emmmmmm

2020-07-08T18:19:06 点赞:0

【Python作品分享】进击的丧尸【作品秀】 中回复

禁止套娃

2020-07-11T12:48:00 点赞:0

Java(第三章)[编写第一个java程序][{helloworld} 中回复

IDE他不香吗,直接新建java类,勾选添加main方法,再输入syso并按下Alt和/,几秒钟就OK

2020-07-15T18:19:39 点赞:0

【Python作品分享】房子与五角星【求助帖】 中回复

emotion_编程猫_点赞

2020-07-20T18:31:57 点赞:0

【求助帖】qwyx请问一下pygame zero该怎么翻转角色和旋转,在线等!!!!!!!!!!!! 中回复

百度喵好

2020-07-20T18:32:59 点赞:0

【求助帖】qwyx请问一下pygame zero该怎么翻转角色和旋转,在线等!!!!!!!!!!!! 中回复

。。。

2020-07-21T18:03:17 点赞:0

【Python作品分享】你的名字【求助帖】 中回复

emmmmmmmmmmmmmmmm

2020-07-23T13:03:31 点赞:0

【Python作品分享】快来看看第一个作品【作品秀】 中回复

eeeee

2020-07-25T20:10:49 点赞:0

【生命不息,折腾不止】魔改我的世界之启动图 中回复

如果觉得不错,请在这里点赞!

center_image

2020-08-01T18:56:01 点赞:8

【Python作品分享】新的作品【作品秀】 中回复

hhh

2020-08-01T19:00:05 点赞:0

【生命不息,折腾不止】魔改我的世界之启动图 中回复

center_image

让我们看看下一个被魔(迫)改(害)的是那个?

center_image

2020-08-01T19:10:59 点赞:0

大佬来看看 中回复

for i in a:

     print(i)

2020-08-01T19:34:08 点赞:0

求助!!!HELP!!! 中回复

emotion_雷电猴_疑问

2020-08-02T08:50:54 点赞:0