pycharm

why does my function is returning data type None??: Python datatype None

做~自己de王妃 提交于 2020-01-07 09:54:40
问题 This is my python code for printing an absolute number. My function is returning type None . I am not getting what I have done wrong. Please help me. def n(num): if num<0: return (num*-1) no = input("Enter a number: ") print "Absolute Value is: " print n(no) 回答1: def n(num): if num<0: return (num*-1) else: return num no = input("Enter a number: ") print "Absolute Value is: " print n(no) writing an else statement will return num >= 0 Thank You :) 回答2: The return is on the condition. Try : def

why does my function is returning data type None??: Python datatype None

天涯浪子 提交于 2020-01-07 09:54:05
问题 This is my python code for printing an absolute number. My function is returning type None . I am not getting what I have done wrong. Please help me. def n(num): if num<0: return (num*-1) no = input("Enter a number: ") print "Absolute Value is: " print n(no) 回答1: def n(num): if num<0: return (num*-1) else: return num no = input("Enter a number: ") print "Absolute Value is: " print n(no) writing an else statement will return num >= 0 Thank You :) 回答2: The return is on the condition. Try : def

OSError: [Errno 48] Address already in use [duplicate]

浪子不回头ぞ 提交于 2020-01-07 09:36:26
问题 This question already has answers here : Python - How to run multiple flask apps from same client machine (2 answers) Closed last year . I'm trying to setup a server from Mac terminal. I've established a connection on port 5000 and want to open another port in 5002. After navigating to the folder location: python Blockchain.py -p 5002 But this gives an error: OSError: [Errno 48] Address already in use I've referred various answers on the same issue: [socket.error: [Errno 48] Address already

Pycharm 常用快捷键

*爱你&永不变心* 提交于 2020-01-07 04:45:56
Pycharm 常用快捷键 常用快捷键 快捷键 功能 Ctrl + Q 快速查看文档 Ctrl + F1 显示错误描述或警告信息 Ctrl + / 行注释(可选中多行) Ctrl + Alt + L 代码格式化 Ctrl + Alt + O 自动导入 Ctrl + Alt + I 自动缩进 Tab / Shift + Tab 缩进、不缩进当前行(可选中多行) Ctrl+C/Ctrl+Insert 复制当前行或选定的代码块到剪贴板 Ctrl + D 复制选定的区域 Ctrl + Y 删除当前行 Shift + Enter 换行(不用鼠标操作了) Ctrl +J 插入模版 Ctrl + Shift +/- 展开/折叠全部代码块 Ctrl + Numpad+ 全部展开 Ctrl + Numpad- 全部折叠 Ctrl + Delete 删除到字符结束 Ctrl + Backspace 删除到字符开始 Ctrl + Shift + F7 将当前单词在整个文件中高亮,F3移动到下一个,ESC取消高亮。 Alt + up/down 方法上移或下移动 Alt + Shift + up/down 当前行上移或下移动 Ctrl + B/鼠标左键 转到方法定义处 Ctrl + W 选中增加的代码块 Shift + F6 方法或变量重命名 Ctrl + E 最近访问的文件 Esc 从其他窗口回到编辑窗口

Python dataframe interaction

ぃ、小莉子 提交于 2020-01-07 04:41:11
问题 I have the following dataframe: topic student level week 1 a 1 1 1 b 2 1 1 a 3 1 2 a 1 2 2 b 2 2 2 a 3 2 2 b 4 2 The new dataframe should represent an interaction between students through the topic. It should contain four columns: " student source ", " student destination ", " week " and " reply count ". Student Destination is a student that each student shared the topic with. Reply count is a number of times in which Student Destination "directly" replied to Student Source . The new

PyCharm 2018专业版 安装和永久激活方法

无人久伴 提交于 2020-01-07 03:25:03
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 前言 PyCharm是开发python的ide,大家都知道现在人工智能大数据的崛起又推起了学习python的热潮,学习python之前,我们先把工具安装好。 今天来介绍下PyCharm的安装与激活。 安装 1、 官网下载pycharm,我的电脑是windows版本。 也可网盘自取: 链接: https://pan.baidu.com/s/1m3ohNRJQSqSW0iOyI4qpOA 提取码:00oz 2.双击exe文件,安装。 点击Next,选择安装路径。 接下来一路 Next,直至安装完成。 安装完成后,退出pycharm。接下来我们就来做激活工作。 先看第一种:注册码激活 1.先将“0.0.0.0 account.jetbrains.com”添加到hosts文件中,记得保存。 hosts文件位置:C:\Windows\System32\drivers\etc 2.打开软件,选择Activation code,复制下方的注册码。将其填入激活框内,点击ok。 K71U8DBPNE

How to use Pycharm forever!

好久不见. 提交于 2020-01-07 02:24:52
一、注意事项 1、PyCharm一定要是在官网下载:https://www.jetbrains.com/pycharm/download/ 2、本教程适用于PyCharm所有版本 3、本教程适用于jetbrains全系列产品 4、不需要修改hosts文件,如果修改请移除jetbrains相关的项目 5、配置文件修改已经不在bin目录下直接修改,而是通过pycharm修改 二、步骤 1.下载文件 点击链接 https://pan.baidu.com/s/1v4g_fNTZse7piY9aPXNN9g 下载文件 jetbrains-agent.jar 并将它放置到 pycharm安装目录的\bin目录下。 2.先点击试用 点击窗口的“Evaluate for free”免费试用,然后再创建一个空项目,这样就可以进入到pycharm的工作页面 3.修改配置文件 注意:配置文件修改已经不在bin目录下直接修改,而是通过pycharm修改! 进入到项目界面后,点击Pycharm最上面的菜单栏中的 “Help” -> “Edit Custom VM Options …”。 如果提示是否要创建文件,请点”create”。 在打开的vmoptions编辑窗口末行添加:-javaagent:D:\PyCharm2018\bin\jetbrains-agent.jar (-javaagent

pycharm step over shortcut on Mac

元气小坏坏 提交于 2020-01-07 01:50:23
问题 I'm on Mac with Pycharm. During debug, when I press F8 for step over shortcut, I actually triggers iTunes because F8 is for play/Stop music by default. Any idea what shortkey I can use for step over? 回答1: mmm, 2 options, you can go to settings in mac and go to keybpard, unchek use F1, F2 ,etc, as standar functions keys the another options is that sometimes you can press FN key and then the F8 key, and see what happens... 来源: https://stackoverflow.com/questions/38690874/pycharm-step-over

pycharm永久激活

匆匆过客 提交于 2020-01-06 23:35:44
一:下载破解包 链接: https://pan.baidu.com/s/1z6gWjhnXZTT-FA_UflPgrQ 提取码: 5k78 复制这段内容后打开百度网盘手机App,操作更方便哦 二:将下载好的破解包放置在pycharm安装bin目录下 三:用nodpad++打开pycharm.exe.vmoptions和pycharm64.exe.vmoptions 增加:-javaagent:C:\Program Files\JetBrains\PyCharm 2017.2.3\bin\jetbrains-agent.jar -javaagent: # 固定开头 C:\Program Files\JetBrains\PyCharm 2017.2.3\bin\ # pycharm安装路径 jetbrains-agent.jar # 破解包 四:重新打开pycharm,并在激活方式里选择server激活:(http://jetbrains-license-server) 五:pycharm可以正常使用(网上都说是永久激活。不知道是不是真的) 来源: https://www.cnblogs.com/52-qq/p/12151506.html

今天遇到的两个小问题

纵饮孤独 提交于 2020-01-06 20:26:54
#今天遇到的两个小问题 2020/01/04 1.打开PyCharm 报cannot determine module type (“PYTHON_MODULE”) for the following module 解决方法:删除目录下的.idea文件夹,并重启PyCharm。 JB全家桶的软件应该都适用这个方案。 2.Anacon Prompt 切换不了盘符 解决方法:这玩意只能在根目录下切换盘符,所以,cd…,cd…,直到根目录,之后切换盘符。 来源: CSDN 作者: 子夕听雨 链接: https://blog.csdn.net/lbllol365/article/details/103835681