File tree Expand file tree Collapse file tree 4 files changed +19
-27
lines changed
Expand file tree Collapse file tree 4 files changed +19
-27
lines changed Original file line number Diff line number Diff line change 11test.py
2- bin
2+ bin
3+ build
4+ dist
5+ search.spec
Original file line number Diff line number Diff line change 44QuickOverflow : main.c
55 pip3 install -r requirements.txt --break-system-packages
66 mkdir -p bin
7- gcc -I/usr/include/python3.12 main.c -lpython3.12 -o bin/QuickOverflow
7+ sudo gcc main.c -o /usr/local/ bin/QuickOverflow
88 chmod +x search.py
9+ pyinstaller search.py --onefile
10+ sudo mv " dist/search" " /usr/local/bin"
911
1012arch_linux : main.c
1113 sudo pacman -S gcc
12- sudo pacman -S fakeroot
13- sudo pacman -S yay
14+ sudo gcc main.c -o /usr/local/bin/QuickOverflow
15+ chmod +x search.py
1416 sudo pacman -S python-pipenv
15- pipenv install --python 3.12
17+ sudo pacman -S pyenv
18+ pipenv install --python 3.13
1619 pipenv shell
1720 pip3 install -r requirements.txt
18- mkdir -p bin
19- gcc -I/usr/include/python3.12 main.c -lpython3.12 -o bin/QuickOverflow
20- chmod +x search.py
21+ pyinstaller search.py --onefile
22+ sudo mv " dist/search" " /usr/local/bin"
2123
2224# to remove the binaries, use this
2325uninstall :
Original file line number Diff line number Diff line change 1111 ****************************************************/
1212
1313
14- //including python header for calling python scripts
15- #include <Python.h>
14+
1615
1716#ifndef COMMANDS_H
1817#define COMMANDS_H
@@ -75,22 +74,9 @@ int quickoverflow_cd(char **args)
7574int quickoverflow_search (char * * args )
7675{
7776
78- int argc = 0 ;
79- while (args [argc ] != NULL ) {
80- argc ++ ;
81- }
82-
83- // Initialize the Python interpreter.
84- Py_Initialize ();
85- FILE * fp = fopen ("search.py" , "r" );
86- if (fp == NULL ) {
87- perror ("QuickOverFlowFileNotFoundError: Have you deleted search.py by any chance?" );
88- return 1 ;
89- }
90- PyRun_SimpleFile (fp , "search.py" );
91- fclose (fp );
92-
93- //Update 2.0.0 removed Py_Finalise to avoid segmentation faults
77+ //Update 3.0.0 - Removed Python API and enabled directly calling from anywhere in the OS
78+ //Now uses PyInstaller to generate Python Executable to run anywhere
79+ system ("search" );
9480
9581 return 1 ;
9682}
Original file line number Diff line number Diff line change 1- pyoverflow3
1+ pyoverflow3
2+ pyinstaller
You can’t perform that action at this time.
0 commit comments