Replicatorg Python Version

2.1. Invoking the Interpreter¶

The Python interpreter is usually installed as /usr/local/bin/python3.9on those machines where it is available; putting /usr/local/bin in yourUnix shell’s search path makes it possible to start it by typing the command:

Python Version Command

to the shell. 1 Since the choice of the directory where the interpreter livesis an installation option, other places are possible; check with your localPython guru or system administrator. (E.g., /usr/local/python is apopular alternative location.)

On Windows machines where you have installed Python from the Microsoft Store, the python3.9 command will be available. If you havethe py.exe launcher installed, you can use the pycommand. See Excursus: Setting environment variables for other ways to launch Python.

Typing an end-of-file character (Control-D on Unix, Control-Z onWindows) at the primary prompt causes the interpreter to exit with a zero exitstatus. If that doesn’t work, you can exit the interpreter by typing thefollowing command: quit().

Replicatorg Python Interpreter

The interpreter’s line-editing features include interactive editing, historysubstitution and code completion on systems that support the GNU Readline library.Perhaps the quickest check to see whether command line editing is supported istyping Control-P to the first Python prompt you get. If it beeps, youhave command line editing; see Appendix Interactive Input Editing and History Substitution for anintroduction to the keys. If nothing appears to happen, or if ^P isechoed, command line editing isn’t available; you’ll only be able to usebackspace to remove characters from the current line.

The interpreter operates somewhat like the Unix shell: when called with standardinput connected to a tty device, it reads and executes commands interactively;when called with a file name argument or with a file as standard input, it readsand executes a script from that file.

Replicatorg Python VersionSoftware

A second way of starting the interpreter is python-ccommand[arg]...,which executes the statement(s) in command, analogous to the shell’s-c option. Since Python statements often contain spaces or othercharacters that are special to the shell, it is usually advised to quotecommand in its entirety with single quotes.

Some Python modules are also useful as scripts. These can be invoked usingpython-mmodule[arg]..., which executes the source file for module asif you had spelled out its full name on the command line.

ReplicatorG is used because it is simple and fairly intuitive. For example, after generating GCode, ReplicatorG will let you view the GCode in another tab. There you can edit the GCode and then save the edited GCode to your SD card. ReplicatorG slices the 3D model into small layers. Each layer will be a layer that is printed by the 3D printer. ReplicatorG is used because it is simple and fairly intuitive. For example, after generating GCode, ReplicatorG will let you view the GCode in another tab. There you can edit the GCode and then save the edited GCode to your SD card. ReplicatorG slices the 3D model into small layers. Each layer will be a layer that is printed by the 3D printer.

When a script file is used, it is sometimes useful to be able to run the scriptand enter interactive mode afterwards. This can be done by passing -ibefore the script.

All command line options are described in Command line and environment.

2.1.1. Argument Passing¶

When known to the interpreter, the script name and additional argumentsthereafter are turned into a list of strings and assigned to the argvvariable in the sys module. You can access this list by executing importsys. The length of the list is at least one; when no script and no argumentsare given, sys.argv[0] is an empty string. When the script name is given as'-' (meaning standard input), sys.argv[0] is set to '-'. When-ccommand is used, sys.argv[0] is set to '-c'. When-mmodule is used, sys.argv[0] is set to the full name of thelocated module. Options found after -ccommand or -mmodule are not consumed by the Python interpreter’s option processing butleft in sys.argv for the command or module to handle.

2.1.2. Interactive Mode¶

When commands are read from a tty, the interpreter is said to be in interactivemode. In this mode it prompts for the next command with the primary prompt,usually three greater-than signs (>>>); for continuation lines it promptswith the secondary prompt, by default three dots (...). The interpreterprints a welcome message stating its version number and a copyright noticebefore printing the first prompt:

Continuation lines are needed when entering a multi-line construct. As anexample, take a look at this if statement:

For more on interactive mode, see Interactive Mode.

Hi, All,

I grabbed ReplicatorG 0017 (v2) for Linux and had no problems
unpacking and running it, but when I went to convert an STL to GCode,
I ran into a bit of a problem. I'm running CentOS on my build laptop,
and it comes with Python 2.4. I built Python 2.5 from source into
/usr/local and had no problems invoking Skeinforge 0006 manually
('/usr/local/bin/python2.5 ./skeinforge-0006/skeinforge.py'), but I
seem to be having difficulty getting ReplicatorG 0017 to invoke the
right Python.

I've tried an alias of python2.5 for python; I've tried fiddling the
shebang line in skeinforge.py. What's tripping me up appears to be
some sort of version check in RepG itself. I get a dialog box that
says:

Generating gcode requires Python version 2.5.0 or later. Python
version 2.4.3 was detected
Make sure your system has the 'python' and 'python-tk' packages installed.

I'm not a Java guru, so I'm hoping someone who is can ferret out how
RepG 0017 determines what python(s) is/are installed and how I can get
it to let me proceed with an alternate version of Python installed
since RedHat and CentOS don't take kindly to upgrading the system-wide
python install above 2.4.

Thanks for any tips.

-ethan