
Python
nature_ph
这个作者很懒,什么都没留下…
展开
-
python 点击run 报错 @NotNull method
问题:Error running 'test': @NotNull method com/intellij/execution/configurations/GeneralCommandLine.getExePath must not return null解决:原创 2021-11-08 15:32:40 · 3469 阅读 · 0 评论 -
python3.7.3安装TensorFlow:
命令:pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.14.0-py3-none-any.whl问题:Could not build wheels for h5py which use PEP 517 and cannot be installed directly解决:pip install --upgrade pip参考:python - ERROR: Cou原创 2021-11-02 14:16:23 · 821 阅读 · 0 评论 -
python 生成16位integer
1. np.random.randint(low, high=None, size=None, dtype=None)其中 dtype=np.uint16代表16位的integer,可参考library2. 为什么不能使用random.getrandbits(16)?python - "sys.getsizeof(int)" returns an unreasonably large value? - Stack Overflow@@KK...原创 2021-10-31 21:51:45 · 596 阅读 · 0 评论 -
np.array与list的内存大小比较
def test(): nums = [] for _ in range(900000): nums.append(np.random.randn()) nums1 = np.array(nums) print(round(sys.getsizeof(nums) / 1024 / 1024, 2)) # 7.37M print(round(sys.getsizeof(nums1) / 1024 / 1024, 2)) # 6.87M--准确大小.原创 2021-10-28 21:23:19 · 1502 阅读 · 0 评论 -
AttributeError: ‘function‘ object has no attribute ‘encrypt‘
【写法1】from aa_dir.encryption import encryptiondef encryption(): encryption.encrypt(publickey, item)if __name__ == '__main__': encryption()报错:AttributeError: 'function' object has no attribute 'encrypt',因为函数名称冲突【写法2】from aa_dir.encryp...原创 2021-09-27 11:15:03 · 954 阅读 · 0 评论 -
Debug Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
参考链接:upgrade - Pycharm debugger instantly exits with 139 code - Stack Overflow原创 2021-09-25 15:33:31 · 938 阅读 · 0 评论 -
Mac 安装 pyenv
Microsoft SEAL: BFV, CKKS (C++)HElib: BGV (with GHS), CKKS (C++)PALISADE: BFV, BGV, CKKS, FHEW (C++)TFHE: Ring-variant of GSW (C++)HEAAN: CKKS (with bootstrapping) (C++)原文链接:https://blog.youkuaiyun.com/weixin_43476788/article/details/105327360...原创 2021-09-24 14:34:26 · 1267 阅读 · 0 评论 -
pip和pip3同时指向python3
pip问题:pip和pip3同时指向python3目标:pip指向python2,pip3指向python3how:重新按照pipget https://bootstrap.pypa.io/get-pip.py --no-check-certificate python get-pip.py 注意:python要指向python2参考文档:https://blog.youkuaiyun.com/weixin_42069606/article/details/104914037...原创 2020-10-22 10:39:06 · 835 阅读 · 0 评论 -
IDEA中python文件提示No module named xxx
1.File -- Project Structure---SDKs2.点击上面+3.选择 Python SDK4. Location 需要指向一个空的文件夹5.点击确认,重启IDEA6.右下角提示 configuration,点击即可原创 2020-07-08 11:10:38 · 2989 阅读 · 1 评论 -
python post请求 相关
1.想要post请求返回双引号,可以使用json.dumps(response_data)如果response_data中有中文,加上ensure_ascii=Falsejson.dumps(response_data, ensure_ascii=False)2. requests.post(url, data=data)的中的data类型根据接收方的接收类型1)application/x-www-form-urlencoded最常见post提交数据的方式,以form表单形式提交数据.原创 2020-07-07 19:50:26 · 633 阅读 · 0 评论 -
python3.7 读写.properties文件
#!/usr/bin/python# -*- coding: UTF-8 -*-import reimport osimport tempfileclass Properties: def __init__(self, file_name): self.file_name = file_name self.properties = {}...转载 2019-07-30 10:12:05 · 1806 阅读 · 0 评论 -
python---ftp
https://www.cnblogs.com/gongxr/p/7529949.htmlhttps://blog.youkuaiyun.com/linda1000/article/details/8255771原创 2019-07-02 20:46:13 · 128 阅读 · 0 评论 -
day1--20190223
1.起源Python是著名的“龟叔”Guido van Rossum在1989年圣诞节期间,为了打发无聊的圣诞节而编写的一个编程语言(瞅瞅人家无聊的时候都在干嘛@-@,不过当投入去做一件事情,所有的焦虑都不见了,只剩下我与投入的这件事情时,感觉真的不错)2.安装mac默认安装python 2.7,在命令中数据python 2选择python 2.7,在命令中数据python 2选择py...原创 2019-02-23 10:12:13 · 204 阅读 · 0 评论