Maybe it's my browser or pre-processing for the website, but there are lots of code errors in the examples: Bad indentation, missing doubled backslashes in the non-raw strings used for file names (a better approach is to use raw string, which are written r"C:\my\dir"), and so forth.
Using uniform depth for indentation makes Python a lot easier to read, and so does using a couple of function defs instead of one big block of code. Really deep nested code is bad in any language, but worse in Python. If this weren't done, the end-of-block comments wouldn't be needed for clarification.
OK, maybe I'm being nitpicky, but this is my perspective as a long-time Python user.
Discussion on:
View:
Show:
Why not try Icon, a programming language.
That is very easy and powerful one, especially for dealing with string/text, like perl and more excellent than perl.
That is very easy and powerful one, especially for dealing with string/text, like perl and more excellent than perl.
Python is a great language to learn, but what about using it on the web?
I dunno bout the web, but I do know there are publicly available scripts out there that convert perl2python... perhaps that's why the author didn't divulge how "she" did it.
--Ray
--Ray
If you're really interested in Python, which if you're a programmer you should even if it's just to shorten your code, check out Active State's Python or python.org. Sorry Builder but this has been around for a while now and there are some well developed resource sites.
As for the Web, there are really solid modules avilable for just about everything you can think of if you're not into writing your own code, check out the email modules, VERY SOLID, STRONG and SLEEK.
"We could build a bridge out of her"
P.S. Don't forget to take your Monty Python sense of humor with you.
As for the Web, there are really solid modules avilable for just about everything you can think of if you're not into writing your own code, check out the email modules, VERY SOLID, STRONG and SLEEK.
"We could build a bridge out of her"
P.S. Don't forget to take your Monty Python sense of humor with you.
If you want to use Python for the web, there is no problem in doing so - use it as you have been using Perl for that. You can call .py files the same way you call .pl files.
There is also an application server (of a sort) available - Zope. It is written in Zope, is quite scalable and easy to learn and use. It can even be taught to clients, if needed - it is web-based, doesn't need any special software on the client's end and feels "familiar". It can also be used for CMS, for instance.
Oneof the best sides of Zope is that new functionality can be added very easily, either by adding products (similar to libraries) or writing your own extensions in Python, as I do, when neccessary.
There is also an application server (of a sort) available - Zope. It is written in Zope, is quite scalable and easy to learn and use. It can even be taught to clients, if needed - it is web-based, doesn't need any special software on the client's end and feels "familiar". It can also be used for CMS, for instance.
Oneof the best sides of Zope is that new functionality can be added very easily, either by adding products (similar to libraries) or writing your own extensions in Python, as I do, when neccessary.
Icon or Unicon is a very cool programming language.
She is easy and powerful, like perl but more excellent than perl.
Of course, she has some drawbacks.
She is easy and powerful, like perl but more excellent than perl.
Of course, she has some drawbacks.
This function takes a list as its argument and returns an integer whose value is equal to the number of elements in the list. paycheck loan
- Keyboard Shortcuts:
- Prev
- Next
- Toggle









































