I need advice. I'm writing a calculator; I've got the basic functionality of it down, and have finally moved to having it process functions. In this regard, I find the standard library of mathematical functions provided by Python unsatisfactory. While the more commonly used functions are defined, some of the more obscure functions lack proper mention. Examples of this include the arc hyperbolic cotangent, arc hyperbolic cosecant, hyperbolic cosecant, secant, etc. While some of these are just manipulations of the functions provided, it seems the better alternative would be to provide our definitions and refer the program to those when it encounters them. This is where my question lies. Should I just define these functions in the main script, or should I use a separate file? If I the latter, how do I make reference to the separate file? I am relatively new to Python, so if I'm missing a common technique or something, please do let me know. Thanks in advance.
Thisisnotanid
0
Junior Poster in Training
Recommended Answers
Jump to PostYou could first install the numpy and scipy modules which contain many special functions.
To answer tour second question, you want to write a separate module containing your own special functions. For example write a mymathfuncs.py file containing
# mymathfuncs.py import numpy def …
All 4 Replies
Gribouillis
1,391
Programming Explorer
Team Colleague
TrustyTony
888
pyMod
Team Colleague
Featured Poster
Thisisnotanid
0
Junior Poster in Training
Thisisnotanid
0
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.