1.python怎么做动态的球球?
变量名字只是为了用户使用方便而使用的,对于计算机,根本就不知道这中间的东西,看待这些都是使用内存的地址来判别的,对于你这样的情况是无法直接利用java实现的,不过可以使用另外一种方法.
就是定义一个类,类中有两个属性,一个是String类型,一个是int类型,这样循环定义100个对象,每个对象的String类型成员存放的是int1。.int100,而int类性的成员则存放的是相应的数值。这样一来就可以轻松解决了,而且这一百个对象可以定义成例如 Fun[]bj=new Fun[100];这样一来,就可以利用数组的操作来实现任意操作了!!
2.python怎么做动态的球球
变量名字只是为了用户使用方便而使用的,对于计算机,根本就不知道这中间的东西,看待这些都是使用内存的地址来判别的,对于你这样的情况是无法直接利用java实现的,不过可以使用另外一种方法. 就是定义一个类,类中有两个属性,一个是String类型,一个是int类型,这样循环定义100个对象,每个对象的String类型成员存放的是int1。
.int100,而int类性的成员则存放的是相应的数值。这样一来就可以轻松解决了,而且这一百个对象可以定义成例如 Fun[]bj=new Fun[100];这样一来,就可以利用数组的操作来实现任意操作了!。
3.等一个大佬啊 要求用python创建一个窗口,窗口按钮功能是创建一个球
下面的代码是创建一个立方体
'''
This examples creates and displays a simple box.
'''
# The first line loads the init_display function, necessary to
# enable the builtin simple gui provided with pythonocc
from OCC.Display.SimpleGui import init_display
# Then we import the class that instanciates a box
# Here the BRepPrimAPI module means Boundary Representation Primitive API.
# It provides an API for creation of basic geometries like spheres,cones etc
from OCC.BRepPrimAPI import BRepPrimAPI_MakeBox
# Following line initializes the display
# By default, the init_display function looks for a Qt based Gui (PyQt, PySide)
display, start_display, add_menu, add_function_to_menu = init_display()
# The BRepPrimAPI_MakeBox class is initialized with the 3 parameters of the box: widht, height, depth
my_box = BRepPrimAPI_MakeBox(10., 20., 30.).Shape()
# Then the box shape is sent to the renderer
display.DisplayShape(my_box, update=True)
# At last, we enter the gui mainloop
start_display()创建页面
#coding:utf8
import wx
app = wx.App() #创建对象
win = wx.Frame(None,title="ahuang1900", size=(410,340)) #创建窗口对象
wx.Button(win, label="open", pos = (245,5), size=(80,25)) #创建按钮1
wx.Button(win, label="save", pos = (325,5), size=(80,25)) #创建按钮2
wx.TextCtrl(win, pos=(5,5), size=(240,25)) #创建文本框1
#创建文本框2
wx.TextCtrl(win, pos=(5,35), size=(400,300), style=wx.TE_MULTILINE|wx.HSCROLL)
win.Show() #显示
app.MainLoop() #主事件循环
转载请注明出处编程代码网 » python画球(python怎么做动态的球球?)