Using Sublime Text 2 with Portable Python

I have portable python and portable sublime text installed on a flash drive. I edited the python-build file so that it uses portable python to run programs, but it doesn't print anything in an elevated text box, it just opens a command prompt window that closes immediately if the program stops or has an error, is there a way to make the output pop up in high text? Ideally, I would like to make it suitable for use on all Windows computers so that I can transfer the workflow!

Thanks!

+4
source share
1 answer

I ran into the same problem, and after a little troubleshooting, here is my solution:

1) Use the build system:

{ "cmd": ["\\Portable Python 2.7.6.1\\App\\python.exe", "-u", "$file"], "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", "selector": "source.python"} 

This assembly will open your program in Python Portable. Instead of specifying a drive letter, the use of "\" will follow the path relative to the root of the current drive.

2) At the end of the code, add the following line to prevent forced closure:

 os.system("pause") 

Also, be sure to import the os module:

 import os 
+2
source

All Articles