vpython

Guitar string code in Python? [closed]

旧巷老猫 提交于 2019-12-14 04:13:37
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 6 years ago . 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 waves when playing different strings

Menu in Glowscript and VPython

时光总嘲笑我的痴心妄想 提交于 2019-12-11 15:36:56
问题 For a school project a friend of mine and I are currently trying to program a simulation of our solar system. The platform we use is Glowscript and we're working with VPython. We have programmed our whole solar system already with all its planets, the sun and the forces between them. Now we're trying to add some extras and one of them is a menu in which the user can select a planet. In our code the selected object (a planet or the sun which are defined in the code) will be labeled as the

how to make vpython .exe using pyinstaller

五迷三道 提交于 2019-12-10 22:56:06
问题 I have a simple script using vpython (just testing) and I want to create a .exe file with pyinstaller. This is the script: from visual import* box() Then I run in the console: pyinstaller sss.py But the .exe dont work(obviously) I've been googling about how to make the .spec file for vpython but dont find nothing. Also tried making this .spec file # -*- mode: python -*- block_cipher = None a = Analysis(['sss.py'], pathex=['C:\\Users\\hdfh\\Documents\\Python Scripts'], binaries=None, datas

ImportError: No module named visual

佐手、 提交于 2019-12-10 03:49:00
问题 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? 回答1: visual module has been renamed to vpython lately. So to run this now, you first install vpython like: sudo pip3 install vpython then replace the line: from visual import * with from vpython import * That worked for me. 回答2: The script requires Vpython to be installed. Then, make sure it is actually installed

Guitar string code in Python? [closed]

a 夏天 提交于 2019-12-01 18:53:18
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 waves when playing different strings, notes, etc. I am also interested in the sound waves when two different strings are being played, and how that changes when they are dissonant and consonant notes. Another thing I'm interested in is how sometimes strings vibrate when they are not being plucked (resonance). Any help is appreciated, thank you!!! This

GTK window capture: VPython (OpenGL) application

和自甴很熟 提交于 2019-12-01 09:02:38
Having read the documentation for VPython and GTK threading , it seems to me that it would be possible to embed VPython graphics within a gtk GUI. I know that it is possible with wx on Windows but I am on Linux and using PyGTK. Now, I have managed to get part of the way. I can embed a VPython window provided that it is spawned a separate process . What I would like is to embed it as a thread. The latter would make GUI events that control the OpenGL easier to implement -- via a thread instead of a socket and network calls. Edit: Apparently nobody knows anything about this... Meh. Here is the

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

不问归期 提交于 2019-11-29 02:18:23
Possible Duplicate: Maximum recursion depth? I have another problem with my code. I'm wrtiting 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 there is sth different wrong. After a few seconds i get an error, which is shown below the source code of my function. Code: def MovingTheBall(listOfBalls,position,numCell,flagOfExecution): flag = 0 if flagOfExecution==0: positionTmp = position else: positionTmp = (position[0]+choice([-1,0,1]),position[1]

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

社会主义新天地 提交于 2019-11-27 16:23:45
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: Maximum recursion depth? I have another problem with my code. I'm wrtiting 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 there is sth different wrong. After a few seconds i get an error, which is shown below the source code of my function. Code: def