LinuxQuestions.org
Help answer threads with 0 replies.
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 06-09-2018, 02:03 PM   #16
LEON71
Member
 
Registered: May 2018
Location: Canada
Distribution: Fedora 38 Workstation
Posts: 87

Original Poster
Rep: Reputation: Disabled

Quote:
Originally Posted by ondoho View Post
unanswerable, because we don't know about your setup!
only you can answer that question!
look at what package the app belongs to, and see if that's a python program, if it depends on python etc.

why is it not enough for you to know that python is really, really important?

i mean, what would you like to do with the answer if you got one?
Just curious actually
 
Old 06-09-2018, 02:29 PM   #17
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,735

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
  1. Identify all the directories from which utilities can be/are run. For example: /usr/bin
  2. For each of those directories
Code:
grep '#!.*python' /usr/bin/*
to see a list of the utilities using python, or
Code:
grep '#!.*python' /bin/* | wc -l
to get a count of them.

Essentially, look in each file to see if it contains a #! line containing python.

There's probably a much more elegant way to do that, including looking at only the first line of each file, etc.

On my CentOS desktop, there are 119 such utilities in /usr/bin
 
2 members found this post helpful.
Old 06-10-2018, 01:10 AM   #18
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
code golf!
Code:
IFS=:; for i in $PATH; do for j in $i/*; do [[ "$(head -1 "$j")" == "#!"*python* ]] && echo "$j"; done; done 2>/dev/null | wc -l
(probably requires bash)
 
Old 06-10-2018, 03:35 AM   #19
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,930

Rep: Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321
Quote:
Originally Posted by LEON71 View Post
Just curious actually
I'm afraid, you will never get a correct answer. It depends on what is installed, what is used, and actually it will even [always] differ on two [almost] identical installations.
(and also you will never know which part of the python code found on your host was/is/will be in use).
 
1 members found this post helpful.
Old 06-11-2018, 06:24 PM   #20
LEON71
Member
 
Registered: May 2018
Location: Canada
Distribution: Fedora 38 Workstation
Posts: 87

Original Poster
Rep: Reputation: Disabled
Found below answer from another forum :

For Linux or the basic code, I would say zero.
Even the command line stuff (ls, cp cat....) are in C.

Some GUI stuff may be in C++.
dnf is, I believe in python.,

Most of gnome is in javascript. KDE is in C++ (QT based)
 
Old 06-11-2018, 08:00 PM   #21
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,784

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
Quote:
Originally Posted by LEON71 View Post

Most of gnome is in javascript. KDE is in C++ (QT based)
I don't think "most of" gnome is in javascript. As far as I know, it's primarily in C (i.e., the stuff listed in Platform libraries).
 
Old 06-12-2018, 02:00 AM   #22
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,930

Rep: Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321
Yes, I need to agree. The base system does not need python at all, just probably you won't be able to use a few tools.
If I knew well gnome is written in C or C++, but you can add panels and other dialogs, gui elements in python.
Especially there is a package python-gnome2 (for example)
 
Old 06-17-2018, 02:09 PM   #23
LEON71
Member
 
Registered: May 2018
Location: Canada
Distribution: Fedora 38 Workstation
Posts: 87

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
Yes, I need to agree. The base system does not need python at all, just probably you won't be able to use a few tools.
If I knew well gnome is written in C or C++, but you can add panels and other dialogs, gui elements in python.
Especially there is a package python-gnome2 (for example)
So we can safely assume that Fedora Distribution has dependency on Python but Python is not directly used in as a programming language?
 
Old 06-17-2018, 11:38 PM   #24
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by LEON71 View Post
So we can safely assume that Fedora Distribution has dependency on Python but Python is not directly used in as a programming language?
that is correct.
but not safe to assume.
 
Old 06-17-2018, 11:44 PM   #25
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,242

Rep: Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322
Not sure how the language used to write Yum and DNF could be described as "not directly used", but whatever.
 
Old 06-24-2018, 09:05 AM   #26
LEON71
Member
 
Registered: May 2018
Location: Canada
Distribution: Fedora 38 Workstation
Posts: 87

Original Poster
Rep: Reputation: Disabled
One of the group member of fedora forum said that :

I would have to say that most of the Fedora/Redhat written applications are written in Python. I am pretty sure that anaconda (The installer application) was written in Python. I believe firewalld is Python as well.
 
Old 07-04-2018, 06:12 AM   #27
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
too much.
 
2 members found this post helpful.
  


Reply

Tags
fedora 25, python based



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
[SOLVED] NEED HELP! Want to code PERL and Python on VS Code on Fedora KDE 27 GHOSTIN7HESHELL Linux - Software 13 02-15-2018 05:00 PM
[SOLVED] Learning Python, how should I implement the following problem in Python 3 code? rblampain Programming 8 05-29-2016 10:53 AM
[SOLVED] Can anyone help with editing some python code? gary_in_springhill Programming 1 01-27-2010 03:48 PM
PYTHON ! please help me with one little code topheraholic Programming 9 11-13-2009 10:36 PM
python,somebody help me with one little code, thanks very much. topheraholic Programming 5 11-06-2009 08:53 PM

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

All times are GMT -5. The time now is 02:59 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