10 2019 档案

摘要:一、函数 1、函数定义: 可以完成某个工作的代码块。这是可以用来构建更大程序的一个小部分。 2、创建或定义函数要使用def关键字 3、创建一个函数 1) def 关键字 2)函数名及后面跟随的括号 3)冒号与for循环,while循环,if语句中一样 提醒:函数没被调用前不是主程序的一部分。 4、调用函数 print_nums() 5、向函数传递参数 1)一个参数 def prin... 阅读全文
posted @ 2019-10-27 09:10 绿色的麦田 阅读(238) 评论(0) 推荐(0) 编辑
摘要:一、复习 1、easygui 信息提示对话框 2、easygui 是否对话框 二、easygui其它组件 1、选择对话框:choicebox(msg, title, choices) import easygui as g msg = "输入你喜欢的颜色" title = "游戏互动" choices = ["红色", "绿色", "蓝色", "青色"] choice = g.choicebo... 阅读全文
posted @ 2019-10-19 18:52 绿色的麦田 阅读(446) 评论(0) 推荐(0) 编辑
摘要:一、复习之前的两个练习,巩固计数循环和条件循环 1、系统生成一个随机数1到5,然后让用户的猜测,若猜对了,提示恭喜你,猜对了,否则提示,对不起,你猜错了(提示,1到5的随机数为:secret = random.randint(1, 5)),此行代码之前需先引入随机数模块import random 2、将以下乘法口诀表代码改为while循环 for i in range(1, 9+1): ... 阅读全文
posted @ 2019-10-13 07:23 绿色的麦田 阅读(567) 评论(0) 推荐(0) 编辑
摘要:conf = default_config()deep_update(user_config(), conf)deep_update(project_config(), conf) 三种不同级别的配置,第一个是默认配置,第二个是用户级配置,第三个是工程级配置(这种方法看起来和php的配置逻辑相似) 第四个是命令行若存在config_path选项,则使用config_path提供的配置 get_tr... 阅读全文
posted @ 2019-10-08 22:36 绿色的麦田 阅读(359) 评论(0) 推荐(0) 编辑
摘要:在文件C:\work\python\rqalpha\rqalpha\utils\config.py找文件:C:\work\python\rqalpha\rqalpha\config.yml则通过下面代码即可找到config.yml的绝对路径default_config_path = os.path.join(os.path.dirname(__file__), '..', 'config.yml'... 阅读全文
posted @ 2019-10-08 22:04 绿色的麦田 阅读(310) 评论(0) 推荐(0) 编辑
摘要:1 setup 安装 C:\work\python\rqalpha\setup.py install C:\work\python\rqalpha 2 mod list 列出mod C:\work\python\rqalpha\rqalpha-script.py mod list C:\work\python\rqalpha 3 update-bundle 下载日线级数据 C:\wor... 阅读全文
posted @ 2019-10-06 19:31 绿色的麦田 阅读(417) 评论(0) 推荐(0) 编辑
摘要:一、安装anaconda(python环境) 1 地址:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/?C=M&O=A 选择Anaconda3-5.3.1-Windows-x86_64.exe下载安装 2 安装 一路默认点击安装,在Advanced Options时,增加选中Add Anaconda to the system P... 阅读全文
posted @ 2019-10-01 09:30 绿色的麦田 阅读(360) 评论(0) 推荐(0) 编辑