pycharm

PyCharm的安装和注册

五迷三道 提交于 2020-01-24 08:30:25
  第一次安装PyCharm,网上的教程都不能一次成功,参照两篇博客才完成了自己电脑上的安装,然后获得了比较长的使用期限(请大家支持正版~_~)。   目前电脑为32位w7,PyCharm版本为2018.3.3 Professional专业版,在下载安装的时候没有区分32位还是64位,安装的时候有安装版本选项,但选项是黑色不支持选择,但不影响安装和使用。   现在安装软件放在百度网盘中。   因为是参照两篇博客来的,给以后自己安装留一个引子,部分图片就照搬过来了,安装过程也是大同小异,大家参考即可,忘作者大量。   1、下载直接去官网下载相应版本就是了,不熬述了。   2、打开安装包,进行安装,弹出界面   3、选安装目录,一般常用安装目录,点击Next,进入下一步。   4、Create Desktop Shortcut创建桌面快捷方式,一个32位,一个64位,安装时32位是灰色的,不能勾选,但安装后,发现能用,因为也不是常用开发,也就将就了。 勾选Create Associations是否关联文件,选择以后打开.py文件就会用PyCharm打开。然后点击Next 进入下一步。   5、这一步什么都不用做,直接默认安装即可,然后点击下一步。   6、然后就是读条安装   7、点击上图的Finish,完成安装,接下来就是进入延长使用期限设置。 点击桌面图面,进入如下界面。选择Do

pycharm无法import自己写的module

雨燕双飞 提交于 2020-01-24 05:00:55
系统环境: win10 pycharm 3.4.1 python 3.6 解决过程: 由于pycharm是英文版,自己写的module无法导出,作为一个小白,网上的大多是其他无法导出的问题,于是自己摸索设置,找到了问题所在,pycharm没有默认Sources自己写的module,还好常用linux,看到以下截图就sources了一下目录就可以了。 来源: CSDN 作者: 多功能产品大佬 链接: https://blog.csdn.net/weixin_41715151/article/details/79271572

Unexpected Warning using Enum Functional API - PyCharm Bug

吃可爱长大的小学妹 提交于 2020-01-24 04:24:07
问题 Using the Functional API example given in documentation 8.13.12. I get the following Warning (using python 3.6). The code does work in the console but I'd rather not have warnings upon my code inspection. What am I doing wrong? And how can I get rid of the warning? from enum import Enum Animal = Enum('Animal', 'ANT BEE CAT DOG') Unexpected argument(s) Possible callees: Enum. new (cls: Enum, value) object(self: object) less... (Ctrl+F1) Inspection info: Reports discrepancies between declared

1.5 PyCharm连接数据库

有些话、适合烂在心里 提交于 2020-01-24 03:11:44
连接数据库 1.导入第三方库 as:别名 import pymysql as mysql #加载所有 from pymysql import connect #加载局部 2.conncet连接函数 host = "localhost" #127.0.0.1=本机IP user = "root" password = "123456" db = "mysql" #数据z库 port = 3306 #number类型 dbHelp=mysql.connect(host=host,user=user,password=password,db=db,port=port) print("连接成功") 3.获取游标:执行、编译str类型SQL语句 cur=dbHelp.cursor() 4.创建表结构 cur.execute("CREATE TABLE IF NOT EXISTS user_info(ID INT PRIMARY KEY AUTO_INCREMENT" ",name VARCHAR(25))") #1.插入:返回值,0,失败 >0:成功 i=cur.execute("INSERT INTO user_info(name) VALUES('Liyifeng')") dbHelp.commit() #提交 print(i) #2.修改:返回值,0,失败 >0:成功 #格式化字符串:

How to format django template in Sublime Text

耗尽温柔 提交于 2020-01-24 02:13:06
问题 How can one format django template in Sublime Text. My template consists of: HTML (django template language with {{ variable }} and {% stuff %} ) javascript Is there a way to get same kind of formatting PyCharm provides? 回答1: This package should help: https://github.com/squ1b3r/Djaneiro Here are some tips on install: How to install plugins to Sublime Text 2 editor? 回答2: A couple different things: Djanerio has a nice set of auto-completion and color schemes specific to Django. Check out their

Library to extract data from open Excel workbooks

拟墨画扇 提交于 2020-01-24 01:54:07
问题 I am trying to extract data from workbooks that are already open. I have found the xlrd library, but it appears you can only use this with workbooks you open through Python. The workbooks I will use in my project have already been opened, so this method is unusable. A second library I found, which is OpenPyxl, only returns errors for me, even though the workbook is open: from openpyxl import load_workbook wb = load_workbook(filename = 'Components V2.4.3.xlsm') returns: FileNotFoundError:

Pycharm设置

随声附和 提交于 2020-01-23 23:48:06
新建项目 1、点击File,选择New project 2、选择Existing interpreter(新手不要选择NEW,那是虚拟环境,可能会导致模块找不到) 3、选择Python的安装目录 4、点击attack 设置 1、点击File,选择setting 2、搜索File encodeding,都选择UTF-8 3、font用来选择字体,模式 4、代码格式设置,都勾选上 5、代码警告,取消勾选 6、文件头设置 来源: https://www.cnblogs.com/ink-yan/p/12231647.html

PyCharm下载包出错

六月ゝ 毕业季﹏ 提交于 2020-01-23 19:43:49
PyCharm安装成功之后添加所需的包: File —>Settings… —>Project:(此处是你的Python工作环境) —>Project Interpreter 红色剪头所指 添加需要的包 点开时候出现错误信息: Error loading package list:pypi.python.org 如下图 解决方案:把无线网连接关闭之后用手机的4G网络,用电脑连接手机的热点,重复上述操作之后即可下载所需的包(用手机热点有可能会很慢,我的就很慢,但是没有再报错。无ERROR即真理…) 来源: CSDN 作者: Blue Fat 链接: https://blog.csdn.net/weixin_46038856/article/details/103995198

python unittest.TestCase.assertRaises not working

对着背影说爱祢 提交于 2020-01-23 13:15:27
问题 I'm trying to run tests on my 'add' function in Python but it is giving an error : 7 E ====================================================================== ERROR: test_upper (__main__.TestStringMethods) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:/Users/MaZee/PycharmProjects/andela/asdasd.py", line 22, in test_upper self.assertEqual("Input should be a string:", cm.exception.message , "Input is not a string:")

python unittest.TestCase.assertRaises not working

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-23 13:15:07
问题 I'm trying to run tests on my 'add' function in Python but it is giving an error : 7 E ====================================================================== ERROR: test_upper (__main__.TestStringMethods) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:/Users/MaZee/PycharmProjects/andela/asdasd.py", line 22, in test_upper self.assertEqual("Input should be a string:", cm.exception.message , "Input is not a string:")