![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Professional Programmer
|
Very nice DaWei
|
|
|
|
|
|
#12 |
|
Professional Programmer
|
For some reason I can't type in "40" in the Gear Size box. It turns to 4.0 every time. I have to move over and delete the decimal manually to get 40. Ditto for the other boxes, with other numbers.
|
|
|
|
|
|
#13 |
|
Guest
Posts: n/a
|
I just compiled it... It's awesome. I didn't know you could do api so easily in phython! I might just take up this language. You can do straight windows programming in it, right?? BTW, does phython hav I.D.E.s?
|
|
|
|
#14 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
And what do you define as "straight windows programming"??
Boa Constructor, which I used, is an IDE. You won't be able to use it to modify the widgets/window of my code, because I hand edited the controls class.@ Andro: I should have used more time for the text boxes, modularized and regularized their use and interaction with the sliders, but I didn't. I pick up on the event for each change and enforce limits on the fly, instead of throwing out the last character and just boomping at the user. My initial thought was to allow more granularity through the boxes than one gets from the slider. I just didn't take time to really follow through. I don't even bother to keep the cursor in a reasonable place. I also didn't take time to allow for a greater number of samples per revolution. Larger patterns will approach a sparseness that results in a very dim output. Incidentally, the gear and marker size numbers represent a percentage of the track gear radius. The zoom percentage relates the track gear radius to the panel width and is applied to all components simultaneously, upon adjustment and prior to the spin. The other dirty thing is the blocking nature of the plot. I should have used a timer and messages. Oh well. No guarantees, it might smoke your system. Although there isn't an antifreeze variable, if your dog eats it, he may die.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers Last edited by DaWei; Jul 7th, 2006 at 3:27 PM. |
|
|
|
|
|
#15 |
|
Hobbyist Programmer
Join Date: Jan 2006
Location: Menidi, Athens, Greece
Posts: 243
Rep Power: 3
![]() |
Very nice, DaWei. Perhaps I will try and do that in Cocoa someday...!
__________________
Project::Soulstorm (personal homepage) |
|
|
|
|
|
#16 |
|
Hobbyist Programmer
Join Date: Apr 2006
Posts: 136
Rep Power: 0
![]() |
Great job, DaWei!
|
|
|
|
|
|
#17 |
|
The Oblivious One
Join Date: May 2005
Location: Ontario, Canada
Posts: 644
Rep Power: 4
![]() |
$ python SpiroApp.py
Traceback (most recent call last):
File "/home/jesse/downloads/Spiro.zip_FILES/Spiro.py", line 490, in OnScaleBoxText
self.setScale (True)
File "/home/jesse/downloads/Spiro.zip_FILES/Spiro.py", line 359, in setScale
self.rescale ()
File "/home/jesse/downloads/Spiro.zip_FILES/Spiro.py", line 310, in rescale
self.marker.draw (dc, 0, self.insideBox.IsChecked (), True)
File "/home/jesse/downloads/Spiro.zip_FILES/Spiro.py", line 70, in draw
mQ = mR/self.gear.radius
ZeroDivisionError: float division
Traceback (most recent call last):
File "/home/jesse/downloads/Spiro.zip_FILES/Spiro.py", line 466, in OnSizeBoxText
self.setCircleSize (True)
File "/home/jesse/downloads/Spiro.zip_FILES/Spiro.py", line 394, in setCircleSize
self.rescale ()
File "/home/jesse/downloads/Spiro.zip_FILES/Spiro.py", line 310, in rescale
self.marker.draw (dc, 0, self.insideBox.IsChecked (), True)
File "/home/jesse/downloads/Spiro.zip_FILES/Spiro.py", line 70, in draw
mQ = mR/self.gear.radius
ZeroDivisionError: integer division or modulo by zero
Traceback (most recent call last):
File "/home/jesse/downloads/Spiro.zip_FILES/Spiro.py", line 474, in OnMarkerBoxText
self.setMarkerSize (True)
File "/home/jesse/downloads/Spiro.zip_FILES/Spiro.py", line 331, in setMarkerSize
self.rescale ()
File "/home/jesse/downloads/Spiro.zip_FILES/Spiro.py", line 310, in rescale
self.marker.draw (dc, 0, self.insideBox.IsChecked (), True)
File "/home/jesse/downloads/Spiro.zip_FILES/Spiro.py", line 70, in draw
mQ = mR/self.gear.radius
ZeroDivisionError: integer division or modulo by zero
Traceback (most recent call last):
File "/home/jesse/downloads/Spiro.zip_FILES/Spiro.py", line 482, in OnRotBoxText
self.setRotations (True)
File "/home/jesse/downloads/Spiro.zip_FILES/Spiro.py", line 364, in setRotations
self.rescale ()
File "/home/jesse/downloads/Spiro.zip_FILES/Spiro.py", line 310, in rescale
self.marker.draw (dc, 0, self.insideBox.IsChecked (), True)
File "/home/jesse/downloads/Spiro.zip_FILES/Spiro.py", line 70, in draw
mQ = mR/self.gear.radius
ZeroDivisionError: integer division or modulo by zero
Traceback (most recent call last):
File "SpiroApp.py", line 20, in ?
main()
File "SpiroApp.py", line 16, in main
application = BoaApp(0)
File "/usr/lib/python2.4/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", line 7473, in __init__
self._BootstrapApp()
File "/usr/lib/python2.4/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", line 7125, in _BootstrapApp
return _core_.PyApp__BootstrapApp(*args, **kwargs)
File "SpiroApp.py", line 11, in OnInit
self.main.OnInit ()
File "/home/jesse/downloads/Spiro.zip_FILES/Spiro.py", line 263, in OnInit
self.marker.draw (dc, 0, self.insideBox.IsChecked (), True)
File "/home/jesse/downloads/Spiro.zip_FILES/Spiro.py", line 70, in draw
mQ = mR/self.gear.radius
ZeroDivisionError: integer division or modulo by zero
__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS! |
|
|
|
|
|
#18 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Patient: "Doc, my penis hurts when I catch it in my zipper. What do you recommend?"
Doctor: "Don't DO that." Just kidding. See my comments to Andro regarding input limitations and problems. Inasmuch as this was a spontaneous response to the lack of takers (people who ASKED for something to do), and not a commercial proposition, I don't plan to fix it. I maintain that it's cute while standing by my warning that it may kill your dog.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#19 |
|
Newbie
Join Date: Apr 2006
Location: Sweden
Posts: 13
Rep Power: 0
![]() |
I got
"ImportError: No module with the name wx found" or something. |
|
|
|
|
|
#20 | |
|
The Oblivious One
Join Date: May 2005
Location: Ontario, Canada
Posts: 644
Rep Power: 4
![]() |
Quote:
just run: sudo aptitute update sudo aptitude install python-wx
__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS! |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|