自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(8)
  • 收藏
  • 关注

原创 ESP32 micropython 为整个系统添加自己的module

添加外部模块MODULE:(起名字为ming,随意取得)1.ports/esp32下面新建.C文件Ex:modming.c 程序如下#include <stdio.h>#include <string.h>#include “py/obj.h”#include “py/runtime.h”//a.定义方法STATIC mp_obj_t ming_shuchu(void) {int result;result = 10;return mp_obj_new_i

2020-07-21 14:54:56 967

原创 An Introduction to Interactive Programming in Python 第七周作业

最后一个作业了 还记着当时大概做了一周才做完。效果图:图片一直上传失败,下次补图。import simpleguiimport randomimport math# globals for user interfaceWIDTH = 800HEIGHT = 600score = 0lives = 3time = 0.5class ImageInfo: def __init__(self, center, size, radius = 0, lifespan = None,

2020-07-18 22:07:37 95

原创 An Introduction to Interactive Programming in Python 第六周作业

第一次使用画布,还是比较新奇。import simpleguiimport random # load card sprite - 949x392 - source: jfitz.comCARD_CENTEN=[53,70]CARD_SIZE =[106,140]card_images = simplegui.load_image("http://image.baidu.com/search/down?tn=download&word=download&ie=utf8&amp

2020-07-18 21:58:46 100

原创 An Introduction to Interactive Programming in Python 第六周作业

描述:颠倒相同的扑克牌就会常亮。上代码,逻辑废点脑子import simpleguiimport randomnumbers = [0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]STATE = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]f=s=t=n=0turn = click = 0label = 0def new_game(): global numbers,state,turns,click random.shuff

2020-07-18 21:57:20 80

原创 An Introduction to Interactive Programming in Python 第五周作业

这个当时做的时候花费了一些时间,。主要功能WS,箭头上下控制两侧板子移动,来弹走小球,每碰撞一次,小球速度会增加一倍。import simpleguiimport randomWIDTH = 600HEIGHT = 400BALL_RADIUS = 20BALL_POS = [WIDTH/2 ,HEIGHT/2 ]PAD_WIDTH = 8PAD_HEIGHT = 80HALF_PAD_WIDTH = PAD_WIDTH / 2HALF_PAD_HEIGHT = PAD_HEIGH

2020-07-18 21:55:08 111

原创 An Introduction to Interactive Programming in Python 第四周 计时器

计时器,简单的逻辑使用# template for "Stopwatch: The Game"import simplegui# define global variablesA = 0B = 0C = 0D = 0E = 0F = 0status = False# define helper function format that converts time# in tenths of seconds into formatted string A:BC.D#def form

2020-07-18 21:51:07 79

原创 An Introduction to Interactive Programming in Python 第二周

第二次作业先上效果图。import simpleguiimport randomcount = 7def new_game(): global num global num_range print "new game.range is from 0 to 100" print "number of remaining guesses is 7" print "" num = random.randrange(0,100)

2020-07-18 21:44:20 130

原创 An Introduction to Interactive Programming in Python 第一周

即将新换电脑为了防止自己所做过的项目丢失,今天开始,就把一些做过的小东西上传到这里,以后也方便查看。效果图:第一次作业比较简单,上代码不多说。# Rock-paper-scissors-lizard-Spock template# The key idea of this program is to equate the strings# "rock", "paper", "scissors", "lizard", "Spock" to numbers# as follows:## 0

2020-07-18 21:39:14 129

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除