LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-05-2012, 11:07 AM   #1
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Rep: Reputation: Disabled
Python vs C++


Hi.
Is there anything that can be done in C++ and can't be done in Python bacause Python is so high-level and C++ is not?
 
Old 07-05-2012, 11:19 AM   #2
silendo
Member
 
Registered: Jun 2012
Location: Italy
Distribution: Slackware 13.37
Posts: 45

Rep: Reputation: Disabled
Hello boy, python and c++ are similar and you can done identical here. In the python there are graphical libraries how in the C++.
Python is multiplatform interpreter (it's work also on the smartphone) while C++ isn't work.
I like python for the fast and simple applications
 
Old 07-05-2012, 11:20 AM   #3
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,223

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Yes there are.

Oh, you wanted examples? Using QML to write your Qt applications is the the first thing that comes to mind.

Last edited by dugan; 07-05-2012 at 11:26 AM.
 
1 members found this post helpful.
Old 07-05-2012, 11:29 AM   #4
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Python is an interpreted language and tends to run slower than C++ (compiled language) but it's easier to code and takes less code to accomplish the same thing. As far as python's slowness is concerned, PyPy (which is faster than CPython, ie the standard Python) is slowly gaining popularity.
 
Old 07-05-2012, 12:10 PM   #5
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by Mr. Alex View Post
Hi.
Is there anything that can be done in C++ and can't be done in Python ...

Sure - you can take a pointer in C++ and can not in Python.

And, AFAIK, Python doesn't have static polymorphism.
 
1 members found this post helpful.
Old 07-06-2012, 09:08 AM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940
Typically, languages such as Python work in tandem with low-level tools such as C/C++. You are given "a nice, fuzzy, easy-to-use Python library" which, as it so happens, invokes lower-level C/C++ code and external libraries to do the heavy lifting. Meanwhile, for everything else that you need to do, Python itself (which is, of course, also a large and sophisticated C/C++ program ...) is fast-enough, efficient, and readily available.

In this scenario, C/C++ becomes a more specialized tool: used to construct higher-level languages such as Python itself; and used to implement specific, targeted functionality (in the form of libraries and subroutines accessible to the higher-level language tools). In this way, you play to each language's respective strengths (and designs), with no significant loss in computer efficiency (but considerable gains in far-more-expensive human efficiency). So, it's simply not a "versus" issue at all.

Q: Scalpel vs. chain-saw?
A: Well, it depends on exactly what it is you are trying to cut ...

Last edited by sundialsvcs; 07-06-2012 at 09:09 AM.
 
2 members found this post helpful.
  


Reply

Tags
c++, high-level, low-level, python



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Python 2.6 dependencies error installing python-sqlite2-2.5.5-1.1.i586.rpm jmp007 Linux - Newbie 1 02-11-2011 11:05 AM
LXer: Python Python Python (aka Python 3) LXer Syndicated Linux News 0 08-05-2009 08:30 PM
LXer: Review: Programming in Python 3: A Complete Introduction to the Python Language LXer Syndicated Linux News 0 01-26-2009 04:50 AM
python update - Unable to load GTK2 Python bindings: No module named gtk itpedersen Linux - Software 2 10-03-2008 03:44 AM
LXer: Move to python 2.4 / Changing the packaging style for python packages LXer Syndicated Linux News 0 06-13-2006 07:54 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration