You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
(1) |
Aug
|
Sep
(15) |
Oct
(32) |
Nov
(35) |
Dec
(48) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(46) |
Feb
(22) |
Mar
(65) |
Apr
(49) |
May
(22) |
Jun
(29) |
Jul
(51) |
Aug
(34) |
Sep
(32) |
Oct
(46) |
Nov
(30) |
Dec
(32) |
2002 |
Jan
(48) |
Feb
(4) |
Mar
(20) |
Apr
(28) |
May
(13) |
Jun
(34) |
Jul
(51) |
Aug
(15) |
Sep
(15) |
Oct
(35) |
Nov
(15) |
Dec
(20) |
2003 |
Jan
(31) |
Feb
(111) |
Mar
(41) |
Apr
(28) |
May
(36) |
Jun
(29) |
Jul
(27) |
Aug
(29) |
Sep
(47) |
Oct
(28) |
Nov
(7) |
Dec
(26) |
2004 |
Jan
(44) |
Feb
(9) |
Mar
(17) |
Apr
(26) |
May
(58) |
Jun
(13) |
Jul
(44) |
Aug
(64) |
Sep
(30) |
Oct
(11) |
Nov
(21) |
Dec
(28) |
2005 |
Jan
(29) |
Feb
(11) |
Mar
(11) |
Apr
(22) |
May
(85) |
Jun
(46) |
Jul
(17) |
Aug
(18) |
Sep
(14) |
Oct
(22) |
Nov
(1) |
Dec
(45) |
2006 |
Jan
(20) |
Feb
(36) |
Mar
(18) |
Apr
(24) |
May
(21) |
Jun
(48) |
Jul
(23) |
Aug
(20) |
Sep
(10) |
Oct
(41) |
Nov
(46) |
Dec
(40) |
2007 |
Jan
(40) |
Feb
(20) |
Mar
(13) |
Apr
(6) |
May
(24) |
Jun
(31) |
Jul
(30) |
Aug
(11) |
Sep
(11) |
Oct
(10) |
Nov
(56) |
Dec
(64) |
2008 |
Jan
(64) |
Feb
(22) |
Mar
(63) |
Apr
(28) |
May
(25) |
Jun
(36) |
Jul
(11) |
Aug
(9) |
Sep
(14) |
Oct
(41) |
Nov
(46) |
Dec
(130) |
2009 |
Jan
(95) |
Feb
(41) |
Mar
(24) |
Apr
(35) |
May
(53) |
Jun
(67) |
Jul
(48) |
Aug
(48) |
Sep
(86) |
Oct
(75) |
Nov
(64) |
Dec
(52) |
2010 |
Jan
(57) |
Feb
(31) |
Mar
(28) |
Apr
(40) |
May
(25) |
Jun
(42) |
Jul
(79) |
Aug
(31) |
Sep
(49) |
Oct
(66) |
Nov
(38) |
Dec
(25) |
2011 |
Jan
(29) |
Feb
(18) |
Mar
(44) |
Apr
(6) |
May
(28) |
Jun
(31) |
Jul
(36) |
Aug
(24) |
Sep
(30) |
Oct
(23) |
Nov
(21) |
Dec
(27) |
2012 |
Jan
(14) |
Feb
(11) |
Mar
(2) |
Apr
(48) |
May
(7) |
Jun
(32) |
Jul
(22) |
Aug
(25) |
Sep
(31) |
Oct
(32) |
Nov
(21) |
Dec
(17) |
2013 |
Jan
(44) |
Feb
(27) |
Mar
(3) |
Apr
(1) |
May
|
Jun
|
Jul
(3) |
Aug
(4) |
Sep
(1) |
Oct
(7) |
Nov
(5) |
Dec
(5) |
2014 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
(2) |
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
(7) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Symion <sy...@pr...> - 2008-04-18 07:18:09
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> </head> <body bgcolor="#ffffff" text="#000000"> <font face="Helvetica, Arial, sans-serif">Just uploaded a web page with links to a few astronomy type python programs.<br> <br> <a href="http://home.primusonline.com.au/knoware/python/">http://home.primusonline.com.au/knoware/python/</a><br> <br> I plan to update this site regularly.<br> <br> cheers<br> Symion<br> <br> </font> </body> </html> |
From: Frédéric <fre...@gb...> - 2008-04-17 15:10:19
|
Le 17/4/2008, "Lorenzo Isella" <lor...@gm...> a écrit: >I see. So I think I am back to one of the old suggestions I was given, >namely to use the povray plugin. Now, I think this is quite advanced for me. >I got hold of the script corresponding to: >http://www.gbiloba.org/download/SNP-definitif-640x480.avi >Which also was recommended to me a long time ago. >It is quite advanced and I cannot run it on my machine (again, I >installed pymad but the system [and myself] cannot find some missing >modules). >However, maybe I would need something simpler to start from. >I installed povray for Debian, but now what I would need is really some >simple way to invoke it from Python to save (and then convert) a visual >Python scene. I wrote the script for a student, a few years ago. I admit there are a lot of stuff in it, not directly related to your problem (the annoying thing is to program the different trajectories and camera positions with a good timing to get a smooth movie). In fact, you only need to use povexport() function to export a VPython scene to a pov script, then run povray on it. If you do this for several pictures, then you just display them at 15-20 fps, and you have your movie ;) I will try to extract a little example from the big script... |
From: Lorenzo I. <lor...@gm...> - 2008-04-17 12:53:31
|
I see. So I think I am back to one of the old suggestions I was given, namely to use the povray plugin. Now, I think this is quite advanced for me. I got hold of the script corresponding to: http://www.gbiloba.org/download/SNP-definitif-640x480.avi Which also was recommended to me a long time ago. It is quite advanced and I cannot run it on my machine (again, I installed pymad but the system [and myself] cannot find some missing modules). However, maybe I would need something simpler to start from. I installed povray for Debian, but now what I would need is really some simple way to invoke it from Python to save (and then convert) a visual Python scene. Cheers Lorenzo Erik Thompson wrote: > > Is the module ImageGrab available for Debian (or for linux in > general)? > > > Unfortunately, ImageGrab appears to only work on Windows. In the > source code of ImageGrab.py it has the comments: > > # (New in 1.1.3) The <b>ImageGrab</b> module can be used to copy > # the contents of the screen to a PIL image memory. > # <p> > # The current version works on Windows only.</p> > > > -Erik |
From: William C. W. <ww...@la...> - 2008-04-17 04:19:56
|
Hi Lornezo, Your best bet might be to forgo a Python-based solution and use something like ffmpeg to encode screen activity directly while the window is active. (ffmpeg is an open source command line encoding application that can also do video capture). You should be able to find a number of references, for example: http://ubuntu.wordpress.com/2006/06/08/how-to-create-a-screencast-in-ubuntu/ Good luck! Bill Ward > Dear All, > Quite some time ago I asked some questions abut how to make a movie in > Visual Python. > Among the various answers I got, I was trying this suggestion: > > > On 14/01/2008, Kadir Haldenbilen <kha...@ya...> wrote: > > > > Lorenzo Isella wrote: > > > > > I managed to get some decent animations on my laptop (running Debian > > > testing); now my question is how to get at least a set of png (or any > > > other decent format; pdf, eps, jpg etc...) files with the "snapshots" > > > of my system. > > > > I can answer your question for Windows environment. Same or similar > solution > > MAY or > > MAY NOT apply for Linux, I have no experience in Linux environment. > > > > First you need to install Python Image Library, PIL, if you have not > done so > > already. You may be using it already, if you are using TEXTURE feature > of > > the recent Beta versions of VPython. > > > > Then in your source code you need to add some lines, like the > followings: > > > > import Image > > import ImageGrab > > ... > > > > Your animation code goes here > > > > ... > > > > while looping: > > > > im = > > ImageGrab.grab((24,30,ImageWidth-4,ImageHeight-4)) > > fn = "Cat"+str(pn)+".png" > > im.save(fn) > > > > fn is the filename in Windows environment. > > > > IF THIS SYSTEM WORKS in LINUX, then someting similar to that of > filename > > should be sufficient. > > ImageGrab needs the display location (upper-left corner) and display > > sizedefined to it, so it picks up > > the image from the screen for you. > > > > You need to set up some sort of a counter in the loop like the > str(pn), to > > get a unique > > file name for each snapshot. > > > > Hope it works... > > > > Kadir > > > > > > ________________________________ > > Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try > it > > now. > > > > Now, unfortunately I do not think this works for linux. Consider the > small example given below: > > > #! /usr/bin/env python > > import scipy as s > import numpy as n > import pylab as p > > import visual as v > > > import Image > import ImageGrab > > x_list=s.arange(10) > y_list=s.zeros(10) > y_list[:]=1. > z_list=y_list > > > > box_size=100. > > #v.scene = v.display(title="System Snapshot", width=box_size, > height=box_size, x=0, y=0, > # range=box_size, center=(0.,0.,0.)) > > my_rad=1. > > particles=[v.sphere(pos=loc,radius=my_rad,color=v.color.blue)\ > for loc in zip(x_list,y_list,z_list)] > > > im = ImageGrab.grab((24,30,ImageWidth-4,ImageHeight-4)) > fn = "Cat"+str(pn)+".png" > im.save(fn) > > > If I run it on my machine (Debian testing) then I got the following > error message: > > Traceback (most recent call last): > File "<stdin>", line 11, in ? > File "/usr/lib/python2.4/site-packages/PIL/ImageGrab.py", line 34, in ? > import _grabscreen > ImportError: No module named _grabscreen > > Is the module ImageGrab available for Debian (or for linux in general)? > Or does anyone know of a workaround for this? > Many thanks > > Lorenzo > > > > > > > > > > > > > > > > > > > > > > > > > > > > > http://physics.syr.edu/~salgado/software/vpython/EMWave.py > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |
From: Erik T. <mrl...@gm...> - 2008-04-17 00:56:15
|
> > Is the module ImageGrab available for Debian (or for linux in general)? > Unfortunately, ImageGrab appears to only work on Windows. In the source code of ImageGrab.py it has the comments: # (New in 1.1.3) The <b>ImageGrab</b> module can be used to copy > # the contents of the screen to a PIL image memory. > # <p> > # The current version works on Windows only.</p> -Erik |
From: Lorenzo I. <lor...@gm...> - 2008-04-16 22:52:57
|
Dear All, Quite some time ago I asked some questions abut how to make a movie in Visual Python. Among the various answers I got, I was trying this suggestion: On 14/01/2008, Kadir Haldenbilen <kha...@ya...> wrote: > > Lorenzo Isella wrote: > > > I managed to get some decent animations on my laptop (running Debian > > testing); now my question is how to get at least a set of png (or any > > other decent format; pdf, eps, jpg etc...) files with the "snapshots" > > of my system. > > I can answer your question for Windows environment. Same or similar solution > MAY or > MAY NOT apply for Linux, I have no experience in Linux environment. > > First you need to install Python Image Library, PIL, if you have not done so > already. You may be using it already, if you are using TEXTURE feature of > the recent Beta versions of VPython. > > Then in your source code you need to add some lines, like the followings: > > import Image > import ImageGrab > ... > > Your animation code goes here > > ... > > while looping: > > im = > ImageGrab.grab((24,30,ImageWidth-4,ImageHeight-4)) > fn = "Cat"+str(pn)+".png" > im.save(fn) > > fn is the filename in Windows environment. > > IF THIS SYSTEM WORKS in LINUX, then someting similar to that of filename > should be sufficient. > ImageGrab needs the display location (upper-left corner) and display > sizedefined to it, so it picks up > the image from the screen for you. > > You need to set up some sort of a counter in the loop like the str(pn), to > get a unique > file name for each snapshot. > > Hope it works... > > Kadir > > > ________________________________ > Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it > now. Now, unfortunately I do not think this works for linux. Consider the small example given below: #! /usr/bin/env python import scipy as s import numpy as n import pylab as p import visual as v import Image import ImageGrab x_list=s.arange(10) y_list=s.zeros(10) y_list[:]=1. z_list=y_list box_size=100. #v.scene = v.display(title="System Snapshot", width=box_size, height=box_size, x=0, y=0, # range=box_size, center=(0.,0.,0.)) my_rad=1. particles=[v.sphere(pos=loc,radius=my_rad,color=v.color.blue)\ for loc in zip(x_list,y_list,z_list)] im = ImageGrab.grab((24,30,ImageWidth-4,ImageHeight-4)) fn = "Cat"+str(pn)+".png" im.save(fn) If I run it on my machine (Debian testing) then I got the following error message: Traceback (most recent call last): File "<stdin>", line 11, in ? File "/usr/lib/python2.4/site-packages/PIL/ImageGrab.py", line 34, in ? import _grabscreen ImportError: No module named _grabscreen Is the module ImageGrab available for Debian (or for linux in general)? Or does anyone know of a workaround for this? Many thanks Lorenzo http://physics.syr.edu/~salgado/software/vpython/EMWave.py |
From: Bruce S. <Bru...@nc...> - 2008-04-07 04:04:23
|
Your interest is highly welcome! As announced in a post a month ago or so, David Scherer, Ruth Chabay, and I have been working on strategy to move forward with Visual 4. Scherer is making rapid progress, and I'm assisting, mainly in the role of testing on platforms other than Windows, which is the platform he's working on (but he has also been writing code for the other platforms, blind, and usually his code works). We place very high priority on a native Mac version. A number of approaches have been tried, none of which has really panned out yet. It does look like Carbon is our only hope, and we've just begun looking at this (the latest experiment is with the interesting pyglet package). Steve Spicklemire is also starting to look at this, but he says that all his Mac experience has been with Cocoa, not Carbon. As near as we can tell, Cocoa isn't an option because its event loop is required to be the primary thread, which is fine for building applications but not for building a module that can be imported at any time from a Python program. If you have significant Carbon experience WE WANT YOU on the team! Of extremely high interest to us at this instant is a proof of concept of the feasibility of a Carbon-based approach. As Scherer commented just today, "I think we need a simple Carbon example that does everything in a secondary thread ASAP, to confirm that it is possible!" I did succeed in making a GTK2 version of Visual 4 for Windows, but we have abandoned that approach because of the unacceptably huge complexity of setting up the development environment (see the notes posted in the Developer's section of vpython.org). We've gone back to having a separate module that is Windows-specific for creating windows and handling events, and of course we also want to do this for the Mac. The reason I built a GTK2 version of Visual 4 for Windows was that it appeared to me that the (non-GTK2) Windows version was significantly more buggy than the Linux/Unix version. As I got into this however, starting in November, and nibbled away at the identifiable bugs, which turned out not to be for the most part platform-specific, it became less and less likely that there was anything seriously wrong with the Windows-specific code. So, given the enormous complexity of the GTK2 environment, we abandoned that approach. What is currently in CVS at sourceforge is rapidly changing but is normally in working order at all times. Bruce Sherwood Hugh Fisher wrote: > A month ago I started doing some work on the 3.2.9 vpython source, > intending to first clean up various GTK glitches and make it > build with GTK2, and then do a native MacOS X (Carbon) platform > implementation. My reasons for doing this were that the next gen > VPython seemed to be taking a long time to get out of beta and > didn't include native MacOS support. > > I gather than next gen VPython development may be changing > direction. Anyone got a clear picture of what will be happening? > |
From: Hugh F. <hug...@an...> - 2008-04-07 03:03:49
|
A month ago I started doing some work on the 3.2.9 vpython source, intending to first clean up various GTK glitches and make it build with GTK2, and then do a native MacOS X (Carbon) platform implementation. My reasons for doing this were that the next gen VPython seemed to be taking a long time to get out of beta and didn't include native MacOS support. I gather than next gen VPython development may be changing direction. Anyone got a clear picture of what will be happening? -- Hugh Fisher DCS, ANU |
From: Joe H. <hea...@gm...> - 2008-04-06 23:40:45
|
Thank you Bruce and Jon! Joe On Sun, Apr 6, 2008 at 7:00 PM, Bruce Sherwood <Bru...@nc...> wrote: > def add(a,b): > return a+b > > def mult(a,b): > return a*b > > def process(function, a, b): > return function(a,b) > > print process(mult, 5, 3) # prints 15 > > Joe Heafner wrote: > > Can a function be passed as a parameter to another function in Python? I > > can't find any clear examples. > > > > Joe > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Register now and save $200. Hurry, offer ends at 11:59 p.m., > Monday, April 7! Use priority code J8TLD2. > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |
From: Bruce S. <Bru...@nc...> - 2008-04-06 23:14:38
|
As far as I know there's no way to do this, but Visual is open source, so you could in principle rework its architecture to do what you want. I don't know anything about PySoy. Bruce Sherwood Stef Mientki wrote: > hello, > > I want to integrate VPython (VisualPython ?) into a wxPython application. > Now both programs have a main loop, > and I read somewhere that it's very complicated to integrate VPython. > > Is it possible to integrate VPython in a wxPython application ? > And if so, is there any information how to do that ? > Or would PySoy be a better choice to integrate with VPython ? > > thanks, > Stef Mientki > |
From: Stef M. <s.m...@ru...> - 2008-04-06 23:07:38
|
hello, I want to integrate VPython (VisualPython ?) into a wxPython application. Now both programs have a main loop, and I read somewhere that it's very complicated to integrate VPython. Is it possible to integrate VPython in a wxPython application ? And if so, is there any information how to do that ? Or would PySoy be a better choice to integrate with VPython ? thanks, Stef Mientki |
From: Bruce S. <Bru...@nc...> - 2008-04-06 23:00:25
|
def add(a,b): return a+b def mult(a,b): return a*b def process(function, a, b): return function(a,b) print process(mult, 5, 3) # prints 15 Joe Heafner wrote: > Can a function be passed as a parameter to another function in Python? I > can't find any clear examples. > > Joe |
From: Jon S. <js...@gm...> - 2008-04-06 22:45:26
|
Hi, With python its often easier to just test than to find documentation. Regards, def regularCase(arg): return arg def upCase(arg): return arg.upper() def do(func, arg): return(func(arg)) print do(regularCase, 'hello') print do(upCase, 'hello') ..... hello HELLO On 4/6/08 5:16 PM, "Joe Heafner" <hea...@gm...> wrote: > Can a function be passed as a parameter to another function in Python? I can't > find any clear examples. > > Joe > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Register now and save $200. Hurry, offer ends at 11:59 p.m., > Monday, April 7! Use priority code J8TLD2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users Jon Schull ji...@it... cell: 585-738-6696 Associate Professor Rochester Institute of Technology |
From: Joe H. <hea...@gm...> - 2008-04-06 21:16:30
|
Can a function be passed as a parameter to another function in Python? I can't find any clear examples. Joe |
From: chris l. <chr...@sp...> - 2008-04-04 06:56:30
|
Sorry for putting it in as plain text, here it is as an attachment. Chris |
From: chris l. <chr...@sp...> - 2008-04-03 20:15:36
|
I've put the following together, and would appreciate some criticisms of it as to push it on much further without a fairly major clean up seems a problem , but it does at least allow the construction of some basic objects using visual python. Chris p.s. Hopefully it's etter than another Flanders and Swann pastiche... """ A lousy visual python object builder, in need of a little love. Select an object from the drop down add menu and once selected choose the object n the object list, then adjust the parameters to 'sculpt' your object' Things to do. Sort out slider bar problems Add an ability to store the final visual object... Pickle? """ from visual.controls import * import random w = 400 d = display(x=w, y=0, width = w,height = w, range = 1.5) c = controls(x = 0, y = 0, width = w , height = w, range= 60) bl = button(pos=(-60,-50), height=20, width=20, text='Quit', action=lambda: donowt()) objlist = [] objmenu = None parametermenu = None parameterlist = [] currentobj = None currentparam = None def donowt(): import sys sys.exit() class ParaSlider(object): vector_variables = ['axis','color','pos','size'] s1 = None s2 = None s3 = None def __init__(self, obj, menu, menuitem): self.menuitem = menuitem[0] if self.menuitem in ParaSlider.vector_variables: self = ParaSliders(obj, menu, menuitem[0]) return self.obj = obj self.value = 50 * getattr(obj, self.menuitem) self.menu = menu print 'Menuitem',self.menuitem ParaSlider.s1 = slider(pos=(-20,-30), width=7, length=70, axis=(1,0,0), action=lambda: self.menu_command()) ParaSlider.s1.value = self.value def menu_command(self): print 'ParaSlider setting to value:', self.s1.value print 'Setting: %s of %s to %s' % (self.menuitem, self.obj, self.s1.value) setattr(self.obj, self.menuitem, self.s1.value/ 50) class ParaSliders(ParaSlider): s2 = None s3 = None def __init__(self, obj, menu, menuitem): self.menuitem = menuitem self.obj = obj self.menu = menu self.value = 50 * getattr(obj, self.menuitem) ParaSlider.s1 = slider(pos=(-20,-30), width=7, length=70, axis=(1,0,0), action=lambda: self.menu_command()) ParaSliders.s2 = slider(pos=(-20,-40), width=7, length=70, axis=(1,0,0), action=lambda: self.menu_command()) ParaSliders.s3 = slider(pos=(-20,-50), width=7, length=70, axis=(1,0,0), action=lambda: self.menu_command()) print 'Self.value',self.value print 'Self.value[0]',self.value[0] print 'Self.value[1]',self.value[1] print 'Self.value[2]',self.value[2] ParaSlider.s1.value = self.value[0] ParaSliders.s2.value = self.value[1] ParaSliders.s3.value = self.value[2] def menu_command(self): print 'ParaSliders setting to value:', self.s1.value print 'Self.s1.value',self.s1.value print 'Self.s2.value',self.s2.value print 'Self.s3.value',self.s3.value print 'Setting: %s of %s to %s' % (self.menuitem, self.obj, self.s1.value) print 'Setting: %s of %s to %s' % (self.menuitem, self.obj, self.s2.value) print 'Setting: %s of %s to %s' % (self.menuitem, self.obj, self.s3.value) val = (self.s1.value/50,self.s2.value/50, self.s3.value/50) setattr(self.obj, self.menuitem, val) class AddMenu(object): menulist =[ ['A cylinder', cylinder], ['An Arrow',arrow], ['A Cone',cone], ['A pyramid', pyramid], ['A sphere', sphere], ['A Ring', ring], ['A Box',box], ['An Ellisoid',ellipsoid], ['An Helix', helix], ] menu = None def __init__(self, title = 'Add',color = color.green): self.title = title self.color = color m = menu (pos=(-60,60,0), height=7, width=35, text=self.title, color = self.color) m.items.extend(self.menufunc()) AddMenu.menu = m def menu_command(self): global objmenu if not objlist: objmenu = ObjectMenu() objlist.append(AddMenu.menulist[self.menu.nitem-1][1]()) ObjectMenu.menu.items.append((AddMenu.menulist[self.menu.nitem-1][0],lambda:objmenu.menu_command())) def __repr__(self): return self.title def __getitem__(self, value): return AddMenu.menulist[value] def getmenu(self): return AddMenu.menulist def menufunc(self): m = [] for item in self.getmenu(): m.append((item[0],lambda: self.menu_command())) return m class ObjectMenu(object): menulist =[] menu = None def __init__(self, title = 'Objects', color = color.red): self.title = title self.color = color m = menu (pos=(-25,60,0), height=7, width=35, text=self.title, color = self.color) ObjectMenu.menu = m def menu_command(self): global currentobj objlist[self.menu.nitem - 1].color = color.red if currentobj: currentobj.color = color.blue currentobj = objlist[self.menu.nitem - 1] global parametermenu parametermenu = ParameterMenu(currentobj) def setparameter(obj,slider,parameter): print obj,slider.value setattr(obj,parameter, slider.value/10) class ParameterMenu(object): menulist = [] paralist = ['alpha','axis','color','opacity','height','length','pos','radius', 'fixedwidth','shaftwidth','headwidth','up','size','thickness','width','coils'] menu = None def __init__(self,obj, title = 'Parameters', color = color.blue): self.obj = obj self.title = title self.color = color m = ParameterMenu.menu if m: del m.items[0:len(m.items)] else: m = menu (pos=(30,60,0), height=7, width=35, text=self.title, color = self.color) ParameterMenu.menu = m self.menulist = self.menufunc() m.items.extend(self.menulist) def menu_command(self): #print 'Menulist:',self.menulist s1 = ParaSlider(self.obj, self.menu, menuitem = self.menulist[self.menu.nitem - 1]) #s2 = slider(pos=(-20,-40), width=7, length=70, axis=(1,0,0), action=lambda: setparameter(self.obj,s2,'y')) #s3 = slider(pos=(-20,-50), width=7, length=70, axis=(1,0,0), action=lambda: setparameter(self.obj,s3,'z')) def __repr__(self): return '%s :>%s' %(self.title, str(self.obj)) def __getitem__(self, value): return ParameterMenu.menulist[value] def getmenu(self): return ParameterMenu.menulist def menufunc(self): m = [] for item in dir(self.obj): if item in ParameterMenu.paralist : m.append(('%s' %(item), lambda: self.menu_command())) return m if __name__ == '__main__': am = AddMenu() while 1: c.interact() |
From: Gary P. <gar...@gm...> - 2008-04-01 20:33:03
|
A student of mine had trouble installing the standard released version on WinXP. The installer insisted on installing in c:\Program Files\Messenger\New Folder There was no option to change the destination location. I don't know if the issue is with her laptop, or with the installer, so I mention it here. I had to drag the files into the c:\python25 tree, after which everything seemed to work ok. -gary |
From: Bruce S. <Bru...@nc...> - 2008-03-31 02:38:42
|
The current (double) issue of the American Journal of Physics, published by the American Association of Physics Teachers, is devoted to computation in the college physics curriculum, reflecting the growing importance of computation as co-equal with theory in experiment. VPython is represented significantly in two articles, one by Ruth Chabay and me on computation in the introductory (freshman) physics course taken by engineering and science students, and one by Andy Buller, Roger Fearick, and colleagues at the University of Capetown, on an interesting computational project in the introductory course for physics majors in which students model the motion of a disk-shaped spacecraft with a thruster at the rim that pushes tangentially. The journal issue is connected to an upcoming summer Gordon Research Conference on computation in the physics curriculum, for which the following URL is the announcement: http://www.grc.org/programs.aspx?year=2008&program=physres Bruce Sherwood |
From: Bruce S. <Bru...@nc...> - 2008-03-31 02:07:20
|
Very impressive and sophisticated, especially for a first try! I'll mention that the Rubiks cube program does run on the highly experimental as-yet-unreleased-under-rapid-development new version, at least on Vista. In MagDisc, I believe the force calculation is incorrect, and the rotational motion update is incorrect. The force that one magnet exerts on another is quite complicated. You can get the right answer by pretending that a magnet is an electric dipole (with small separation between the + and - charges) instead of a magnetic dipole, to reduce the problem to a simpler case, and then calculate the electric forces among all the individual point charges. What you have in MagDisc seems to be a calculation of a 1/r^2 field made by one magnet, multiplying by a constant representing the other magnet to get the force. But the field of a magnet isn't a simple 1/r^2 field, and the force it exerts on another magnet isn't simply a constant times that field. Also, you seem to increment the angle of a disc proportional to the torque acting on the disc. But you have to increment the angular momentum of the disc (moment of inertia times angular speed) proportional to the net torque (magnetic and frictional), then use the new angular speed to increment the angle. Bruce Sherwood Doug Mair wrote: > Hi all, > > I created a blog entry about my experiences learning python and visual > at: http://dougmair.blogspot.com/ > > Please check it out and make suggestions. > > I created two programs (source files are also on the blog). > > The Rubik cube program works well, but is not written in a very python > like way. > I spend most of my time programming in C#, so it's hard for me to think > in the python way. > I would appreciate any code review telling me how it could be done > better in python. > > The MagDisc.py program is a simulation of magnetic forces between > freespinning discs with magnets fixed on them. > I'm trying to create a virtual free energy simulator. It's cheaper than > building it in the real world. > This program works pretty well, but I'm having trouble with the equation > that converts the magnetic forces into the angular momentum of the discs. > Any physics advice would be appreciated. > > Also, I tried the Rubiks cube with the version 4 beta on Windows Vista > and it had lots of problems. > > Thanks for any help, > Doug Mair |
From: Gary P. <gar...@gm...> - 2008-03-30 21:04:52
|
On Sun, Mar 30, 2008 at 4:42 PM, <bre...@un...> wrote: > > scipy.linspace does the same job as arange, but behaves correctly in all > circumstances Brief detail: scipy.linspace points to the same function as numpy.linspace, and numpy has less overhead than scipy. Also, the syntax of linspace is not the same as the syntax of arange. (While I'm at it, for those familiar with matplotlib, pylab.linspace behaves differently than numpy.linspace, unfortunately.) > > > > > > "Gary Pajer" <gar...@gm...> > Sent by: vis...@li... > > 31/03/2008 06:40 AM > > To > "Joe Heafner" <hea...@gm...> > > cc VPython List <vis...@li...> > > Subject Re: [Visualpython-users] can't understand arange() behavior > > > > > > > In [1]: 3 * 0.1 > Out[1]: 0.30000000000000004 > > I.e., 3 * 0.1 > 0.3 > > The floating point gotcha, yet again. > > -g > > On Sat, Mar 29, 2008 at 11:13 PM, Joe Heafner <hea...@gm...> wrote: > > When I type arange(1, 3, 1) I get [1, 2] as expected. When I type > > arange(0.1, 0.3, 0.1) I get [0.1, 0.2] as expected. But when I type > > arange(0.1, 3*0.1, 0.1) I get [0.1, 0.2, 0.3], which is not what would > > expect. I can't find this behavior documented anywhere. What's going on? > > > > Joe > > ------------------------------------------------------------------------- > > Check out the new SourceForge.net Marketplace. > > It's the best place to buy or sell services for > > just about anything Open Source. > > > > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > _______________________________________________ > > Visualpython-users mailing list > > Vis...@li... > > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > > > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > ______________________________________________________________________ > This email has been scanned by the MessageLabs Email Security System. > For more information please visit http://www.messagelabs.com/email > ______________________________________________________________________ > > > UNITED GROUP > This email message is the property of United Group. The information in this > email is confidential and may be legally privileged. It is intended solely > for the addressee. Access to this email by anyone else is unauthorised. If > you are not the intended recipient, you may not disclose, copy or distribute > this email, nor take or omit to take any action in reliance on it. United > Group accepts no liability for any damage caused by this email or any > attachments due to viruses, interference, interception, corruption or > unauthorised access. > If you have received this email in error, please notify United Group > immediately by email to the sender's email address and delete this document. > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > |
From: Gary P. <gar...@gm...> - 2008-03-30 20:50:38
|
On Sun, Mar 30, 2008 at 11:18 AM, Bruce Sherwood <Bru...@nc...> wrote: > It's nothing more than the fact that floating-point numbers can be > represented only approximately in a computer. A simple example from > ordinary pencil-and-paper calculations is that 1/3 + 1/3 + 1/3 = 1, but > 0.33+0.33+0.33 = .99. If you want arange to produce 0, "1/3", "2/3", but > not "1", you should write something like arange(0.0, 1.0-.1, 1.0/3.0). > More generally, if you want to go from xi to xf in floating-point > increments dx, and not include xf, write arange(xi, xf-0.5*dx, dx). > Another solution is something like this, using integers: > > while n in range(ni, nf, dn): > x = scale*n # where scale is a floating-point scale factor > .... > > Bruce Sherwood another common solution is to use numpy's linspace function: In [6]: import numpy In [7]: numpy.linspace(0, 0.3, 4) Out[7]: array([ 0. , 0.1, 0.2, 0.3]) In [9]: numpy.linspace? Type: function Base Class: <type 'function'> String Form: <function linspace at 0x0118C9B0> Namespace: Interactive File: c:\python25\lib\site-packages\numpy-1.0.4.dev3954-py2.5-win32.egg\numpy\lib\function_base.py Definition: numpy.linspace(start, stop, num=50, endpoint=True, retstep=False) Docstring: Return evenly spaced numbers. Return num evenly spaced samples from start to stop. If endpoint is True, the last sample is stop. If retstep is True then return the step value used. > > > Frédéric Mantegazza wrote: > > On dimanche 30 mars 2008, Joe Heafner wrote: > > > >> Okay this is driving me crazy. Typing arange(0.1,0.4,0.1) should give > >> [0.1, 0.2, 0.3] but instead it gives [0.1, 0.2, 0.3, 0.4]. Typing > >> arange(0.1,0.5, 0.1) should give [0.1, 0.2, 0.3, 0.4] and it indeed > >> does. Another example that doesn't give the "correct" result is > >> arange(0.2,0.8,0.2), which gives [ 0.2, 0.4, 0.6, 0.8]. Is this a bug in > >> the arange() code? I've tinkered with this for two days and there seems > >> to be no way to predict when arange() will behave as documented. I have > >> my students working on a small assignment that uses arange() and I don't > >> want this to affect their work. Is there some detail I'm overlooking? > > > > arange([start,] stop[, step,], dtype=None) > > > > For integer arguments, just like range() except it returns an array > > whose type can be specified by the keyword argument dtype. If dtype > > is not specified, the type of the result is deduced from the type of > > the arguments. > > > > For floating point arguments, the length of the result is ceil((stop - > > start)/step). This rule may result in the last element of the result > > being greater than stop. > > > > I'm afraid you will have to check the result, and correct it. But I agree, > > this is a strange behaviour! > > > > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |
From: <bre...@un...> - 2008-03-30 20:49:03
|
scipy.linspace does the same job as arange, but behaves correctly in all circumstances "Gary Pajer" <gar...@gm...> Sent by: vis...@li... 31/03/2008 06:40 AM To "Joe Heafner" <hea...@gm...> cc VPython List <vis...@li...> Subject Re: [Visualpython-users] can't understand arange() behavior In [1]: 3 * 0.1 Out[1]: 0.30000000000000004 I.e., 3 * 0.1 > 0.3 The floating point gotcha, yet again. -g On Sat, Mar 29, 2008 at 11:13 PM, Joe Heafner <hea...@gm...> wrote: > When I type arange(1, 3, 1) I get [1, 2] as expected. When I type > arange(0.1, 0.3, 0.1) I get [0.1, 0.2] as expected. But when I type > arange(0.1, 3*0.1, 0.1) I get [0.1, 0.2, 0.3], which is not what would > expect. I can't find this behavior documented anywhere. What's going on? > > Joe > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Visualpython-users mailing list Vis...@li... https://lists.sourceforge.net/lists/listinfo/visualpython-users ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ UNITED GROUP This email message is the property of United Group. The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. If you are not the intended recipient, you may not disclose, copy or distribute this email, nor take or omit to take any action in reliance on it. United Group accepts no liability for any damage caused by this email or any attachments due to viruses, interference, interception, corruption or unauthorised access. If you have received this email in error, please notify United Group immediately by email to the sender's email address and delete this document. |
From: Gary P. <gar...@gm...> - 2008-03-30 20:40:24
|
In [1]: 3 * 0.1 Out[1]: 0.30000000000000004 I.e., 3 * 0.1 > 0.3 The floating point gotcha, yet again. -g On Sat, Mar 29, 2008 at 11:13 PM, Joe Heafner <hea...@gm...> wrote: > When I type arange(1, 3, 1) I get [1, 2] as expected. When I type > arange(0.1, 0.3, 0.1) I get [0.1, 0.2] as expected. But when I type > arange(0.1, 3*0.1, 0.1) I get [0.1, 0.2, 0.3], which is not what would > expect. I can't find this behavior documented anywhere. What's going on? > > Joe > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > |
From: Bruce S. <Bru...@nc...> - 2008-03-30 20:06:44
|
Thanks for the report, including the screen image of the error. But all it says is that OpenGL was handed some stuff for displaying a sphere that it didn't understand, and I'm at a loss to figure out what's wrong. I've run 4.beta26 on many different XP and Vista machines and not seen the failures you and Symion see. There's not much point in trying to debug this further, since there is a lot of work being done on the fundamental architecture of Visual 4. If you're able to run Visual 4, it will give you some sense of coming attractions, but be aware that some things in the new parts of Visual will change. If you're unable to run Visual 4, unless you can give me much more detailed information than is likely to be available to you, I guess you'll just have to wait for the new Visual 4. Bruce Sherwood Erik Thompson wrote: > I have been getting the same behavior on an Windows XP virtual machine > (Parallels) although I haven't seen any error output mentioning Numpy. > The old stable version of VPython works fine but all of the Beta > versions I've tried have crashed (the oldest one I tried was Beta 14). > Attached is a screenshot of the terminal error message after I tried > to display a sphere() using the latest Beta #26. > > -Erik Thompson > > On Fri, Mar 28, 2008 at 4:49 PM, Bruce Sherwood <Bru...@nc...> wrote: >> This behavior is not familiar to me. You don't say what platform you're >> running on. It could be informative to run an example program from a >> typescript/terminal, as you may get additional error messages that way. >> >> Bruce Sherwood >> >> >> >> Symion wrote: >> > I've just installed python 2.5.2, no worries. >> > I then installed Vpython 4.beta.26, no worries. >> > >> > >From IDLE I run stonehenge.py (standard test program). >> > After a fairly long wait, the scene window pops up and vanishes and the >> > program ends without a trace and puts me back into IDLE. >> > >> > Same problem for all vpython scripts. >> > Tried running standard python programs, no worries! >> > >> > Switched on DEBUG. >> > >> > Before it dumped me back into Desktop, I saw something about Numpy? and >> > a Windows Error. >> > >> > Can anyone help? >> > >> > Cheers Symion >> >> ------------------------------------------------------------------------- >> Check out the new SourceForge.net Marketplace. >> It's the best place to buy or sell services for >> just about anything Open Source. >> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace >> _______________________________________________ >> Visualpython-users mailing list >> Vis...@li... >> https://lists.sourceforge.net/lists/listinfo/visualpython-users >> >> >> ------------------------------------------------------------------------ >> |
From: Doug M. <dou...@gm...> - 2008-03-30 15:32:03
|
Hi all, I created a blog entry about my experiences learning python and visual at: http://dougmair.blogspot.com/ Please check it out and make suggestions. I created two programs (source files are also on the blog). The Rubik cube program works well, but is not written in a very python like way. I spend most of my time programming in C#, so it's hard for me to think in the python way. I would appreciate any code review telling me how it could be done better in python. The MagDisc.py program is a simulation of magnetic forces between freespinning discs with magnets fixed on them. I'm trying to create a virtual free energy simulator. It's cheaper than building it in the real world. This program works pretty well, but I'm having trouble with the equation that converts the magnetic forces into the angular momentum of the discs. Any physics advice would be appreciated. Also, I tried the Rubiks cube with the version 4 beta on Windows Vista and it had lots of problems. Thanks for any help, Doug Mair |