摘要: 目标:通过手动创建后,再用PyCharm打开(配置虚拟环境) 环境:Mac OS(安装了virtualenv和virtualenvwrapper) 1、创建Django项目 pyenv activate py3 # 进入到我创建的django虚拟环境(如果python未生效,可以试试 source 阅读全文
posted @ 2021-11-17 11:32 Jessie橙子 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 现象: 输入workon,提示: command not found: workon 解决方法: vim ~/.bash_profile export WORKON_HOME=~/.virtualenvs (此地址可用绝对地址替代) source /Library/Frameworks/Python 阅读全文
posted @ 2021-11-17 10:56 Jessie橙子 阅读(579) 评论(0) 推荐(0) 编辑
摘要: pip curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py python3 get-pip.py pyenv pyenv是一个Python版本管理工具,它能够进行全局的Python版本切换,也可以为单个项目提供对应的Python版本。使用p 阅读全文
posted @ 2021-11-17 10:39 Jessie橙子 阅读(26) 评论(0) 推荐(0) 编辑
摘要: 1、Homebrew是什么? 引用官方的一句话:Homebrew是Mac OS 不可或缺的套件管理器。 Homebrew是一款Mac OS平台下的软件包管理工具,拥有安装、卸载、更新、查看、搜索等很多实用的功能。简单的一条指令,就可以实现包管理,而不用你关心各种依赖和文件路径的情况,十分方便快捷。 阅读全文
posted @ 2021-11-08 18:15 Jessie橙子 阅读(185) 评论(0) 推荐(0) 编辑
摘要: lambda可以简化简单循环,如下: lambda函数与filter,map函数,eval结合使用 阅读全文
posted @ 2017-03-16 12:15 Jessie橙子 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 生成随机验证码,并判断用户输入的验证码是否正确 def identifying_code(): temp = "" for i in range(4): num = random.randrange(0, 4) if num == 1 or num == 3: rad1 = random.randr 阅读全文
posted @ 2017-03-12 23:51 Jessie橙子 阅读(295) 评论(0) 推荐(0) 编辑
摘要: def str_count(s): i = 0 num_count = 0 alpha_count = 0 space_count = 0 else_count = 0 print s while i < length: if s[i].isdigit() : num_count += 1 elif 阅读全文
posted @ 2017-03-05 22:44 Jessie橙子 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 一、数字、字符串不论是浅拷贝、深拷贝都是指向一个地址。 a = 1 b = "abc" print (id(a)) print (id(b)) a1 = a b1 = b print (id(a1),id(b1)) a2 = copy.copy(a) b2 = copy.copy(b) print 阅读全文
posted @ 2017-03-04 20:32 Jessie橙子 阅读(164) 评论(0) 推荐(0) 编辑
摘要: a = raw_input("请输入a的值:") b = raw_input("请输入b的值:") result = 1 if a > b else 0 print result c1 = "abc" c2 = 'xyz' old_dict = { "#1": {'hostname':c1, 'cp 阅读全文
posted @ 2017-03-04 15:37 Jessie橙子 阅读(156) 评论(0) 推荐(0) 编辑
摘要: s = {11,22,33,44,55,66,77,88,99,90} num = {'k1':[],'k2':[]} li = list(s) for item in s: #print(item) if item > 66: num['k1'].append(item) elif item < 阅读全文
posted @ 2017-03-03 10:55 Jessie橙子 阅读(147) 评论(0) 推荐(0) 编辑
Live2D