A simple terminal for performing mathematical calculations.
Currently under development...
There are two ways to install CWMathConsole:
Details are not extensively covered here. You can directly download the ready-to-use executable file.
This will be uploaded once the author has completed a portion of the functionality.
For the latest version of the files, consider Method 2.
This method involves directly cloning the repository and then compiling it for either running or packaging.
Using this method requires having the necessary runtime environment and compiler.
First, clone the repository:
git clone https://github.com/10chen01/CWMathConsole.git
cd CWMathConsole
Then install the environment and compile:
pip install -r requirements.txt
You can use Tsinghua's mirror to increase download speed:
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
Alternatively, manually install the following packages:
sympy
latex2sympy2
Compile the program using Python.
Note
python ./cwconsole.py
First, you need to install pyinstaller
.
# python package
pip install pyinstaller
# anaconda
conda install pyinstaller
Then use pyinstaller
to package the software.
pyinstaller.exe -F cwconsole.py
This will yield the executable version of CWMathConsole.
After downloading, you can add CWMathConsole to your PATH for easy access.
CWMathConsole is a simple math terminal that offers several commands for calculations.
CWMathConsole commands are case-sensitive and must always be in lowercase by default.
CWMathConsole commands are separated by spaces into a linked list, where the first item is the main command, and the following items are known as arguments.
The detailed usage of commands is generally specified upon invocation.
CWMathConsole uses latex2sympy2
to read and output mathematical expressions, so mathematical expressions within CWMathConsole are typically written in LaTeX format as the language of expression.
When using symbols, it is recommended to use single Latin characters or the Latin transliteration of Greek characters instead; avoid using combinations of multiple Latin characters such as destruction
, as this symbol will be interpreted by latex2sympy2 as the product of several Latin characters!
Get help information.
Exit CWMathConsole.
Define a variable or function
Parameters:
var
/variable
: Define a variablefunc
/function
: Define a function
Reassign a variable or function.
Remove a variable or function.
Evaluate the value of an expression, which will output both the simplified form of the expression and its value.
Plot the graph of a function (currently based on turtle).
It can plot the rect/polar functions's graph on turtle panel.
Solve equations, capable of solving single equations/systems of equations and inequalities/systems of inequalities.
Parameters:
once
: Indicates solving a single equationmulti
: Indicates solving a system of equations
The pyrun
command supports running a segment of Python code, allowing you to solve problems with Python code.
pyrun
uses exec
/eval
implementation, but on certain platforms, there is no corresponding exec
and eval
implementation, thus the pyrun
command is marked as an Extend Version
exclusive command.
pyrun file
can also execute code from a file, also using exec
for execution.
Directly using pyrun
will put CWMathConsole into Pyshell mode, and the command prompt will change from cw:>
to pyshell:>>
.
In Pyshell mode, you can exit by using [CWConsole]
.