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...

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 ::

1 Like

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.

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.

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.