使用Vpython作图(helloworld)

时间:2026-02-12 07:40:47

1、先在ubuntu下安装vpython

sudo apt-get install Python-visual

2、进入python

导入模块 from visual.text import *

3、输入代码:scene.title = "Hello World"

text(pos=(0,3,0), string='HELLO WORLD', color=color.orange, depth=-1, justify='center')  

text(pos=(0,0,0), string='HELLO WORLD', color=color.orange, depth=0, justify='center')  

text(pos=(0,-3,0), string='HELLO WORLD', color=color.orange, depth=1, justify='center')  

使用Vpython作图(helloworld)

4、可见下图

使用Vpython作图(helloworld)

5、回车;

可见下图

使用Vpython作图(helloworld)

6、初步完成Vpython demo

© 2026 途途旅游
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com