ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Technically, every time you run a Python program, it's compiled into bytecodes which are then interpreted by the virtual machine. When modules are called from scripts, they are oftentimes compiled and then their bytecodes are written to .pyc files for fast loading later on. Googling turns up a page about this straight away. The idea is similar to byte-compiling Lisp code. Perl works this way as well, it's just that Perl doesn't write its bytecodes to files (by default).
OK-but I want to write programs that I can open later. I have had some (as in very little) experience with C++ and know HTML pretty well. (I know HTML isn't really a programming language but I thought I'd throw it in...)
Oh, you mean as opposed to typing them into the REPL? (In other words, the interactive prompt?) Yes, just type your program into a file (use a .py extension) and then run `python name-of-file` to run the program. Or, alternatively, at the start of the file write "#!/usr/bin/env python" and make the file executable with `chmod +x name-of-file` and run it like any other command from the shell (not available in Windows). You'll probably have to put the directory in front of it, like so: `./name-of-file`
Ruby is a fantastical programming language. To sum up its virtues in one word: abstraction. I'd say, the best way to decide if you like it is to give it a shot.
And by the way, decent programming languages are not tied to IDEs -- if you want to write Ruby in KDevelop, go ahead. I use Emacs for editing everything and then run stuff from the shell (or actually, from Emacs' shell mode, but they're still standalone commands). You can really learn a lot about how stuff works by doing things from the CLI instead of relying on IDE magick.
You can compile python programs into c type files. Unfortunately I don't know how to do this, so can't be of much help.
I suppose you talk about Shed Skin.
There are various attempts at compiling Python to machine code, but they are either incomplete, or they package the interpreter with the Python program in one way or another.
That's why I say basically, No.
AFAIK, the same goes for Ruby.
You can use py2exe on Windows and PyInstaller on Linux.
Both programs 'compiles' python scripts into 'stand alone executables'.
True, but then again if you use that on more than one program you end up installing multiple partial copies of the Python interpreter. Doesn't make any sense IMHO.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.