Click to See Complete Forum and Search --> : Python Question
Hi,
I don't know who, if anyone, here programs in Python, but I've taken an interest in the scripting language and had a simple question (one that should have been answered from the start, but every site I've been to assumes you know exactly what the language does). My question is, is it a server-side scripting language like PHP, or is it a general-purpose language like Perl where you can write both server-side scripts and standalone applications to run on an operating system?
Thanks,
NogDog
03-24-2005, 06:51 PM
It's more or less an object-oriented derivation of Perl, and I would classify it as a "Perl type" language. (Note, however, that PHP can be used for non-web-related programming, as well. :) )
Originally posted by NogDog
It's more or less an object-oriented derivation of Perl, and I would classify it as a "Perl type" language. (Note, however, that PHP can be used for non-web-related programming, as well. :) )
Thanks. That does mean I can more or less use it as a sort of C, correct? And, if so, do you know how I would compile a program or develop a GUI?
MstrBob
03-24-2005, 09:16 PM
Well, you'd either need to create your own GUI (Much luck and God speed on that) or have access to a library for a GUI. GUI's entail a lot, I've learned that from my adventures with C++ and as I now learn Java. But, from what I understand, Python has a large library, and could very well have a GUI library. I love wikipedia:
http://en.wikipedia.org/wiki/Python_programming_language
NogDog
03-24-2005, 09:20 PM
I believe Python is like Perl (and PHP) in that it is compiled at runtime: you just create a text file with all the statements and invoke the interpreter/compiler at runtime to execute that file.
ray326
03-24-2005, 09:42 PM
I believe you'll find Python bindings for several GUI libraries like TK and GTK. I think there's also a mod_python for Apache that gives you in process access ala mod_perl, mod_asp or mod_php. Normally it's not used for web server side interaction, though.
Originally posted by ray326
Normally it's not used for web server side interaction, though.
Blogger (http://www.blogger.com/) uses Python, correct?
Anyway, thanks a ton for all the replies, guys, it's been really helpful! :)
AdamGundry
03-25-2005, 03:26 AM
Python is the most beautiful language ever. (As long as you like to indent code.) It allows you to code in a wide range of styles, either straight procedural, OOP, functional, or whatever. It is perfectly possible to use it for server-side scripting, but Python is much more general and like Perl in that respect. It's not like Perl in the sense that code is actually readable!
For creating a GUI, check out TkInter (http://www.python.org/moin/TkInter). You might like to read Dive Into Python (http://diveintopython.org/).
Adam
P.S. In case you haven't guessed, I'm a big fan of Python. The above is not exactly a balanced viewpoint.
Haha, thank you Adam very much. I have already looked a lot at the syntax and how Python code is written. I admit that it does look very simplified (especially when compared to Perl). Thanks again.
ray326
03-25-2005, 02:18 PM
Blogger (http://www.blogger.com/) uses Python, correct?
Some of it does for sure.