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 09-16-2012, 02:18 PM   #1
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Rep: Reputation: Disabled
Python language, its functions and libraries


Hi.

Python has lots of libs which you can include with "import", right? And the language itself has about 250 functions. Are all those libs for Python also written with pure Python and it's 250 functions?
 
Old 09-16-2012, 02:25 PM   #2
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
No. Many are written partly in C.

Last edited by dugan; 09-16-2012 at 02:27 PM.
 
1 members found this post helpful.
Old 09-16-2012, 03:52 PM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Many of the Python libraries you speak of are nothing more than wrappers for C/C++ libraries (called Python bindings), for example pygame is a binding to SDL, .
Also, it is common practice in Python to write modules in C for better performance, which then are used in Python programs, like NumPy.
 
1 members found this post helpful.
Old 09-17-2012, 08:08 AM   #4
nileshgr
Member
 
Registered: Aug 2007
Location: Pune, Maharashtra, India
Distribution: Gentoo
Posts: 84

Rep: Reputation: 16
Just a tip in along the same lines: check out Swig if you're interested in writing C/C++ extensions for Python, and other dynamic languages.
 
1 members found this post helpful.
Old 09-17-2012, 10:50 AM   #5
vxc69
Member
 
Registered: Jul 2004
Distribution: Ubuntu
Posts: 387

Rep: Reputation: 33
I love Python. It's a great language and the community behind its vast number of libraries tend to write more robust libraries, in comparison to another scripting language I am familiar with: PHP.

But nothing beats C (and to a certain extent Java nowadays) for its speed. But then languages like Python can be used to build things much faster than with Java or C, and Python has amazing bindings to some of those more complex libraries you find in C/Java.

Something I've found out recently is the Kivy library for python that allows you to code cross platform GUIs including for the smartphone OS's! So you get to write code much faster and also use the more powerful C libraries underneath the hood.
 
2 members found this post helpful.
  


Reply



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 functions help! dale504 Linux - Newbie 1 04-18-2009 06:49 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, making new functions part of the language? raskol Programming 1 04-01-2008 09:58 AM
Make libraries call their own functions Millenniumman Programming 6 06-21-2007 01:16 AM
Exported functions from C shared libraries tim_l Programming 4 05-25-2004 09:06 AM

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

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

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