会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Txwtech
鸿蒙系统APP开发,QT,C#,python,视觉开发 cdtxw@foxmail.com
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
51
52
53
54
55
56
57
58
59
···
127
下一页
2023年12月28日
python tkinter 简单编辑器demo打开与保存文件
摘要: python tkinter 简单编辑器demo打开与保存文件 def load_file(): with open(filename.get()) as file: contents.delete('1.0', END) contents.insert(INSERT, file.read()) d
阅读全文
posted @ 2023-12-28 08:31 txwtech
阅读(125)
评论(0)
推荐(0)
2023年12月27日
显示pycharm 前进后退的快捷按钮到工具栏
摘要: 显示pycharm 前进后退的快捷按钮到工具栏 view>Appearance>Toolbar打钩 错误删除的恢复方法: 翻译 搜索 复制
阅读全文
posted @ 2023-12-27 17:00 txwtech
阅读(1292)
评论(0)
推荐(0)
python 没有switch/case
摘要: python 没有switch/case,替代方法: def func_switch_case(product_name): """ switch case 示范 :param product_name: :return: """ switcher = { "book": 1, "pencil":
阅读全文
posted @ 2023-12-27 13:16 txwtech
阅读(134)
评论(0)
推荐(0)
python脚本传递args参数传递方法
摘要: python脚本传递args参数传递方法 import sys def main(): args = sys.argv[1:] if(len(args)==2): print("传递的参数:", args, len(args)) print(args[0]) print(args[1]) if(ar
阅读全文
posted @ 2023-12-27 11:40 txwtech
阅读(224)
评论(0)
推荐(0)
python的异常捕捉堆栈信息stacktrace,traceback
摘要: 打印报错的行列数与位置 def by2by2(num): """ :param num: """ try: num2 = int(num) for bb in range(1, num2 + 1): yy2 = bb for bb2 in range(1, bb + 1): result2 = yy
阅读全文
posted @ 2023-12-27 09:34 txwtech
阅读(145)
评论(0)
推荐(0)
python 打印九九乘法表
摘要: 输入9,开始打印;0:退出 key_msg = input("please key in Number(0:exit):"),调用乘法表函数键盘输入的是字符型数据字符串比较与数字比较是否相等注意区分 # This is a sample Python script. # Press Shift+F1
阅读全文
posted @ 2023-12-27 09:07 txwtech
阅读(64)
评论(0)
推荐(0)
2023年12月26日
HarmonyOS鸿蒙组件状态
摘要: btn_state_container.xml p115 <?xml version="1.0" encoding="utf-8"?> <state-container xmlns:ohos="http://schemas.huawei.com/res/ohos"> <item ohos:state
阅读全文
posted @ 2023-12-26 21:31 txwtech
阅读(48)
评论(0)
推荐(0)
将 Python 脚本文件.py 编译为.exe 可执行文件的方法
摘要: 1.安装 PyInstaller pip install pyinstaller 2.创建python文件 3. 转换成exe pyinstaller aa2.py 完成后,我们将在当前文件夹中看到两个文件夹 “Build” 和 “Dist” 。在 “Dist” 文件夹中有一个与脚本文件名称相同的文
阅读全文
posted @ 2023-12-26 13:58 txwtech
阅读(118)
评论(0)
推荐(0)
Scripts\activate.ps1,因为在此系统上禁止运行脚本_Set-ExecutionPolicy : 无法绑定参数“ExecutionPolicy解决方法
摘要: Set-ExecutionPolicy : 无法绑定参数“ExecutionPolicy”。无法将值“RomoteSigned”转换为类型“Microsoft.PowerShell.ExecutionPolicy”。错误:“无法将标识符名称 RomoteSigned 与有效的枚举器名称相匹配。请指定
阅读全文
posted @ 2023-12-26 13:55 txwtech
阅读(1163)
评论(0)
推荐(0)
linux拷贝文件复制文件夹拷贝目录
摘要: cp .-r /aa1 ./aa2 ./点和斜杠表示当前目录,-r表示拷贝目录 把当前目录的aa1复制到aa2 复制文件到指定文件夹 cp test2.txt ../ttx ../两个点和斜杠,表示上一级目录 复制test2.txt 到上一级目录的ttx里面 mv移动命令 mv ./aa1 ./aa
阅读全文
posted @ 2023-12-26 13:21 txwtech
阅读(115)
评论(0)
推荐(0)
上一页
1
···
51
52
53
54
55
56
57
58
59
···
127
下一页