UNIX shell written in a reasonable language? [closed] - python

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Has anyone ever heard of a UNIX shell written in a reasonable language, like Python?

Eshell is a Bash-like shell in Emacs Lisp.
IPython can be used as a system shell, though the syntax is a bit weird (supporting all of Python plus basic sh constructs).
fish has a core written in C, but much of its functionality is implemented in itself. Unlike many rare shells, it can be used as your login shell.
Hotwire deserves another mention. Its basic design appears to be "PowerShell in Python," but it also does some clever things with UI. The last release was in 2008.
Zoidberg is written in Perl and uses Perl syntax. A nice-looking project, shame it seems to have stalled.
Scsh would be a pain to use as a login shell (an example command from the docs: (run/strings (find "." -name *.c -print))), but it looks like a good "Perl in Scheme."

iPython (Python) and Rush (Ruby) are shells that are designed for more advanced languages. There's also Hotwire, which is sort of a weird integrated shell/terminal emulator.

From all appearances, Python IS a shell. It runs with #! and it can run interactively. Between the os and shutil packages you have all of the features of standard Unix shells.
Since you can do anything in Python with simple, powerful scripts, you don't really need to spend any time messing with the other shells.

Well, there's emacs, which is arguably a shell written in lisp :)
Seriously though, are you looking for a reimplementation of an existing shell design in a different language such as Python? Or are you looking for a new implementation of a shell language that looks similar to your language of choice?

There is xon now:
http://xon.sh/
http://xon.sh/tutorial.html#running-commands
PyCon video - https://www.youtube.com/watch?v=uaje5I22kgE

Tclsh is pretty nice (assuming you like Tcl, of course).

Try rash. It's a shell language written in Racket. It has a nice interactive-friendly syntax. You can embed Rash inside any normal Racket file as well as embedding normal Racket inside Rash. It's extensible and you can define new pipeline operators. It's still alpha quality at the moment, but it's pretty cool. Full disclosure: I wrote it.

Related

Python simulator recommendation [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Anyone has any python simulator to recommend? am new to python programming. is there any program similar to codeblocks for C++ programming? Thanks
I think you might be slightly confused over terminology.
The term "simulator" doesn't really mean much in the context of programming. A simulator is something which pretends to be some other platform so you can test code on it. For example, I might use an Android simulator or a Gameboy simulator on my computer so I can test code without having to transfer it all the time.
You might mean "IDE" instead. Codeblocks is an example of an IDE. It stands for "Integrated Development System". It combines a "compiler" (something which turns what you write into executable code) and a specialized "text editor" (a program which lets you write text). It also includes a wide variety of convenient features to make programming in C++ more easy.
Note that you technically don't need an IDE to write code. An IDE combines a compiler (or an interpreter, in the case of Python) with a text editor, and a bunch of extra features for convenience, but this is by no means "necessary", strictly speaking. All you need in order to write code is a text editor of some sort, and a compiler or interpreter.
For example, I typically use either Notepad++ or Vim to write my Python code, and run it directly from the command line.
Regardless, Python has a wide variety of IDEs you can look at. Here is a comparison of the most popular ones.
However, you don't necessarily need a fancy IDE to program in Python! If you just directly install Python, it comes with a simple IDE called "IDLE" which you can use to write and run Python code. If you're new to Python, I recommend you use IDLE for now, until you get the hang of things.
tl;dr
To summarize:
A simulator is a program that pretends to be some other kind of computer/platform. Simulators are used to test code.
An IDE stands for "Integrated Development System" and is used to write and run code.
It combines a compiler or interpreter with a text editor.
There are many IDES for Python. Here is a list.
However, I recommend you use IDLE, which is included by default when you install Python.
Codeblocks does have a plugin for Python: http://wiki.codeblocks.org/index.php?title=Python_plugin . Though, I am not sure, how popular that is!
There was a similar discussion on SO: What IDE to use for Python?

Python development environments like Smalltalk [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I like programming in the Python language to solve daily problems in system administration contexts, and I am happy with that.
I am learning Pharo Smalltalk and am fascinated by the different approach of this language in object programming.
I like very much the idea of the Smalltalk virtual machine and the system image concept which holds the environment all in one file.
Does anything similar exist in Python?
If you have enough time :) you could of course use Glamour and Petitparser to build a Python development environment in Pharo.
AFAIK, no. There isn't anything like a Smalltalk image for Python.
Actually there is nothing like smalltalk in any other kind of language. The only thing ever to get close was and still is Delphi and its open source brother Free Pascal + Lazarus but still because it tried to keep ties with C/C++ its very different as a language and environment. I love python as a language and because is extremely popular, easy, simple etc. But as soon as you leave language and libraries territory you are alone. And that pretty much convinced me that the smalltalk environment is what I wanted the most.
The only thing approaching the elegance , ease of use and power of smalltalk environment is emacs. I won't mention vim here not because is an inferior editor and certainly not because is any less extendable.Vim is awesome. But emacs like smalltalk IDE are built on top of their own languages. For smalltalk IDE its smalltalk for emacs its elisp which accounts for more than 90% of its code based , compared to VIM that depends 50% on C source code.
What emacs lack in GUIs , it gains in documentation. Emacs also has a simple architecture , everything is not an object like smalltalk but is a function and elisp even has lisp macros for you to create your own syntax. For me emacs is another great , amazing environment to work into. Emacs has pymacs which allows you to script emacs with python and gain full access to all emacs libraries but elisp is not only faster but way more elegant than python as a programming language.
Let's take BlueBook and write SmallPython ourself ?
http://www.mirandabanda.org/bluebook/
http://stephane.ducasse.free.fr/FreeBooks/BlueBook/Bluebook.pdf

Scripting Languages [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am looking for a good scripting language to link to my program.
I am looking for 2 important attributes:
Scripting language should be hard linked into the executable (not requiring 3rd party
installations). This is important to me to simplify distribution.
Scripting should allow some run-time debugging option (When running a script inside my program I would like to easily run it inside a debugger while it is running in the context of my program)
Can python,lua or some other language supply me with this?
Both Lua and Python can provide the features you mention, so choosing one of them will depend on other criteria.
Lua is a lighter weight solution, it will have a much smaller disk footprint and likely a smaller memory overhead than Python too. For some uses it may be faster. Python has a much richer standard library, more mature third party libraries and a more expressive language.
Both have been embedded into major applications. Python can be found in Blender, OpenOffice and Civilization 4. Lua can be found in World of Warcraft and Adobe Lightroom. I'd recommend looking at a few tutorials for each and the facilities available to embed them in your application and just choose the one that fits your brain best.
Lua is designed for this:
static linking? check!
debugging? check!
Typically, Lua is the better choice for embedding into another project. Python is better as a standalone platform because the library support is so much broader. See Lua Versus Python for more details.
Personally, I use both very frequently depending on the job at hand. I always use Lua for embedding into C/C++ applications or scripting functionality that is imported from C/C++ shared libraries (i.e. a DLL). Python is always my first choice for standalone tasks that do not require low-level C/C++ code.
I'd put my two cents in for python. I don't know a lot of the details, but the computer graphics suite blender does a wonderful job of implementing python scripting.
As far as I can tell in blender 2.5 the interpreter is run from inside the executable,
import sys
sys.executable
shows /blender/blender.exe
and there is good debugging support, it even has a full interactive interpreter inside.
For more info check out: http://www.blender.org/
I really like Lua for embedding, but just as another alternative, JavaScript is easily embeddable in C, C++ (SpiderMonkey and V8) and Java (Rhino) programs.
In addition to Tcl, Lua, and Javascript (all already mentioned), Guile is another language designed explicitly for this.
I'll add Tcl to the mix. It's designed to be easily embedded into other programs.

Looking for a Python IDE with good support for libraries (Twisted) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I'm looking for a Python IDE that can help me easily locate and manage and use the libraries on my system (Ubuntu). Specifically Twisted.
Code completion is important including the symbols I import.
(I've so far had a look at PyDev as well as OpenKomodo, but while both offer code completion for default Python concepts, I wasn't able to get either to import Twisted into my project and was thus getting reference errors.)
Usual disclaimer: I don't like EMACS or vi, please, nothing regarding those.
Using Wing IDE with Twisted discusses how to debug twisted using their IDE - although unfortunately WingWare is not free.
Are you sure you have given PyDev a fair look? It seems to be the most popular Python IDE, and I have always had good experiences with it in the past.
I've just downloaded the preview of netbeans and it seems to have done quite well so far.
It has detected inherited methods & properties. I haven't had to add a single library reference in my project, so this seems to be the most fluid so far.
eclipse + pydev seems to work well for me.
Just remember to right-click on the project and select Properties and make sure that your libraries are on the path. Sometimes this doesn't happen for easy_installed libraries.
Check out JetBrains PyCharm. It features:
Code completion of any imported library
Good support for unit testing
Refactoring
Debugging
Version control integration
It's built on the same platform as IntelliJ IDEA which is a generally considered one of the best Java IDEs. There's a community edition which is free and open-source.
Like Eclipse is primarily a Java IDE written in Java, you could try Eric which is a Python IDE written in Python. I have had some issues with it in the past but I really enjoy the ability to stop your code at a breakpoint and have access to the python console to manipulate your data or even to inject new functions. PyDev could really use a console like that.
for a small proyects Scribes. Otherwise Eclipse+pydev.

Alternative ways to browse the python api [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
Is it just me, or the python standard library documentation is extremely difficult to browse through?
http://docs.python.org/3.1/library/index.html
http://docs.python.org/3.1/modindex.html
Java has its brilliant Javadocs, Ruby has its helpful Ruby-Docs, only in python I cannot find a good way to navigate through the standard library documentation.
There's the Epydoc project, which looks nice, but does anyone know if it is actually being used on the standard library, so we can all go through it? If not, what are the alternatives people are using to browse python documentation.
I usually use the built-in pydoc, if you are on windows it should be called Module Docs if you are on linux use pydoc -p 8000 and connect through browser.
pydoc from the command line, help() from the interactive interpreter prompt.
pydoc -p 8080
The python community is semi-hostile to automatically generated documentation, especially if it's Object-Orientated. Python isn't just object-orientated (it's a multi-paradigm language), so Python developers generally prefer human-written documentation. Sometimes the functions are important, sometimes the Class structure is important.
you can go to here and download the chm version of Python 3.1. With that, searching through the docs should be easy.
I used to use the python sidebar from Edgewall a long time ago.
These days, I google for the python function (the standard docs almost always show up as the first link).If I want to browse the source of the module (useful sometimes), I use this little shell function I wrote.
epy () {
cmd="import $1 as a ; print a.__file__.endswith('.pyc') and a.__file__[:-1] or a.__file__"
file=$(/usr/bin/env python -c $cmd)
echo $file
emacsclient --no-wait $file
}
I guess I'm going to get downvoted but I find nothing wrong with the Sphinx docs and I find them way way better than the java alternative.

Categories

Resources