ubuntu root用户开机开机没有声音

配置root用户下可以自动重启pulseaudio 1. 编辑pulseaudio.service 服务文件 vim /usr/lib/systemd/user/pulseaudio.service 注释掉 ConditionUser=!root 2. 编辑 pulseaudio.socket 文

ConstStar ConstStar 发布于 2024-01-25

pip安装库失败,Could not find a version that satisfies the requirement (from versions: none)

在arm板子安装PySide6报下面的错误: ERROR: Could not find a version that satisfies the requirement pyside6 (from versions: none) ERROR: No matching distribution fo

ConstStar ConstStar 发布于 2023-12-21

python添加搜索模块的路径

python代码方式 sys.path.append("your_path") # 必须用绝对路径 Linux命令行方式(设置环境变量) export PYTHONPATH=$PYTHONPATH:$(pwd)

ConstStar ConstStar 发布于 2023-11-21

Python获取函数调用者的文件名、行号、函数名

import inspect def foo(): # 获取栈帧的列表 stack = inspect.stack() # 获取调用者的栈帧,一般是第二个元素 caller_frame = stack[1] # 获取调用者的信息 caller_inf

ConstStar ConstStar 发布于 2023-11-21

qt.qpa.plugin: Could not load the Qt platform plugin “xcb“ in ““ even though it was found.

问题 pyside6在linux中运行提示 qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start beca

ConstStar ConstStar 发布于 2023-11-17

Ubuntu安装最新版本Python

sudo apt update #ppa源工具 sudo apt install software-properties-common sudo add-apt-repository ppa:deadsnakes/ppa sudo apt search python3.11 sudo apt ins

ConstStar ConstStar 发布于 2023-11-16

fprime创建项目出现的问题

运行到metadata(setup.py)会卡主报错 通过脚手架创建项目执行到下载python依赖时运行metadata(setup.py)会卡主报错,查阅fprime论坛发现运行matedata时会通过github下载一些依赖文件,所以解决方法就是设置linux中的http和https的全局代理。

ConstStar ConstStar 发布于 2023-11-16

ubuntu设置允许root用户ssh远程登录

1. 修改配置文件 vim /etc/ssh/sshd_config 大约在34行的#PermitRootLogin prohibit-password,修改为PermitRootLogin yes 大约在35行的#StrictModes yes,修改为StrictModes yes 2. 重启s

ConstStar ConstStar 发布于 2023-11-16

Python获取当前计算机使用情况、网络信息等

import psutil import socket import requests # 兼容Windows if 'AF_PACKET' not in socket.AddressFamily.__members__: socket.AddressFamily.AF_PACKET =

ConstStar ConstStar 发布于 2023-11-16

Python重写logging日志模块

import logging # 重写日志 class MyLogHandler(logging.Handler): def emit(self, record): print(record.name, record.levelname, record.filename,

ConstStar ConstStar 发布于 2023-11-16