
Lv.1
作品开源于Github:GitHub.com/MCNTFS2020/
在 【社区功能反馈】用心倾听,用头发发电!(2026更新版) 中回复
我**,我主Python,但是投稿不了啊,搞个云运行服务器会*吗?
print("WDNMD")2021-09-05T10:14:45 点赞:0
在 【Python作品分享】14_GUI_By_Class【求助帖】 中回复
import random,sys
from PySide2.QtWidgets import *
from PySide2.QtCore import *
from ui_rannamer import Ui_MainWindow
try:
with open("roming.txt","r",encoding="utf-8") as f:
name = f.read()
except:
pass
class random_name(QMainWindow,Ui_MainWindow):
print("I'm in class")
def __init__(self):
super().__init__()
self.setupUi(self)
print("func:Setup")
self.name = ['名字1', '名字2', '名字3', '更多名字']
self.random_name = []
self.ipt = ""
self.num = 0
self.start = True
self.Input()
self.show()
def Input(self):
print("func:Input")
self.ipt = self.count.text()
if self.ipt == "" and not self.start:
QMessageBox.warning(self, "注意", "请输入数量")
else:
self.start = False
if self.ipt != "setting":
while True:
try:
self.num = int(self.ipt)
if self.num > len(self.name):
QMessageBox.warning(self, "哎呦", "数字好像太大了")
raise
if self.num == len(self.name):
QMessageBox.warning(self, "哎呦", "您在点全班?")
raise
if self.num < len(self.name):
self.random_name = random.sample(self.name, self.num)
print(self.random_name)
QMessageBox.information("恭喜", str(self.random_name))
random_name = []
except:
break
if self.ipt == "setting":
while True:
QMessageBox.information("设置","1.设置名单\n2.Debug信息(一般用处不大)\n3.使用指南\n4.退出 >>>")
if self.word:
ipt = self.count.text()
if ipt == "":
QMessageBox.warning(self, "注意", "请输入设置项")
else:
setlist = ipt
if int(setlist) == 1:
self.name = input("请输入新的名单列表(像这样:['名字1','名字2','...'])")
print("改动成功,现列表:", name)
if int(setlist) == 2:
print("--------Debug Info--------")
print("name", self.name)
print("raname pythoncore v13.5")
print("--------Debug Info--------")
if int(setlist) == 3:
print("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------")
print("进阶:\
Q:怎么在不改源代码的情况下更改名库? A:在程序同目录下创建roming.txt文本文件,然后按照格式写入即可,程序会在每次启动时自动尝试读取(文件格式:['名字1','名字2','......'])\
Q:怎么通过改源代码来更改名库? A:使用IDLE或者记事本以及其他的文本编辑软件打开源代码,找到第三行的'name = '字样,按照上面写roming.txt的格式更改后面的内容即可,注意要把原来的删掉哦~\
Q:怎么查看此软件的最新版本? A:前往软件储存库:'https:/喵NTFS2020/rannamer'即可查看软件最新版本!\
Q:怎么联系软件作者? A:发邮件到HTTcode2020@126.com,TA不一定能看到,但是看到了一定会尽他所能回复!\
P.S:有能力的话可以在软件的最新版本页面Fork作者代码,修改/增加代码/功能后向作者请求合并,具体方法参考链接:https://blog.csdn.net/XiaoHanZuoFengZhou/article/details/86518180,文中用到的Git:'https://git-scm.com/downloads',看不懂英文请使用浏览器的翻译功能或者配合手机的翻译软件使用")
print("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------")
if int(setlist) == 4:
break
else:
print("???")
def keyPressEvent(self, event):
if event.key() == Qt.Key_Return:
self.Input()
if __name__ == '__main__':
app = QApplication(sys.argv)
window = random_name()
sys.exit(app.exec_())
现代码👆
2021-10-05T21:41:12 点赞:0
在 【Python作品分享】14_GUI_By_Class【求助帖】 中回复
老铁们,我做好了,开源:NTFS2020/rannamer:这是一个由中国的一名科技爱好者编写的随机抽选器。英文名为“ranamer”。//ThisisarandompickerwrittenbyascienceandtechnologyenthusiastinChina.ItsEnglishnameis"ranamer".(github.com)
2021-10-06T21:19:11 点赞:0
在 【Python作品分享】课程库管理(原新终端安装,BCM源文件修改版)【作品秀】 中回复
用Ctrl+F将代码中所有common_version替换成newest_version再运行程序即可默认安装库的最新版本
2022-01-23T16:10:09 点赞:0
在 【Python作品分享】课程库管理(原新终端安装,BCM源文件修改版)【作品秀】 中回复
这个有一些东西被和谐掉了,Github库叫ClassLibManager
2022-01-24T11:35:10 点赞:0