pycharm

我的第一个python web开发框架(9)——目录与配置说明

生来就可爱ヽ(ⅴ<●) 提交于 2020-04-10 11:23:44
  和老大聊完后,小白回家接收到相关工具函数包后,就按要求开始干活, 首先要做的是熟悉配置参数和了解工具函数有哪些实用的工具。   由于这个项目比较简单,所以不用创建那么多分类,只需要api、common、config、log和test五个目录就可以了   打开PyCharm,在前面的Hello World项目里分别创建好上面的目录(如下图),然后将相关文件拷贝到相应文件夹里      config文件夹里是const.py文件,这是一个存储常量的配置文件,在开发的过程中,可以将各种常量配置统一放到这里来,方便管理。 # !/usr/bin/evn python # coding=utf-8 # ## 设备常量参数模块,初始化各个常量 ### # ################################################################################# # ## 数据库参数 ### # 数据库名称 DB_NAME = ' simple_db ' # 数据库链接地址 DB_HOST = ' 127.0.0.1 ' # 数据库端口 DB_PORT = 5432 # 数据库账号 DB_USER = ' postgres ' # 数据库登录密码 DB_PASS = ' 123456 ' # ######################

pycharm and subprocess - what works in console doesn't work in Pycharm

你说的曾经没有我的故事 提交于 2020-04-10 03:23:51
问题 Pycharm's interpreter seems to have stopped understanding some of my console commands. It keeps recognizing default shell commands but doesn't recognize installed utilities. For example, subprocess module understands touch command but doesn't understand heroku command. The funny thing is, when I enter the same string into the console, with the same interpreter (from the same virtualenv), everything works fine. A visual example: It stopped working a couple days ago, and before that everything

pycharm print 内容缺失 (内容包含 \r \n)

眉间皱痕 提交于 2020-04-09 20:10:49
代码如下: sttr = "456\r789" print(sttr) log: 只能打印出 789 ,前面的 456 并没有显示 主要原因是: \r 代表回车,也就是打印头归位,回到某一行的开头。 也就是将这一行前面的覆盖了。 “\n” “\r\n” 表示换行 点赞 收藏 分享 文章举报 放大的EZ 发布了367 篇原创文章 · 获赞 127 · 访问量 49万+ 他的留言板 关注 来源: oschina 链接: https://my.oschina.net/u/4326852/blog/3226516

Pycharm2020最新激活码|永久激活(附最新激活码和插件)

a 夏天 提交于 2020-04-09 12:06:21
最近很多人的Pycharm激活时间又过期了,后台很多人索要激活码,我就再把激活的方法汇和工具再梳理一次给大家。 最主要有两种激活方式(两种方式需要的激活码不同): 一.激活码激活: 一般一年多需要激活一次,在License Activation激活界面,选择Active,选择Activation code,粘贴如下激活码,点击ok。 88IY3BPJSM

python+unittest 接口自动化配置linux jenkins构建

天涯浪子 提交于 2020-04-09 11:07:36
1.在linux服务器上下载接口脚本中使用到的插件,如requests,我们服务器上有两个python版本,我的脚本是py3的,所以要指定下载,如下 [10:56 root@cctest200 ~]# pip install -t /usr/local/lib/python3.6/site-packages/ requests 2.脚本上传gitlab,上传命令请参考我上一篇博客 3.jenkins创建一个自由风格的项目,源码管理选择git,贴上你的仓库地址 4.execute shell,第一行可能要根据各公司的路径不同做调整,第二行是你要运行的脚本路径--这里我有一车的话要讲,等下看最后 5.jenkins 下载html report 插件,第一行写你报告存放的文件夹名称(相对路径),我这里默认的是 /home/jenkins/workspace/huj_paycenter/report 第二行是默认的报告名称,这里建议不要改动,并且把你生成的报告名称改成一模一样的,每次生成报告后覆盖;不要搞成test+时间之类的,亲测可能报404错误;page tiltle随便写,最后一行不用动;我对路径这个真的不熟,以至于我觉得在pycharm上运行没问题,搬到服务器上也一样ok了(天真),昨天反复测试,发现运行虽然没报错,但是始终没产生最新的报告,就在于我这个./report写成了

用 Python 实现打飞机,让子弹飞吧!

女生的网名这么多〃 提交于 2020-04-08 13:00:03
所用技术和软件 python 2.7 pygame 1.9.3 pyCharm 准备工作 安装好 pygame 在第一次使用 pygame 的时候,pyCharm 会自动 install pygame。 下载好使用的素材。 技术实现 初始化 pygame 首先要初始化 pygame ,之后设定一些基本的要点,比如窗口大小(尽量避免魔法数字),窗口标题以及背景图像。pygame 通过加载图片,最后返回一个 surface 对象,我们不需要关系图片的格式。但是通过 convert() 这个函数,会使我们的图片转换效率提高。 默认图片左上角为原点 (0,0)。 显示窗口 如果我们这样设定,当我们运行的时候,窗口会一闪而过,并不会出现我们想象的画面。因为窗口只是运行一下就会关闭,所以我们要写一个循环,使窗口一直保持出现。当然如果我们简单的写一个 while True那么我们的程序就出现了死循环,卡死。 所以还需要写个退出。 显示飞机 首先我们要初始化我们的主角飞机 仍旧需要加载我们需要的资源,我们的资源文件里已经准备好各种各样的飞机,但是他们都在一张切图上。 同时我们的资源文件里还有一个叫做 shoot.pack 的文件,里面记录了每个图片所在的位置。 我们通过下面的代码加载资源图片,并且获得我们需要的主角飞机。 效果如下 让飞机 “飞” 起来 飞机已经出现在我们的屏幕上了

Why does PyCharm use 120 Character Lines even though PEP8 Specifies 79?

坚强是说给别人听的谎言 提交于 2020-04-07 17:01:07
问题 PEP8 clearly specifies 79 characters, however, PyCharm defaults to 120 and gives me the warning "PEP8: line too long (... > 120 characters)". Did previous versions of PEP8 use 120 and PyCharm not update its PEP8 checker? I couldn't find any previous versions of the PEP8 Guide, however, I can easily find previous version of the PEP8 Python scripts. I'm starting a new Python project and I'm not sure which to use. References: http://legacy.python.org/dev/peps/pep-0008/ 回答1: PyCharm is built on

Why does PyCharm use 120 Character Lines even though PEP8 Specifies 79?

自闭症网瘾萝莉.ら 提交于 2020-04-07 17:00:47
问题 PEP8 clearly specifies 79 characters, however, PyCharm defaults to 120 and gives me the warning "PEP8: line too long (... > 120 characters)". Did previous versions of PEP8 use 120 and PyCharm not update its PEP8 checker? I couldn't find any previous versions of the PEP8 Guide, however, I can easily find previous version of the PEP8 Python scripts. I'm starting a new Python project and I'm not sure which to use. References: http://legacy.python.org/dev/peps/pep-0008/ 回答1: PyCharm is built on

Python编程开发 2020.1

雨燕双飞 提交于 2020-04-07 14:47:50
PyCharm pro for Mac是一款Mac平台上的Python IDE 开发软件。PyCharm pro Mac享受高效的Python、Django和Web开发。它的智能代码编辑器为Python、JavaScript、CoffeeScript、类型记录、CSS、流行模板语言等提供了一流的支持,且你的代码了如指掌。依靠它实现智能代码完成,实时错误检查和快速修复,容易的项目导航,等等。现在提供PyCharm 2020中文破解版下载,附PyCharm2020激活码 PyCharm版本比较 PyCharm pro for Mac地址: https://www.macdown.com/mac/1244.html 来源: oschina 链接: https://my.oschina.net/u/4431535/blog/3223102

Restrict core usages PyCharm

末鹿安然 提交于 2020-04-07 04:20:57
问题 I have this program that I've written in PyCharm. This program should be running for a week or so, and it is very processor-needy. So when I run it I pretty much have no use of my notebook, as it becomes very laggy. Is there a way to somehow tell PyCharm to use first three of my cores and leave one for other programms so they can operate normally? 回答1: Go into task manager Find the running task (it probably won't be the main pycharm window) Right click and select "go to details" Right click