954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Why should i learn Python?

im just curious im currently learning all major programming languages that are usefull to me and i am wondering what is python useful for in a realistic sense

Gargen
Light Poster
28 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

Which of the 250 major computer languages are you learning? I need some idea so I can compare.

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 

im learning the ones that i have found i will be able to use C/C++/C# php java perl css html xhtml xml BASIC those are the ones so far i have found that will be useful but i know python is up there with the really big ones so im just wondering what i could use it for. I am currently focus on C++ and html. C++ becasue im looking to make my own game and html because im taking a class next year on it and i figure my as well learn it a head of time

Gargen
Light Poster
28 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

I use both C++ and Python and came up with this ...

My 13 point comparison of C++ and Python:
1. C++ and Python complement each other.
2. Maybe C++ is the piano and Python is the guitar.
3. C++ is a low level language and Python is a high level language (more modular).
4. You can write Python programs in just a few lines that would require pages in C++.
5. C++ requires type declarations and Python avoids type declarations.
6. Python containers are simpler and more flexible than C++ containers.
7. Python allows for easier experimentation/concept-development than C++.
8. C++ is compiled to an executable file and Python is compiled and then interpreted.
9. Python has an interactive page where you can quickly test ideas.
10. C++ is more difficult to master than Python. Python code is easier to read.
11. Both C++ and Python are object oriented.
12. Both C++ and Python work on multiple platforms (Windows, Unix, VMS etc).
13. C++ can be and Python is open source.

Edit: You may want to add ...
C++ is prone to memory leaks if you forget to free up used resources, Python has automatic memory management.

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 
Python is compiled and then interpreted


how is it compiled, I thought it is just interperted?

shanenin
Posting Whiz in Training
217 posts since May 2005
Reputation Points: 10
Solved Threads: 17
 

The Python text code file .py is compiled to a .pyc byte code file that speeds up the interpretation process. Most of the time this is transparent to you. There are ways to retain the .pyc file and use it for higher speed.

Python itself uses the compiled files to speed things up. Look in your \Lib folder, there are both .py and .pyc files. the compiled files are not readable with a text editor.

Edit: You made me think about it some more and it finally came back. For ordinary .py code files the bytecode image of the .pyc file is created in memory. That's why you don't find them on the disk. You can force the creation of a .pyc file on disk, if you import the file in another program. Just write a short test program with the line:

import myPyFile # converts myPyFile.py to myPyFile.pyc

You can distribute your .pyc file instead of the .py file, if you want to hide your source code a little.

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 

I use both C++ and Python and came up with this ...

My 13 point comparison of C++ and Python: 1. C++ and Python complement each other. 2. Maybe C++ is the piano and Python is the guitar. 3. C++ is a low level language and Python is a high level language (more modular). 4. You can write Python programs in just a few lines that would require pages in C++. 5. C++ requires type declarations and Python avoids type declarations. 6. Python containers are simpler and more flexible than C++ containers. 7. Python allows for easier experimentation/concept-development than C++. 8. C++ is compiled to an executable file and Python is compiled and then interpreted. 9. Python has an interactive page where you can quickly test ideas. 10. C++ is more difficult to master than Python. Python code is easier to read. 11. Both C++ and Python are object oriented. 12. Both C++ and Python work on multiple platforms (Windows, Unix, VMS etc). 13. C++ can be and Python is open source.

wow thx man python is on the list of things to do especaily if its easy to master

Gargen
Light Poster
28 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

Python is my first language I am learning, other then some bash scripting. I am really enjoying it.

I am a big open source(linux) guy, so i was attracted to python for that reason. I also like the fact I can write a program that will run on both linux and windows alike(there may be some porting issues, I am still learning)

shanenin
Posting Whiz in Training
217 posts since May 2005
Reputation Points: 10
Solved Threads: 17
 

Python is my first language I am learning, other then some bash scripting. I am really enjoying it.

I am a big open source(linux) guy, so i was attracted to python for that reason. I also like the fact I can write a program that will run on both linux and windows alike(there may be some porting issues, I am still learning)

There shouldn't be too many porting issues-- Python was designed ground-up to work with any platform. Unless you start fooling around with GTK or Tk/Tcl, etc, then you'll be in good shape. Even with the previously mentioned setups, you can still make them work in Windows.

alc6379
Cookie... That's it
Team Colleague
2,820 posts since Dec 2003
Reputation Points: 186
Solved Threads: 147
 

Not to mention that python is really easy to read. Although the lack of braces and forced indentation may seem weird to C/Java types (like I was before i ran into python) it makes it MUCH easier to tell what's going on in your code. Which is great when you have to come back to something you've done 6 months ago and wonder what the heck it was you wrote.

Kschikan
Newbie Poster
10 posts since Aug 2005
Reputation Points: 10
Solved Threads: 2
 

Well I've only ever learned two languages. HTML and Python. HTML and Python don't really compare because they do two totally different things. But I still give Python a big thumbs up it's easy to use and somewhat integratable. Just like HTML.

danizzil14
Junior Poster in Training
68 posts since Jul 2005
Reputation Points: 16
Solved Threads: 1
 

Python looks like fun.
Got some books on it and can read it pretty well, didn't spend much time on it so far (too busy with Java).

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

Every day i learn py, I see it doing many things and from what I can see, it can do anything. Anyway i plan to do my massive code for my project sometime this year! For now there are some things I must learn!!

Happy Py Programming!

evstevemd
Senior Poster
3,713 posts since Jun 2007
Reputation Points: 462
Solved Threads: 392
 

Thanks Buddy !! Much Appreciated !!

Thanks.

sahildevit
Newbie Poster
9 posts since May 2010
Reputation Points: 10
Solved Threads: 0
 

c++ rules.

Orion2k
Newbie Poster
18 posts since May 2010
Reputation Points: 4
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You