vpython in text editor

159 views
Skip to first unread message

nbroberts97

unread,
Sep 25, 2015, 10:10:37 PM9/25/15
to VPython-users
Hey! So I'm trying to use vpython with sublime text 2 and I got my programs to execute properly with the correct outputs, but i cannot find a way to display the vpython 3d modeling window. Is there any way to do this?
(I am using ST2 with SublimeREPL with Python 2.7.10 and VPython 6.11)

Bruce Sherwood

unread,
Sep 25, 2015, 11:10:10 PM9/25/15
to vpytho...@googlegroups.com
I have no experience with any of the software you name, but did you try saving the file as (say) test.py and running it from a typescript, in the form "python test.py" or something similar?

nbroberts97

unread,
Sep 25, 2015, 11:30:51 PM9/25/15
to VPython-users
I'm not entirely sure what you mean, but if it helps, it works fine if I run the program in the VPython VIDLE application, but I just prefer the interface of Sublime Text, which is simply a text editor.

Bruce Sherwood

unread,
Sep 25, 2015, 11:38:25 PM9/25/15
to vpytho...@googlegroups.com
Fine, but then it must be the case that Sublime Text doesn't make all the necessary connections to run a VPython program, hence if you use that editor it may be necessary to do what I said: Save the file from the editor and run the program in a "typescript" or "terminal" or "command prompt" where you can execute something like "python test.py".

Matt Craig

unread,
Sep 26, 2015, 1:10:40 AM9/26/15
to VPython-users
Hi,

I use Sublime Text (3, not , 2, though I used that too), save the file and, like Bruce said, then run python from the command line.

ST comes with its own python, so it is conceivable you are running that python instead of the one where you have vpython installed.

If you really wanted to stay in the ST REPL I guess you could do 

import subprocess
subprocess
.call(["python", "my_test_program.py"])

but it would be easier to run from the terminal and do your editing in ST.

What platform are you on?

Matt Craig
Reply all
Reply to author
Forward
0 new messages