猫史档案馆


JUST_workshop官方

JUST_workshop官方

Lv.1

JUST_nothing小号,欢迎加入JUST_workshop

获赞:83收藏:18浏览:271作品收藏:3

签名:阿巴阿巴阿巴。。。 学亿点物理和化学,做出完美喵的大统一模型,让我家信息课代(@马蕴杰)设计程序,化学课代(@cyy)执行方案 炸掉学校!!! 阿巴阿巴阿巴。。。

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

#kitten教学第一期 中回复

Python一行不就搞好了:

print('1,2,3,4'.split())#‘1,2,3,4’可替换为任何type==字符串的信息

2022-12-24T22:03:01 点赞:0

Python逐字输出教程 中回复

'''主文件:'''

import about_file as f
from tkinter import *
import webbrowser as webo


class commands():
    def __init__(self):
        self.file_name = f.getFileName('main_code_html.html')

    def save(self):
        with open(self.file_name, 'w') as file:
            global codes
            file.write(codes.get("1.0", END))

    def run(self):
        self.save()
        webo.open('file://'+self.file_name)

    def get(self):
        with open(self.file_name, 'r') as file:
            code = file.read()
            if code == '':
                return ''
            else:
                return code


tk = Tk()
c = commands()

tk.title('Python写的H喵L编译器')
tk.geometry('500x300+200+200')

btn1 = Button(tk, text='保存', command=c.save)
btn1.grid(row=0, column=0)

btn2 = Button(tk, text='运行', command=c.run)
btn2.grid(row=0, column=1)

codes = Text(tk)
codes.place(x=0, y=25)
codes.insert(END, c.get())

tk.mainloop()



import os
import platform


def getFileName(name="record.txt"):
    tmp_path = ""
    if platform.system() == "Darwin":
        tmp_path = os.path.expanduser("~/学而思直播/code/cache/asset_pool")
    else:
        tmp_path = os.path.expanduser(r"~\学而思直播\code\cache\asset_pool")
    whole_path = os.path.join(tmp_path, name)
    #初始化
    if not os.path.exists(whole_path):
        with open(whole_path, "w", encoding="utf-8") as f:
            f.write("0")
    return whole_path


def openFile(data_path):
    if platform.system() == "Windows":
        os.startfile(data_path)
    elif platform.system() == "Darwin":
        subprocess.Popen(["open", data_path])
    else:
        subprocess.Popen(["xdg-open", data_path])

2022-12-24T22:27:22 点赞:0

积木怎么了? 中回复

还不如按F12开开发者工具

2022-12-25T13:51:11 点赞:1

Python教程系列 2.爬虫 中回复

**编程猫!!!我的网址!!!***

2022-12-25T15:27:28 点赞:0

无穷个数的平均值和积分的近似计算 中回复

。。。这

2023-01-06T19:50:59 点赞:1

免费接代装工作室官网 中回复

帮我一下,谢谢

2023-01-07T14:23:44 点赞:0