Questions tagged [vpython]

A free, open-source module for producing real-time 3D scenes with Python.

VPython makes it unusually easy to write programs that generate navigable real-time 3D animations. It is based on the Python programming language.

See http://vpython.org/

345 questions
22
votes
4 answers

Recursion in Python? RuntimeError: maximum recursion depth exceeded while calling a Python object

I have another problem with my code. I'm writing my first program in Vpython and I have to make a simulation of mixing two gases. First, I had a problem with borders, but now when the balls(that represents the gas particles) stay within the borders…
Emil Smęt
  • 819
  • 3
  • 13
  • 28
10
votes
3 answers

ImportError: No module named visual

I am trying to run this Python Program on Ubuntu but I am getting an error that says ImportError: No module named visual Can you guys please guide me on how can I resolve this issue?
Irfan Ghaffar7
  • 1,143
  • 4
  • 11
  • 30
6
votes
2 answers

Visual Python working very slowly

I want to use visual for my project. I've used it many times before and everything was just fine, but I recently changed jobs so am using it on a machine that I've never worked on before The problem is somewhat peculiar: when I run one of the…
Aleksander Lidtke
  • 2,876
  • 4
  • 29
  • 41
6
votes
3 answers

how to wait and print on the same line python

ok, so I am doing this tiny countdown function in vpython, the way I am doing it now is import time print "5" time.sleep(1) print "4" time.sleep(1) print "3" time.sleep(1) print "2" time.sleep(1) print "1" time.sleep(1) print "0" time.sleep(1) print…
user2744763
5
votes
1 answer

"Property 'pos' must be a vector" Error when I run VPython Code

When I run this code I get an error "Error: Property 'pos' must be a vector." Do I have to write another vector somewhere? Because I wrote vector at grav_force = vector(0,-object.mass*grav_field,0) This is my whole code GlowScript 2.7…
Colin Ragnarök
  • 1,062
  • 9
  • 18
4
votes
1 answer

VPython 7 - No module visual is found

I'm working through some Python examples in a book. Many of the codes listed calls for a module visual. I believe visual was installed in older versions of Vpython. I am running Python 3.6 with Vpython 7 installed. I use a Mac computer. Many of the…
Natsfan
  • 4,093
  • 3
  • 22
  • 29
4
votes
3 answers

Error "AttributeError: 'NoneType' object has no attribute 'kernel' when using simply vpython

I'm just starting to try and use vpython, hoping to eventually use it to simulate an elliptical or parabolic orbit. I downloaded the module and tried to generate a simple sphere, and when I do so I get the above error. As far as I can tell, I have…
Tim Smith
  • 65
  • 1
  • 5
4
votes
1 answer

Issues with importing vpython for anaconda

I try to import vpython into anaconda. It seems to work so far, but if I call from visual import * it gives me an error. However, it does work when I type from vpython import * ,which is really weird since in all programs I only see the from visual…
Benutzername
  • 51
  • 1
  • 2
4
votes
3 answers

Using VPython in PyCharm

My Physics class requires me to use VPython for making models and such. I love the idea of incorporating code into Physics and VPython seems to be pretty good overall, but VPython really wants you to use VIDLE, their version of IDLE, as your IDE. I…
Mitcham Tuell
  • 43
  • 1
  • 4
4
votes
1 answer

VPython graphs - Clearing the display so a new set of data can be shown

I have a list of data that I want to be animated on the plot, I'm currently using: graph1=gdots(pos = pvalues) #pvalues is list of points while t <= t_max: rate(200) ... #pvalues is updated to new contain the new points …
4
votes
1 answer

Guitar string code in Python?

I'm very new at Python but really interested in making a code that could simulate guitar strings. How would I go about doing this? Or at least how would I begin to do this? Any help is appreciated! Thank you! EDIT: I would like to see the sound…
3
votes
1 answer

Trying to make two masses orbit each other...getting weird error

Basically, I've created the masses, gave them some velocity and momentum, and I'm trying to make them orbit each other (around their center of mass) using the force from gravity. from visual import * earth = sphere(radius = 100000000) newPlanet =…
Bob John
  • 3,688
  • 14
  • 43
  • 57
3
votes
1 answer

Will 32bit and 64bit Python collide?

Possible Duplicate: Can I install Python 2.7.1 64bit along side of an exsiting 32bit install on OS X? I have a MacBook Pro running 10.7.3 Lion with Python 2.7 64bit installed by default. I need a program called VPython for a physics class I am in…
vt-cwalker
  • 795
  • 2
  • 16
  • 34
3
votes
1 answer

import vpython produces error: float division by zero

I work with Python 3.10.0. I installed vpython using pip, it was installed successfully. Then when I just use: from vpython import * print('hello') hello is printed, and after that I get the following Error: exit Exception ignored in atexit…
3
votes
1 answer

how to fix the position of canvas and graph in vpython?

Before I say it, Sorry for my poor English. I'm making an orbit simulation with vpython, because the earth science teacher asked me to. The link below is the result of my work so…
sungho
  • 89
  • 5
1
2 3
22 23