摘要: code1 class mytest(): def __str__(self): return "hello" def __repr__(self): return "world" a=mytest() print(a) print(str(a)) print(repr(a)) outputs he 阅读全文
posted @ 2020-08-23 23:55 anobscureretreat 阅读(134) 评论(0) 推荐(0)
摘要: code import time #—————————————————————————————————————————————— #死循环打印1 ''' def count_n1(): return 1 for i in iter(count_n1, 6): print(i) ''' #—————— 阅读全文
posted @ 2020-08-23 23:39 anobscureretreat 阅读(3920) 评论(0) 推荐(0)
摘要: code >>> import django >>> django.version Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: module 'django' has n 阅读全文
posted @ 2020-08-23 11:11 anobscureretreat 阅读(219) 评论(0) 推荐(0)
摘要: code 1.每个缩进层级使用4个空格。 2.每行最多79个字符。 3.顶层的函数(def)或类(class)的定义之间空两行。 4.采用ASCII或UTF-8编码文件。(就是在里面表明编码格式,ASCII编码格式或者是UTF-8的编码格式) 5.在文件的顶端,注释和文档说明之下,每行每条impor 阅读全文
posted @ 2020-08-23 11:06 anobscureretreat 阅读(321) 评论(0) 推荐(0)
摘要: 在python中的random.randint(a,b)用于生成一个指定范围内的整数zd。 其中参数专a是下限,参数b是上限,生成的随机数n: a <= n <= b。 所以random.randint(9,10)的意思是: 生成大于等于9,小于等于10的随机整数。 因此这句得到的结果不是9,就是1 阅读全文
posted @ 2020-08-23 11:05 anobscureretreat 阅读(862) 评论(0) 推荐(0)
摘要: code macname@MacdeMBP Desktop % python3 test.py /Users/macname/Desktop/test.py /Users/macname/Desktop macname@MacdeMBP Desktop % cat test.py #coding=u 阅读全文
posted @ 2020-08-23 11:04 anobscureretreat 阅读(946) 评论(0) 推荐(0)
摘要: 下载驱动后,解压 然后将可执行文件放在/usr/local/bin/下面 在命令输入chromedriver后出现以下内容,表示配置成功 macname@MacdeMacBook-Pro ui_web_automation % chromedriver Starting ChromeDriver 8 阅读全文
posted @ 2020-08-23 11:02 anobscureretreat 阅读(314) 评论(0) 推荐(0)
摘要: 安装 pip3.7 install pyperclip code import pyperclip pyperclip.copy('hello world') print(pyperclip.paste()) output Python 3.7.4 (v3.7.4:e09359112e, Jul 8 阅读全文
posted @ 2020-08-23 11:00 anobscureretreat 阅读(1093) 评论(0) 推荐(0)
摘要: code import logging logger = logging.getLogger(__name__) logger.setLevel(level = logging.INFO) handler = logging.FileHandler("log.txt") handler.setLev 阅读全文
posted @ 2020-08-23 10:57 anobscureretreat 阅读(130) 评论(0) 推荐(0)
摘要: code macname@MacdeMacBook-Pro new % python3 Python 3.7.4 (v3.7.4:e09359112e, Jul 8 2019, 14:54:52) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", 阅读全文
posted @ 2020-08-23 10:56 anobscureretreat 阅读(833) 评论(0) 推荐(0)
摘要: code >>> a="192.168.0.5:5000" >>> f'http://{a}/chain' 'http://192.168.0.5:5000/chain' 阅读全文
posted @ 2020-08-23 10:54 anobscureretreat 阅读(691) 评论(0) 推荐(0)
摘要: pip安装 Pip3.7 install notebook 启动Jupyter jupyter notebook 安装voila pip3.7 install voila 阅读全文
posted @ 2020-08-23 10:51 anobscureretreat 阅读(148) 评论(0) 推荐(0)