Unix/Linux Go Back    


Programming Post questions about C, C++, Java, SQL, and other programming languages here.

A straightforward Python question.

Programming


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 04-17-2017   -   Original Discussion by wisecracker
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 20 January 2018, 7:22 PM EST
Location: Loughborough
Posts: 1,240
Thanks: 372
Thanked 326 Times in 256 Posts
A straightforward Python question.

Hi all...

Simple yes or no answer question for the big guns with a qualifier if YES.

I can possibly do FFT for my needs in AudioScope using python.

Q: Is python now considered part of the /usr/bin or other command paths for ALL current *NIX style OSes?

IF YES which version(s) should I go to?
A: Python 2.7.x <- current OSX 10.12.x.

OR

B: Python 3.x.x

(Perl can also do it but I am brain dead to Perl.)


TIA...
Sponsored Links
    #2  
Old Unix and Linux 04-17-2017   -   Original Discussion by wisecracker
jim mcnamara's Unix or Linux Image
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 15 January 2018, 9:34 AM EST
Location: NM
Posts: 11,284
Thanks: 581
Thanked 1,127 Times in 1,038 Posts
IF I understand: no. Python is not a standard part of some UNIX packages, you have to add it on later. Solaris 10 is an example.

And if python is out there already it may well be 2.7. FFT algorithms in perl are absolutely all over the place on the net. You could certainly find one to use close to as is.

A google for 'fft perl example' finds lots of code. perl has had it in MATH:: since 2002.
Note: there are linux distributions like DSL that have almost nothing extra, just bash and gcc and c runtime. No perl, no python.

IMO your question may not be so easy to answer well. Your perl assumption has problems.

You can do some math in shell only -

:: phodd.net :: GNU bc FAQ ::
The Following User Says Thank You to jim mcnamara For This Useful Post:
wisecracker (04-18-2017)
Sponsored Links
    #3  
Old Unix and Linux 04-18-2017   -   Original Discussion by wisecracker
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 20 January 2018, 7:22 PM EST
Location: Loughborough
Posts: 1,240
Thanks: 372
Thanked 326 Times in 256 Posts
Hi JM...

Hmmm, I thought not.

I have searched high and low for a demo awk version as I assume awk IS part of any default *NIX like flavour. I can't find one so........

Instead I will at least try to create one.

If successful I will post it on here.

Thanks for your time.

(It is relatively easy in Python.)

Bazza.
    #4  
Old Unix and Linux 04-18-2017   -   Original Discussion by wisecracker
jim mcnamara's Unix or Linux Image
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 15 January 2018, 9:34 AM EST
Location: NM
Posts: 11,284
Thanks: 581
Thanked 1,127 Times in 1,038 Posts
Consider the phedd link - there are a lot of sites with command line bc formulas, for example fft solutions. bc originally was meant to do extended precision floating point from extensive scripts, as well as one-off fp math operations. Don't sell it short.

If you want portability and you do not want to have to verify/install perl's MATH:: for every UNIX installation, bc is the correct approach, IMO.
Sponsored Links
    #5  
Old Unix and Linux 04-18-2017   -   Original Discussion by wisecracker
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 20 January 2018, 7:22 PM EST
Location: Loughborough
Posts: 1,240
Thanks: 372
Thanked 326 Times in 256 Posts
Hi JM...

I can't use 'ksh', 'bc' or 'dc' for floating point stuff as CygWin does not have them as of the current release.

It also does not have Python or Perl but DOES have AWK by default.

I have a working FFT demo using Python 2.7.x but it needs a thorough shakeup before I make a text mode AF Spec-An. I will not be using this inside AudioScope.
I haven't worked out how to get a bash array into a Numpy array yet without using a file but it won't be long. A little further thought is needed for an alternative approach.

Many thanks.

Bazza.
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Question about Strings in Python mohtashims Shell Programming and Scripting 1 05-17-2016 05:39 PM
Python question cstsang Shell Programming and Scripting 1 07-07-2014 06:26 AM
Capslock and Python Question mrm5102 UNIX for Dummies Questions & Answers 0 06-30-2014 04:26 PM
modify ls -l (long listing format output) strictly using SED only straightforward goalhard 4 me doh wolf@=NK Shell Programming and Scripting 1 06-12-2012 10:15 PM
NEWBIE QUESTION: python 3 or 2.6.x guptaxpn Programming 2 12-16-2008 12:04 AM



All times are GMT -4. The time now is 09:02 PM.