Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
22
Task/Hello-world-Graphical/Python/hello-world-graphical-1.py
Normal file
22
Task/Hello-world-Graphical/Python/hello-world-graphical-1.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import bpy
|
||||
|
||||
# select default cube
|
||||
bpy.data.objects['Cube'].select_set(True)
|
||||
|
||||
# delete default cube
|
||||
bpy.ops.object.delete(True)
|
||||
|
||||
# add text to Blender scene
|
||||
bpy.data.curves.new(type="FONT", name="Font Curve").body = "Hello World"
|
||||
font_obj = bpy.data.objects.new(name="Font Object", object_data=bpy.data.curves["Font Curve"])
|
||||
bpy.context.scene.collection.objects.link(font_obj)
|
||||
|
||||
# camera center to text
|
||||
bpy.context.scene.camera.location = (2.5,0.3,10)
|
||||
|
||||
# camera orient angle to text
|
||||
bpy.context.scene.camera.rotation_euler = (0,0,0)
|
||||
|
||||
# change 3D scene to view from the camera
|
||||
area = next(area for area in bpy.context.screen.areas if area.type == 'VIEW_3D')
|
||||
area.spaces[0].region_3d.view_perspective = 'CAMERA'
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import tkMessageBox
|
||||
|
||||
result = tkMessageBox.showinfo("Some Window Label", "Goodbye, World!")
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
from tkinter import messagebox
|
||||
|
||||
result = messagebox.showinfo("Some Window Label", "Goodbye, World!")
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
import PyQt4.QtGui
|
||||
app = PyQt4.QtGui.QApplication([])
|
||||
pb = PyQt4.QtGui.QPushButton('Hello World')
|
||||
pb.connect(pb,PyQt4.QtCore.SIGNAL("clicked()"),pb.close)
|
||||
pb.show()
|
||||
exit(app.exec_())
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
import pygtk
|
||||
pygtk.require('2.0')
|
||||
import gtk
|
||||
|
||||
window = gtk.Window()
|
||||
window.set_title('Goodbye, World')
|
||||
window.connect('delete-event', gtk.main_quit)
|
||||
window.show_all()
|
||||
gtk.main()
|
||||
53
Task/Hello-world-Graphical/Python/hello-world-graphical-6.py
Normal file
53
Task/Hello-world-Graphical/Python/hello-world-graphical-6.py
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
# HelloWorld for VPython - HaJo Gurt - 2014-09-20
|
||||
from visual import *
|
||||
|
||||
scene.title = "VPython Demo"
|
||||
scene.background = color.gray(0.2)
|
||||
|
||||
scene.width = 600
|
||||
scene.height = 400
|
||||
scene.range = 4
|
||||
#scene.autocenter = True
|
||||
|
||||
S = sphere(pos=(0,0,0), radius=1, material=materials.earth)
|
||||
rot=0.005
|
||||
|
||||
txPos=(0, 1.2, 0)
|
||||
|
||||
from visual.text import *
|
||||
# Old 3D text machinery (pre-Visual 5.3): numbers and uppercase letters only:
|
||||
T1 = text(pos=txPos, string='HELLO', color=color.red, depth=0.3, justify='center')
|
||||
|
||||
import vis
|
||||
# new text object, can render text from any font (default: "sans") :
|
||||
T2 = vis.text(pos=txPos, text="Goodbye", color=color.green, depth=-0.3, align='center')
|
||||
T2.visible=False
|
||||
|
||||
Lbl_w = label(pos=(0,0,0), text='World', color=color.cyan,
|
||||
xoffset=80, yoffset=-40) # in screen-pixels
|
||||
|
||||
L1 = label(pos=(0,-1.5,0), text='Drag with right mousebutton to rotate view', box=0)
|
||||
L2 = label(pos=(0,-1.9,0), text='Drag up+down with middle mousebutton to zoom', box=0)
|
||||
L3 = label(pos=(0,-2.3,0), text='Left-click to change', color=color.orange, box=0)
|
||||
|
||||
print "Hello World" # Console
|
||||
|
||||
|
||||
cCount = 0
|
||||
def change():
|
||||
global rot, cCount
|
||||
cCount=cCount+1
|
||||
print "change:", cCount
|
||||
rot=-rot
|
||||
if T1.visible:
|
||||
T1.visible=False
|
||||
T2.visible=True
|
||||
else:
|
||||
T1.visible=True
|
||||
T2.visible=False
|
||||
|
||||
scene.bind( 'click', change )
|
||||
|
||||
while True:
|
||||
rate(100)
|
||||
S.rotate( angle=rot, axis=(0,1,0) )
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
import wx
|
||||
|
||||
app = wx.App(False)
|
||||
frame = wx.Frame(None, wx.ID_ANY, "Hello, World")
|
||||
frame.Show(True)
|
||||
app.MainLoop()
|
||||
20
Task/Hello-world-Graphical/Python/hello-world-graphical-8.py
Normal file
20
Task/Hello-world-Graphical/Python/hello-world-graphical-8.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
from kivy.app import App
|
||||
from kivy.uix.floatlayout import FloatLayout
|
||||
from kivy.uix.button import Button
|
||||
from kivy.uix.popup import Popup
|
||||
from kivy.uix.label import Label
|
||||
|
||||
|
||||
class GoodByeApp(App):
|
||||
def build(self, *args, **kwargs):
|
||||
layout = FloatLayout()
|
||||
ppp = Popup(title='Goodbye, World!',
|
||||
size_hint=(0.75, 0.75), opacity=0.8,
|
||||
content=Label(font_size='50sp', text='Goodbye, World!'))
|
||||
btn = Button(text='Goodbye', size_hint=(0.3, 0.3),
|
||||
pos_hint={'center': (0.5, 0.5)}, on_press=ppp.open)
|
||||
layout.add_widget(btn)
|
||||
return layout
|
||||
|
||||
|
||||
GoodByeApp().run()
|
||||
29
Task/Hello-world-Graphical/Python/hello-world-graphical-9.py
Normal file
29
Task/Hello-world-Graphical/Python/hello-world-graphical-9.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
from kivy.app import App
|
||||
from kivy.lang.builder import Builder
|
||||
|
||||
kv = '''
|
||||
#:import Factory kivy.factory.Factory
|
||||
|
||||
FloatLayout:
|
||||
Button:
|
||||
text: 'Goodbye'
|
||||
size_hint: (0.3, 0.3)
|
||||
pos_hint: {'center': (0.5, 0.5)}
|
||||
on_press: Factory.ThePopUp().open()
|
||||
|
||||
<ThePopUp@Popup>:
|
||||
title: 'Goodbye, World!'
|
||||
size_hint: (0.75, 0.75)
|
||||
opacity: 0.8
|
||||
Label:
|
||||
text: 'Goodbye, World!'
|
||||
font_size: '50sp'
|
||||
'''
|
||||
|
||||
|
||||
class GoodByeApp(App):
|
||||
def build(self, *args, **kwargs):
|
||||
return Builder.load_string(kv)
|
||||
|
||||
|
||||
GoodByeApp().run()
|
||||
Loading…
Add table
Add a link
Reference in a new issue