Sublime Forum

Beginner needs help

#1
  1. I have python installed on a windows machine. New to Python.

  2. What is a build? Documentation not clear enough for a beginner.

  3. How to I run "Print(“Hello World”). What should I see?

  4. When I think I’m running the above code I get the following error:
    [WinError 2] The system cannot find the file specified
    [cmd: [‘python3’, ‘-u’, ‘C:\Users\Owner\Desktop\Python\Sublime Work Folder\hello’]]
    [dir: C:\Users\Owner\Desktop\Python\Sublime Work Folder]

Thank you.

0 Likes

#2

ST’s “build system” is primarily meant as entry point to run predefined scripts to compile a program. This may be a single compiler call or a complex makefile.

ST ships with a simple build system for python, which just runs the code from your view.

Please note: The build system can only output strings. You won’t be able to run interactive programms which need user input.

The error message just says python3 not to be found. That’s normal on Windows as you would just need to run py if you installed the python launcher or python. The build script seems to have its origin on linux.

A build system is defined in a json file. You may want to refer to ST’s documentation to see how it is structured. Maybe PackageDev can help you writing it as it provides a command palette entry for “Create New Build System…” which creates a template and by providing useful completions.

0 Likes

#3

Thanks for your time. I’m used to the “Run” function and the IDE in Matlab/Simulink.

I’m ok running simple code for python beginners in the terminal window.

For this latest attempt I started python in the terminal mode. Tried to run the 'Print() code. No joy. Got the following error: “shell_cmd or cmd is required; [cmd: None]”

Thanks again

0 Likes

#4

You may try https://packagecontrol.io/packages/Terminus

It can be configured to act as build system target, thus running interactive code via build command in an embedded terminal. The README comes with quite well described examples.

0 Likes

#5

again thank you for the response. Actually the Python is easier to work with than the IDE!

0 Likes