iohannes long
搜索文章
机器人
python
c++
金融
linux
前端
中间件
java
求解
登录
机器人
python
c++
金融
linux
前端
中间件
java
求解
登录
线程锁
在Python的threading模块中,Lock对象提供了基本的线程锁定功能。threading.Lock基于底层的操作系统原语(如mutex)来实现。当一个线程尝试获取一个已经"
作者:iohannes
发布时间:2025-03-14
分类:
python
延迟绑定问题
延迟绑定的问题 def create_multipliers(): return [lambda x : i * x for i in range(5)] for multiplier in create_multipliers(): print(multiplier(2)) 输出
作者:iohannes
发布时间:2025-03-14
分类:
python
运行外部py文件
要运行的py文件 # b.py from a import * def funb(): print("fun b") funa() if __name__ == "__main__": funb() 引用的同目录文件
作者:iohannes
发布时间:2025-03-14
分类:
python
== 和 is
a = 'hello world' b = 'hello world' a == b #返回True a is b #返回False is 判断是否是一个ID == 判断内容是否相等
作者:iohannes
发布时间:2025-03-14
分类:
python
cachetools
安装 pip3 install cachetools 常见缓存分类 class cachetools.Cache(maxsize, getsizeof=None) class cachetools.LRUCache(maxsize, getsizeof=None). Least Recently U
作者:iohannes
发布时间:2025-03-14
分类:
python
class to json string
import json from json import JSONEncoder class Employee: def __init__(self, name, salary, address): self.name = name self.salary
作者:iohannes
发布时间:2025-03-14
分类:
python
json 和 class 互转
json to object import json from types import SimpleNamespace data = '{"name": "John Smith", "hometown": {"name": "New York", "id": 123}}' # Parse JSO
作者:iohannes
发布时间:2025-03-13
分类:
python
jupyter notebook
安装运行 pip install notebook 配置 nano ~/.jupyter/jupyter_notebook_config.py c.NotebookApp.ip = '0.0.0.0' # listen on all IPs 运行所有设备登录 c.NotebookApp.toke
作者:iohannes
发布时间:2025-03-12
分类:
python
pip 换源
# 清华源 pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple # 阿里源 pip config set global.index-url https://mirrors.aliyun.com/pypi/s
作者:iohannes
发布时间:2025-03-12
分类:
python
python 临时增加目录
增加到当前shell 会话 export PYTHONPATH=$PYTHONPATH:/Path/to/your/dictionary 增加到当前文件 import sys sys.path.append(“想要加
作者:iohannes
发布时间:2025-03-12
分类:
python
共 39 篇文章
1
2
3
4
页