pycharm

数据库:pycharm与mysql的连接

守給你的承諾、 提交于 2020-01-15 14:52:36
数据库:pycharm与mysql的连接 前言: 数据库最主要的作用就是数据存储,那么肯定需要编程对数据库进程操作,进行简单的增删查改,那么python如何连接mysql呢? pycharm使用: 1.打开PyCharm,单击“file”,然后选中“New Project…" . 2.然后单击“Creat"。创建工程。 3.现在,将鼠标放在创建的工程上,单击鼠标右键,然后依次选择“New>Python File". 4.然后会弹出一个”New Python File"的窗口,输入名字后单击“OK”。 代码: #导入pymysql模块 import pymysql #连接database conn = pymysql.connect(host=‘localhost’, user=’’,password=’’,database=’’,charset=‘utf8’) #得到一个可以执行SQL语句的光标对象 cursor = conn.cursor() #执行SQL语句 sql2=“call rank2();” cursor.execute(sql2) redata=cursor.fetchall() #打印结果 data=cursor.fetchone() for row in redata: for each in row: print(str(each)+’ ‘,end=’’)

PyCharm can't resolve references to PyQT5 modules

China☆狼群 提交于 2020-01-15 10:15:52
问题 I'm trying to learn how to use PyQT5. I created a new folder under my user profile and spun up a virtualenv (and installed PyQT5 from pip3) in a folder called env . I created the project in another folder called guis and pointed PyCharm to the env environment. Pycharm can't find the submodules but sees PyQT5.QtWidgets just fine. Screnshot: 回答1: I got it to work by removing PyQT5 from Settings > Project > Project Interpreter and reinstalling it within PyCharm . Restart PyCharm afterwards. 回答2:

Ubuntu16.04中Pycharm的安装+修改Pycharm字体+Pycharm上配置conda

亡梦爱人 提交于 2020-01-15 06:14:38
(一)安装PyCharm社区版 一、官方源安装 linux的PyCharm的专业版: https://www.jetbrains.com/pycharm/download/download-thanks.html?platform=linux linux的PyCharm的社区版(免费): https://www.jetbrains.com/pycharm/download/download-thanks.html?platform=linux&code=PCC 我安装的是PyCharm社区版:pycharm-community-2019.3.1/bin/pycharm.sh 二、安装并启动 1、点击链接: https://www.jetbrains.com/pycharm/download/download-thanks.html?platform=linux&code=PCC 下载Pycharm安装包,下载完成后如下所示: 在“下载”文件夹中打开终端,解压缩安装包: tar - zxvf pycharm - community - 2019.3 .1 . tar . gz 2、将解压缩后的目录移动到 /opt 目录下,方便其他用户使用 (/代表根目录): /opt 目录 :用户存放给主机额外安装的软件 sudo mv pycharm - community - 2019.3 .1

PyCharm Community 3.1.1 and Numpy, “'matrix' is not callable”, but the code works

China☆狼群 提交于 2020-01-15 05:42:27
问题 I have the following code: import numpy as np if __name__ == "__main__": m = np.matrix([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) print(m) The code runs as expected, but PyCharm seems to think that 'matrix' is not callable. See screenshot. Since the code runs, clearly 'matrix' is callable. So what's PyCharm complaining about? Am I in the wrong here or is PyCharm? How do I suppress this error? 回答1: A simple workaround, at least until the bug is fixed, is to use np.mat(...) instead of np.matrix(...) .

pycharm的安装及用法

ⅰ亾dé卋堺 提交于 2020-01-15 04:47:25
  pycharm 2019年10月激活码:https://blog.csdn.net/qq_33733970/article/details/86751838   俗话说的好:“工欲善其事,必先利其器”,程序员写代码,肯定不能在编译器里面写,这有一个全宇宙最好的python编译器,叫做pycharm ,他的优点呢,大家可以看一下:   优点:1,代码自动补全      2,语法错误提醒      3,代码调试      4,性能测试      5,web开发框架支持      6,git/svn支持 pycharm的安装: 第一步:去官网下载安装包,(官网地址: https://www.jetbrains.com/pycharm/download/#section=windows ) 下载好的安装包如下: 第二步安装:双击安装包进行安装 第三步:安装(最好自定义,而且安装路径最好不要有中文字符) 第四步:创建桌面快捷方式并关联*.py文件 第五步:选择 开始 菜单文件夹(默认即可),点击安装 第六步:等待 第七步:安装完成后,勾选立即运行pycharm 第八步:选择是否导入开发环境配置文件,我们选择 不导入 。,然后选择激活码,继续 第九步:激活,方法如下: 软件激活方式   1、推荐购买正版软件。   2、可以选择下载社区版本,免费的。   3、专业版本可以选择试用

How to create documentation for Python variables that will be visible in PyCharm quick documentation functionality?

一个人想着一个人 提交于 2020-01-15 04:02:07
问题 I have a file named PushButtonType.py where I define two variables: OK = 0 # acts like a OK button. """ acts like a cancel button. """ CANCEL = 0 In another file, I import and use those variables: from PushButtonType import CANCEL, OK foo = CANCEL bar = OK I want the comments from the first file to be visible in the Quick Documentation (Ctrl+Q) functionality of PyCharm. Currently, when I put a cursor on one of the variables and press Ctrl+Q, I get a message saying "No documentation found"

Python3+Pycharm+PyQt5环境搭建步骤

一笑奈何 提交于 2020-01-15 02:56:21
Python3+Pycharm+PyQt5环境搭建步骤 搭建环境: 操作系统:Win10 64bit Python版本:3.7 Pycharm:社区免费版 一、Python3.7安装 下载链接:官网 https://www.python.org/downloads/windows/ 或腾讯软件中心下载 https://pc.qq.com/detail/5/detail_24685.html 或其他站点下载。我下载的是python-3.7.0-amd64。 下载到安装包后打开,如果想安装到默认路径(C盘)的话一直点下一步就可以了,或者自定义安装到其他分区,我的安装在D盘D:\Python37下。安装时选择加入环境变量,这样就不需要人工设置。 安装后在命令行输入python如果能进入python交互式界面就意味着安装成功了。 pycharm 安装包下载: http://www.jetbrains.com/pycharm/download/#section=windows 我下载的是pycharm-community-2019.1.1版本。 下载后双击打开,默认安装即可,此处略。 安装完成后打开,点击“Create new Project” 新建一个项目。 在Location输入项目路径,选择已经存在的Python解释器。 选择系统解释器。 新建的项目: 进入设置界面(快捷键Ctrl

pycharm2019+anaconda3远程调试配置

 ̄綄美尐妖づ 提交于 2020-01-15 01:41:40
针对过程中遇到的问题,找到如下解决办法: 转自:https://blog.csdn.net/manduner/article/details/82349788 1,前言 本篇文章的方法转载自 https://blog.csdn.net/qq_15192373/article/details/81231095 ,该博文提供的两种方法非常实用,亲测有效。写本篇博文,一是,为了大家遇到同样问题的时候能够更快速的找到实用的解决办法;二是,对原博文书写不当的地方进行了修正,并给出了自己测试使用后的总结 2,问题描述 在本地windows环境下通过pycharm远程调试GPU服务器上的python程序,程序出现如下错误: 2,解决办法 (1)方法一: 1)在Pycharm中添加环境变量 ,右上角倒三角下拉,进入菜单Edit configurations, 2)打开重新添加环境变量 :Environment variables 那栏 3)增加:PYTHONUNBUFFERED=1; LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64;/usr/local/lib 添加成功以后就可以正常运行了。 这种方法的坏处是,每次新建文件,都需要手动添加环境变量。 (2)方法二: 1)1步骤同方法1 2)选择左边的default--python,修改Environment

Enable terminal emulation in PyCharm

独自空忆成欢 提交于 2020-01-14 19:52:07
问题 Many people have told me and the PyCharm Release Notes for PyCharm 2.7 touts that PyCharm includes full terminal emulation (I assume this is talking about handling of ANSI escape codes for styling and cursor movement) but I can't seem to find out how to enable this. I've enabled the Terminal plugin but when I try to run or debug a python application which makes use of these escape codes, they are just displayed raw in the console: How can I enable the terminal emulation in PyCharm's debugger?

Unable to integrate Github with Pycharm

ぐ巨炮叔叔 提交于 2020-01-14 17:12:12
问题 I have created a repository on Github. I am using Windows 7 64 bit and Pycharm Community edition. I want to integrate the Github repository with pycharm but I am getting the error Couldn't get the list of GitHub repositories Connect to api.github.com:443 [api.github.com/192.30.252.127] failed: connect timed out Although I am able to clone he same repository from command prompt using git clone command. 回答1: I had the same issue. Configure your proxy if using one: File->Settings->System