Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 16th, 2001, 02:34 AM
mouserdj mouserdj is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 77 mouserdj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
unsure of how it all works

hi,

I have been looking at the 101 tutorials and am finding them quite useful. However, i have only read parts 1-3 so far. I am just a bit unsure of how you call a python script from a web page though.... I am coming from a php background and the way I see it at the moment is that you put your python script in cgi-bin and then call it directly from there... am I correct in thinking this? what needs to be setup (say with apache) in order to use python?

Also, I am just wondering what the advantages of using python over php would be?? I have read some where that python is a proper OO language - is this all?

thanks in advance,

dave
Comments on this post
Gran Roguismo agrees!

Reply With Quote
  #2  
Old July 16th, 2001, 07:28 AM
dcaillouet's Avatar
dcaillouet dcaillouet is offline
Big Endian
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: May 2001
Location: Fly-over country
Posts: 1,172 dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 16 h 29 m 5 sec
Reputation Power: 29
I've been using Perl as a scripting language for a couple of years and I'm new to web development. Last month, I started learning Python and really like the language. As such, I'm not a guru capable of answering your questions based on years of personal experience. If you know PHP and can do everything you want to do in it, I don't know of any particular reason you would want to switch to Python. In my case, I'm interested in learning OO programming techniques and figured this would be a good language to learn on. If you haven't looked a Zope (www.zope.org) which is an Open Source web application server written in Python, you might want to check it out.

Quote:
what needs to be setup (say with apache) in order to use python?

http://starship.python.net/crew/dav...e=faq01.001.htp
http://starship.python.net/crew/dav...w.cgi?req=index

Quote:
Also, I am just wondering what the advantages of using python over php would be?? I have read some where that python is a proper OO language - is this all?

--First-class functions and first-class everything else. Functions, methods, modules, classes, and other components of Python programs may be passed to functions or stored in data structures.

--Object orientation with multiple inheritance and late binding. Python allows creation of object-oriented class hierarchies, and the object referred to by name.attribute is determined at run time via a dynamic name search. For example, as demonstrated in the chapter on generating HTML, these features allow straightforward expression of complex computational concepts, and a high degree of code-reuse.

--Object-oriented and named exception handling. Errors or other exceptional conditions in Python programs can be trapped using try..except statements, and finalization actions can be specified using try..finally. This greatly simplifies code that may encounter exceptional conditions that interrupt the normal flow of control of the program. Exceptions may also be organized into inheritance structures.

--Dynamic calling sequences. Python callable objects can accept optional arguments, keyword arguments, or unlimited numbers of arguments. These features allow very generic and highly configurable operations to be implemented in terse Python declarations.

--Extendible: Python can be easily extended with interfaces to external programming libraries or new data types via compiled extension modules. Adding new compiled components to Python is easy -- much easier than writing stand-alone compiled programs. On most major platforms new compiled components may also be loaded into the interpreter dynamically, on demand.

--JPython is a re-implementation of Python in Java that compiles Python code into Java bytecodes. The resulting environment has very tight, almost seamless, integration with Java. It's trivial to access Java classes from Python, and you can write Python classes that subclass Java classes. JPython can be used for prototyping Java applications in much the same way CPython is used, and it can also be used for test suites for Java code, or embedded in a Java application to add scripting capabilities.

--New standard library features such as Unicode and XML support.

Reply With Quote
  #3  
Old July 16th, 2001, 06:41 PM
mouserdj mouserdj is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 77 mouserdj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
hi,

Thanks for your quick response - it was very helpful!! I think I am going to still read on more about python. With a bit of experience with php's OO I was looking for something a bit better. I found your links very helpful and as I read through them I am sure things will fall into place. Thanks again for your help.......

regards,

dave

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > unsure of how it all works

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap