资源简介
在Authorware中7中调用外部程序,umpOut和JumpOutReturn可以调用外部程序,它们不同于JumpFile, JumpFileReturn,后者只能调用Authoreware自己的文件。带Return的函数可以返回调用文件继续运行。
JumpOut的JumpOutReturn可以加调用参数,语法是: JumpOut("程序名","文档名") ,其中文档名是要程序打开的文档,也可以把用程序执行的参数加在这里.
代码片段和文件信息
# http://blog.tibarazmi.com/draw-flower-using-turtle/
# -*- coding: cp936 -*-
import turtle
import math
def p_line(t n length angle):
“““Draws n line segments.“““
for i in range(n):
t.fd(length)
t.lt(angle)
def polygon(t n length):
“““Draws a polygon with n sides.“““
angle = 360/n
p_line(t n length angle)
def arc(t r angle):
“““Draws an arc with the given radius and angle.“““
arc_length = 2 * math.pi * r * abs(angle) / 360
n = int(arc_length / 4) + 1
step_length = arc_length / n
step_angle = float(angle) / n
# Before starting reduces making a slight left turn.
t.lt(step_angle/2)
p_line(t n step_length step_angle)
t.rt(step_angle/2)
def petal(t r angle):
“““Draws a 花瓣 using two arcs.“““
for i in range(2):
arc(t r angle)
t.lt(180-angle)
def flower(t n r angle p):
“““Draws a flower with n petals.“““
for i in range(n):
petal(t r angle)
t.lt(p/n)
def leaf(t r angle p):
“““Draws a 叶子 and fill it.“““
t.begin_fill() # Begin the fill process.
t.down()
flower(t 1 r angle p)
t.end_fill()
def main():
window= turtle.Screen() #creat a screen
window.bgcolor(“white“)
window.title(“draw a flower“)
lucy= turtle.Turtle()
lucy.shape(“turtle“)
lucy.color(“red“)
lucy.width(3)
#lucy.speed(10)
# Drawing flower
flower(lucy 7 60 100 360)
# Drawing pedicel
lucy.color(“brown“)
lucy.rt(90)
lucy.fd(200)
# Drawing leaf 1
lucy.width(1)
lucy.rt(270)
lucy.color(“green“)
leaf(lucy 40 80 180)
lucy.rt(140)
lucy.color(“black“)
lucy.fd(30)
lucy.lt(180)
lucy.fd(30)
# Drawing leaf 2
lucy.rt(120)
lucy.color(“green“)
leaf(lucy 40 80 180)
lucy.color(“black“)
lucy.rt(140)
lucy.fd(30)
lucy.ht() # hideturtle
window.exitonclick()
main()
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 67430 2018-03-03 16:55 test3.a7p
目录 0 2018-03-03 17:01 test3\
文件 2028 2018-02-20 12:05 test3\draw_flower1.py
文件 1431 2018-02-20 11:35 test3\draw_rose1.py
文件 998 2018-02-20 12:22 test3\draw_xilan1.py
文件 198 2018-03-03 16:52 test3\end.rtf
文件 23464 2018-03-03 16:52 test3\交互.jpg
相关资源
- python实现SGBM图像匹配算法
- python实现灰度直方图均衡化
- scrapy_qunar_one
- Python学习全系列教程永久可用
- python简明教程.chm
- 抽奖大转盘python的图形化界面
- 双边滤波器实验报告及代码python
- python +MYSQL+HTML实现21蛋糕网上商城
- Python-直播答题助手自动检测出题搜索
- OpenCV入门教程+OpenCV官方教程中文版
- Python 串口工具源码+.exe文件
- Python开发的全栈股票系统.zip
- Python操作Excel表格并将其中部分数据写
- python书籍 PDF
- 利用python绘制散点图
- python+labview+No1.vi
- 老男孩python项目实战
- python源码制作whl文件.rar
- python3.5可用的scipy
- PYTHON3 经典50案例.pptx
- 计算机科学导论-python.pdf
- python模拟鼠标点击屏幕
- windows鼠标自动点击py脚本
- 鱼c小甲鱼零基础学python全套课后题和
- Python 练习题100道
- Practical Programming 2nd Edition
- wxPython Application Development Cookbook
- python 3.6
- Python 3.5.2 中文文档 互联网唯一CHM版本
- python3.5.2.chm官方文档
评论
共有 条评论