FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Python





BlockUp
Just interested if any Frihosters are using this simple programming script.
Hey, I'm young and curious.
the zephyrus
I am. I like how loose the language can be. Most other languages seem obsessed with double-checks and triple-checks and type assertions everywhere. But really I don't need those things and Python means I have to write less to get my point across. It also lets me do things that other languages do not. As bad of ideas as they may be in terms of proper code, they do work and I take working but inadvisable over theoretical.
Antoine_935
I'm now using Python for most of my programs, because it's powerful enough to support everything that's needed (i-e databases, GTK, sockets, binary files, SDL, CGI and so on...), but also because it has a very large potent (operator overload, this is very important while programming user-friendly libraries, inheritage...), but mostly because you can easily and quickly code a whole program.

But, as every language, it also has some problems.
We have to keep in mind that, even if it's upto 10 times faster than PHP, it still remains an interpreted language, which is really not as fast as a compiled one, like C or other languages.

However, Python is largely used, even by professionnals and closed source development.
It has been used to create commercial softwares, like games, to program the robots exploring Mars (don't know how to say this in english, a planet we currently explore), to create ZOPE, which is used by some important foundations.

I think that it can be compared to java, for it's power, but only if you're already a good programmer.
crasso
Antoine_935 wrote:
I think that it can be compared to java, for it's power, but only if you're already a good programmer.

Just a remark, Python is very comfortable language to start with for a beginner...
Antoine_935
You're right, I didn't mean that it is a difficul language, but that it has a lot of features that can make it as powerful as java when fully controlled
spam
check out pyopengl, then you can run python scripts with hardware graphics accelleration Smile sweet
game_dev
Quote:
... even if it's upto 10 times faster than PHP, ...


I don't think that python scripts on a web server execute 10 times faster than PHP. Let's time I checked, execution times where very similiar.

Maybe you could mention the source where you got this from?

Regards.

gd
wodor
content in next post, please romve this post
wodor
I think python is a great language to learn programming, it learns good conventions, for example code indenting.
I have seen many snippets of code written by copy-paste-wannabe-programmers in php, without any indentation, some people just don't do this 'cause they think it's not necessary. (weird) in python you HAVE to indent properly.

Another advantage is that python has a lot of great libraries shipped with distribution , you don't have to waste time for searching modules for everything.

And of course python is a very universal language.

Python apps might be quite fast. Python interpreter produces .pyc files which are kind of 'bytecode(?)' , when you launch the same script again the .pyc file is used. It improves performance
-Jordan-
spam wrote:
check out pyopengl, then you can run python scripts with hardware graphics accelleration Smile sweet


Yep, google use Python for most of their applications. Even youtube is now 90% python.
crasso
-Jordan- wrote:
Yep, google use Python for most of their applications. Even youtube is now 90% python.

Some guy once was interesting to begin programming and he asked which language or languages could make him great programmer. I answered that with good knowledge in C++ and Python he could solve any programming problem or make any desktop or web application for any purpose these days.
eznet
crasso wrote:
Some guy once was interesting to begin programming and he asked which language or languages could make him great programmer. I answered that with good knowledge in C++ and Python he could solve any programming problem or make any desktop or web application for any purpose these days.

That is one heck of an endorsement. I haven't been able to play with Python as much as I would like but I can say that what little I have has actually been entertaining. After weeks of C++ and Java in my current CS curriculum, Python is a breath of fresh air.
deepak
I guess python is the answer ... but sometime i use perl too .. I just started python with Django and/or Turbogear it really make at least admin end very easy and fast.
Antoine_935
game_dev wrote:
Quote:
... even if it's upto 10 times faster than PHP, ...


I don't think that python scripts on a web server execute 10 times faster than PHP. Let's time I checked, execution times where very similiar.

Maybe you could mention the source where you got this from?

Regards.

gd


Source was myself, I tried out a lot of routines, used on websites and other applications, like loops and others.

Python was nearly 10 times faster than PHP
deepak
Python as CGI run slower than PHP and It is very obvious because it is CGI. But on FastCGI or mod_python it performs nearly same as PHP in terms of time of execution.

What does Python have that PHP doesn't?
Code:
a general purpose programming language (not just for the web) (not true PHP has a CLI SAPI, and is embeddable)

indentation is used to mark out block structure rather than curly braces

namespaces and modules

a small core

very clear, concise, and orthogonal syntax

it is self documenting with docstrings and pydoc (PHP 5 has reflection and doc strings)

keyword arguments to functions and methods, easy support for default arguments

true object orientation and 'first class' classes and functions (OO has been completely revamped in PHP 5)

classes are used extensively in the standard library

a notion of private attributes (PHP 5 supports this)

multiple inheritance

object-oriented file handling

method chaining

excellent introspection (PHP 5 Reflection)

everything is a reference! (references are painful in PHP) (Not in PHP 5)

one 'del' statement for all data types. PHP has 'unset' for variables and something else for array members. (Array members can be unset())

consistent case sensitivity (PHP does for variables, but not functions) (Functions are case insensitive)

a simple array slicing syntax

lambdas and other builtin functional programming constructs (php.net/create_function)

iterators (PHP 5)

structured exception handling (PHP 5)

operator overloading

threading
Antoine_935
I see in your list (very interresting one !) "method chaining"
what is it ?
jabapyth
i too use python, and have been for a few years. i highly recommend it to anyone, beginner or advanced programmer. my newest python find: pygame. make games using python! its the interface with sdl. http://pygame.org
eznet
It is funny... there really is a lot of fan support for Python. I am now in my next advanced class in my CS curriculum, it is unfortunately teaching advanced design techniques in C++ (of all the languages available) and you would not believe the number of time that Python (and Ruby) is mentioned by both teacher and student alike. Python just seems to be robust and easy to adapt to, especially if you have any programming experience at all.
Magicman
I've been using python for a while now. At first I only used it to expand the power of my Blender games but now I'm trying out wxpython to create my own gui'ed program.
Kelcey
I may be picking it up very soon. Everyone seems to love it a lot.
eznet
Magicman wrote:
I've been using python for a while now. At first I only used it to expand the power of my Blender games but now I'm trying out wxpython to create my own gui'ed program.


Curious here. So, are you talking about Blender - the 3d rendering software? Regardless, what type of games are you creating?
deepak
method chaning is a simple approch when you call method of method of some object .. like

myobj.mymethod1().mymethod2()

It is possible in python!
Echo Printer
I think Python is a very good language to start off with. I am a novice when it comes to anything to do with server-side scripting/programming languages, I've mainly been focusing on client-side scripting for the last year (HTML/CSS) or so.. ....regardless, I've just started to try and find a server-side side scripting language to start learning and after trying out PHP, JSP, even ASP, I've come to find that Python seems to be more flexible than those mentioned above. In fact, I think Python is really considered a object-oriented high-level programming language, but you can do server-side stuff with it also so that's really cool in my opinion. I guess everyone has their own preference though, so go and try them all if you have the time like I've had. I've just come to like the clean, readable syntax of Python and the nice documentation they have on http://www.python.org/. After screwing with Perl/PHP/ASP...etc...I think I've found Python to be my favorite.
rohan2kool
python is powerfull... multi-purpose and easy... but the thing i like about it most is the small footprint and extremely fast rate of interpreting. Although it is slower than C++ or assembly.. for the ease and flexibility of an interpreted language... this thing rocks Very Happy
Related topics
Monty Python
Python Tutorial
Python
python tutorials
python tutorials
Python books
Python Bursts After Trying to Eat Gator
python support
python
pls suggest software to generate thumbnails etc...
Unix Python Code Execution
Python
Python(cont)
Does frihost still support Python for CGI programming
Kentucky Man Finds Python in Rental Car
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.