鱼C论坛

 找回密码
 立即注册
查看: 747|回复: 1

[作品展示] 快进来看呀!

[复制链接]
发表于 2020-4-12 15:01:05 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
在文件夹里创建一个文件命名为test1.py,代码如下:
  1. import pygame; import pygame.freetype
  2. from sys import exit; from os import system
  3. pygame.init()
  4. window_color = 255, 255, 255
  5. window_size = 600, 400
  6. window = pygame.display.set_mode(window_size)
  7. writer = pygame.freetype.Font('C://windows//Fonts//msyh.ttc', 36)
  8. while True:
  9.     for event in pygame.event.get():
  10.         if event.type == pygame.QUIT:
  11.             exit()
  12.         elif event.type == pygame.KEYDOWN:
  13.             if event.key == pygame.K_q:
  14.                 system('start https://fishc.com.cn')
  15.             elif event.key == pygame.K_w:
  16.                 system('start https://ilovefishc.com')
  17.             elif event.key == pygame.K_e:
  18.                 system('start https://www.baidu.com')
  19.             elif event.key == pygame.K_r:
  20.                 system('start test2.html')
  21.             elif event.key == pygame.K_t:
  22.                 system('start test3.html')
  23.     window.fill(window_color)
  24.     writer.render_to(window, (100, 50), '快来学习编程啦', fgcolor=pygame.Color('green'), size=50)
  25.     writer.render_to(window, (25, 100), '编程可是一个好东西,千万别错过!', fgcolor=pygame.Color('black'))
  26.     writer.render_to(window, (25, 140), '编程锻炼脑力,工作月薪过万,简直是天上掉的馅饼啊!', fgcolor=pygame.Color('black'), size=20)
  27.     writer.render_to(window, (25, 170), '按下Q键即可来到鱼C论坛', fgcolor=pygame.Color('red'), size=20)
  28.     writer.render_to(window, (25, 200), '按下W键即可来到鱼C官方', fgcolor=pygame.Color('red'), size=20)
  29.     writer.render_to(window, (25, 230), '按下E键即可来到百度', fgcolor=pygame.Color('blue'), size=20)
  30.     writer.render_to(window, (25, 260), '另外,按下R键有惊喜哦(偷笑)', fgcolor=pygame.Color('blue'), size=20)
  31.     writer.render_to(window, (25, 290), '再试试按T键哦!', fgcolor=pygame.Color('gold'), size=20)
  32.     pygame.display.update()
复制代码

然后再在相应文件夹创建一个文件命名为test2.html,代码如下:
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.         <title>R键的惊喜</title>
  5.         <style>
  6.                 .important {
  7.                         color: green;
  8.                 }
  9.                 .normal {
  10.                         color: blue;
  11.                 }
  12.                 .veryimportant {
  13.                         color: red;
  14.                 }
  15.         </style>
  16. </head>
  17. <body>
  18.         <h1 class=normal>编程是个好东西</h1>
  19.         <p class=veryimportant>编程,是最最好的东西。即能<strong>锻炼脑力</strong>,还能<strong>月薪过万</strong>。</p>
  20.         <p class=normal>那,作者和编程又有什么关系呢?</p>
  21.         <p class=important>作者从<strong>8岁</strong>开始研究<strong>python, html和css</strong>。发现自己对编程挺感兴趣的,就学了下去,一直到现在...</p>
  22.         <p class=veryimportant>你现在如果在学编程,就千万不要半途而废,也可以去鱼C论坛:<a href="https://fishc.com.cn" target="_blank">https://fishc.com.cn</a>,官网:<a href="https://ilovefishc.com" target="_blank">https://ilovefishc.com</a></p>
  23.         <p class=veryimportant>如果现在不在学编程,那就赶快<strong>行动起来</strong>把!邮箱:asionking@163.com</p>
  24.         <p class=normal><br><br><br>永远爱你们的作者^_^</p>
  25. </body>
  26. <html>
复制代码

再然后再再相应文件夹创建一个文件命名为test3.html,代码如下:
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.         <title>404 Not Found</title>
  5. </head>
  6. <body>
  7.         <p>Not Any Found T_T</p>
  8. </body>
  9. <html>
复制代码

完成^_^
提示一下,只有即学过python的pygame和html5的才能看的懂
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2020-4-12 15:02:10 | 显示全部楼层
谁能看得懂呀
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-6-14 16:30

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表