Summary omitted as the content was protected by password.
CentOS7一键安装SS服务端
-
- 2020/8/16 07:35
- Default
- shadowsocks centos 科学上网
- 2078
python: 37 items found.
Summary omitted as the content was protected by password.
cat /proc/sys/kernel/random/uuid
#!/usr/bin/python
import uuid
print uuid.uuid1()
print uuid.uuid4()
在目录C:\Users\用户名\
下新建目录pip, 并在pip目录中新建pip.ini, 注意文件后缀。文件内容:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com
附国内其它源:
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
最近看到国产网剧《无主之城》,感觉大有僵尸之类美剧的情节,看到第10集,江雪的电脑被入侵后,江雪在键盘上霹雳啪啦一顿狂操作,画面切到一堆黑屏的命令窗口,有点好奇是什么命令,遂暂停截了下图:
原来桌面用的黑色背景,命令窗口调用几个批处理命令打印出代码。代码的内容还是用Python的pygame库加载声音文件,设置音量。
而且几个窗口的内容是一样的!
和网络命令也不沾边,看来也就是做做效果,糊弄一下。
第一种方法:
rds = redis.StrictRedis(host='localhost', port=6379, password='123456')
第二种方法:
redis_config = {
'host': os.getenv('REDIS_HOST', '127.0.0.1'),
'port': os.getenv('REDIS_PORT', 6379),
'password': os.getenv('REDIS_PWD', '123456')
}
redis_uri = 'redis://:{password}@{host}:{port}/0'.format(**redis_config)
redis = Redis.from_url(redis_uri)
Error like this:
Collecting misaka==2.1.1 (from -r requirements.txt (line 12))
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/fa/87/b1020510a00aba1b936477e54180b143df654c565b84936b0b3e85272cf2/misaka-2.1.1.tar.gz (125kB)
ERROR: Complete output from command python setup.py egg_info:
ERROR:
No working compiler found, or bogus compiler options passed to
the compiler from Python's standard "distutils" module. See
the error messages above. Likely, the problem is not related
to CFFI but generic to the setup.py of any Python package that
tries to compile C code. (Hints: on OS/X 10.8, for errors about
-mno-fused-madd see http://stackoverflow.com/questions/22313407/
Otherwise, see https://wiki.python.org/moin/CompLangPython or
the IRC channel #python on irc.freenode.net.)
Trying to continue anyway. If you are trying to install CFFI from
a build done in a different context, you can ignore this warning.
Traceback (most recent call last):
File "/usr/local/lib/python3.7/distutils/unixccompiler.py", line 118, in _compile
extra_postargs)
File "/usr/local/lib/python3.7/distutils/ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/usr/local/lib/python3.7/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/usr/local/lib/python3.7/distutils/spawn.py", line 159, in _spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1
And my Dockerfile is here:
以前的写法是这样的,
from pymongo import MongoClient
client = MongoClient(host='127.0.0.1')
db = client['dbname']
db.authenticate(user, password)
不过上面的已经废弃
warning:: Starting in MongoDB 3.6, calling :meth:
authenticate
invalidates all existing cursors. It may also leave logical sessions
open on the server for up to 30 minutes until they time out.
To reverse all migrations for an app, you can run:
python manage.py migrate my_app zero
pip install -e /path/to/package
I want to recreate the migrations, so I deleted files under migrations folder, and drop the database. And try this python manage.py makemigrations
, it reponse No changes detected
.
Create the database again, and clear files and folders under migrations, then try the following:
python manage.py makemigrations --empty appname
python manage.py makemigrations
python manage.py migrate
It works!