Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


Search this Thread
Old 07-05-2012, 11:07 AM   #1
Mr. Alex
Senior Member
Registered: May 2010
Distribution: Arch + + IceWM
Posts: 1,219

Rep: Reputation: Disabled
Python vs C++

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
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
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 5,486

Rep: Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719
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
LQ Veteran
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,631
Blog Entries: 1

Rep: Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062
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: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Originally Posted by Mr. Alex View Post
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
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,653

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
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.


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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

All times are GMT -5. The time now is 01:22 AM.

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