#note-timknipUnmoderated tagAll postsTrending CommunitiesNewcomers' CommunitySteemitCryptoAcademySteemit Feedbackআমার বাংলা ব্লগKorea • 한국 • KR • KOSteem AllianceSTEEM CN/中文WORLD OF XPILARAVLE 일상Beauty of CreativityComunidad LatinaSteem POD TeamExplore Communities...#note-timknipTrendingHotNewPayoutsMutedtimknip (60)in #note-timknip • 4 years ago升级node至最新npm install -g n n stable 只需要这二行命令,不需要自己编译 Ubuntu18.04 默认安装了 Nodejs v8.x 版本 $ curl -sL -o nodesource_setup.sh…timknip (60)in #note-timknip • 5 years agoubuntu 18 上编译python3.7/ 3.8自己编译最新的稳定版,坑多 File "/usr/local/lib/python3.7/ctypes/__init__.py", line 7, in timknip (60)in #note-timknip • 5 years agoPython判断一个变量是否存在在调用一个变量的时候,如果这个变量没有被定义,那么python会报错。 要解决的方法也很简单,就是事先给变量赋一个空值。 但是也可以通过调用系统的内置函数来判断一个变量名是否已经被定义了。有3个内置函数都可以实现。 res1…timknip (60)in #note-timknip • 5 years agopython 命令行传递bool值参数parser = argparse.ArgumentParser()timknip (60)in #note-timknip • 5 years agopython console flush 覆盖输出/单行输出方式这篇有第三方库的介绍 有时候看输出进度时,会分别输出进度,也就是输出一长串数字,如果能够覆盖之前的输出视觉效果会更好。 1 2 3 4 5 6 7 8 9 import sys import time…timknip (60)in #note-timknip • 5 years agopython 显示时间ime.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())) time.strftime里面有很多参数,可以让你能够更随意的输出自己想要的东西:…timknip (60)in #note-timknip • 5 years agopython 保留指定小数点后指定位数保留两位小数,并做四舍五入处理 方法一: 使用字符串格式化timknip (60)in #note-timknip • 5 years agowin10 自动休眠和唤醒检查休眠和睡眠是否开启 1.1 用管理员身份运行cmd 1.2 powercfg /a 查看,如果未开启运行: 1.3 powercfg -h on 1.4…timknip (60)in #note-timknip • 5 years agopython命令行参数解析Python中最好用的命令行参数解析工具 Python 做为一个脚本语言,可以很方便地写各种工具。当你在服务端要运行一个工具或服务时,输入参数似乎是一种硬需(当然你也可以通过配置文件来实现)。…timknip (60)in #note-timknip • 5 years agomac上二三行代码用python 3播放mp3文件先安装个库和它的依赖项: pip3 install playsound PyObjC 引用这个库后直接播放 playsound.py >import playsoundtimknip (60)in #note-timknip • 5 years ago自建邮件中转服务Simplest and Smallest Email Forward Service for Docker. Config by one-linetimknip (60)in #note-timknip • 5 years agouse dict.get() to increase valuea_dict = {"a":1}timknip (60)in #note-timknip • 5 years agoc/js ?: in Pythona if condition else b [on_true] if [expression] else [on_false]timknip (60)in #note-timknip • 5 years agoPython 定时任务 APScheduler安装 安装只需要一行命令。 pip3 install apscheduler 运行 首先介绍两个最常用的调度器: BlockingScheduler 阻塞式调度器:适用于只跑调度器的程序。…timknip (60)in #note-timknip • 5 years ago嫁接一句话 于新刚夏季嫁接 砧木木质化,接穗半木质化,成活率最低; 砧木木质化,接穗木质化,成活率一般; 砧木半木质化,接穗半木质化,成活率较高。 砧木半木质化,接穗木质化,成活率最高。 成活率最高是热粘皮; 速度最快是贴芽接;…timknip (60)in #note-timknip • 5 years agourl_for in flaskurl_for in Flask is used for creating a URL to prevent the overhead of having to change URLs throughout an application…timknip (60)in #note-timknip • 5 years agoInstantClickInstantClick is a JavaScript library that dramatically speeds up your website, making navigation effectively instant…timknip (60)in #note-timknip • 5 years agoAttributeError: module 'queue' has no attribute 'Queue'class LifoQueue(queue.Queue): AttributeError: module 'queue' has no attribute 'Queue' 今天碰到个奇怪的事,vs…timknip (60)in #note-timknip • 5 years agodev.to, another company/org without office今天才知道 @ety001已经开始为Steemit远程工作。 刚才无意间搜到的个 dev.to 的网站,除了btc/eth/wordpress外,又一个偶像级的社区公司,网站的 代码开源…timknip (60)in #note-timkninp • 5 years agofree/open source flask admin templates#Flask Admin Dashboards Simple admin panels coded on top of popular and free UI-Kits, generated with…