-
Install:
pip install hexss --break-system-packages
-
Using a proxy server (if needed):
- If you need to use a proxy, use the following command format:
pip install hexss --break-system-packages --proxy=http://150.61.8.70:10086
- Configure hexss proxy:
hexss config proxies.http http://150.61.8.70:10086 hexss config proxies.https http://150.61.8.70:10086
- If you need to use a proxy, use the following command format:
-
-
Add PATH (if required):
export PATH=$PATH:/home/pi/.local/bin
-
Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate -
Install hexss:
pip install hexss
-
Using a proxy server (if needed):
pip install hexss --proxy=http://150.61.8.70:10086
-
-
Install:
pip install hexss
-
Using a proxy server (if needed):
pip install hexss --proxy=http://150.61.8.70:10086
-
Configure hexss proxy:
hexss config proxies.http http://150.61.8.70:10086 hexss config proxies.https http://150.61.8.70:10086
-
-
Create and activate a virtual environment:
python -m venv .venv .venv\Scripts\activate
-
Install hexss:
pip install hexss
-
Using a proxy server (if needed):
pip install hexss --proxy=http://150.61.8.70:10086
-
-
Camera Server:
Start the camera server by running:hexss camera_server
-
File Manager Server:
Start the file manager server by running:hexss file_manager_server
Check if required packages are installed and optionally install them automatically:
import hexss
# Check a single package
hexss.check_packages('numpy')
# Check multiple packages and auto-install if necessary
hexss.check_packages('numpy', 'opencv-python', 'googletrans==4.0.0rc1', auto_install=True)
import numpy
import cv2
import googletrans
# Your code continues here...Below is an example demonstrating how to use the hexss package to manage multithreaded tasks:
import time
from hexss.threading import Multithread
import random
def task1(data):
while data.get('play'):
print('Task 1, random number')
data['number'] = random.randint(0, 99)
time.sleep(1)
def task2(data):
while data.get('play'):
print(f"Task 2, show number; number = {data.get('number')}")
time.sleep(1)
def main():
m = Multithread()
data = {
'play': True,
'number': 0,
}
m.add_func(task1, args=(data,), name="Random Number")
m.add_func(task2, args=(data,), name="Show Number")
m.start()
try:
while data['play']:
time.sleep(1)
except KeyboardInterrupt:
print("\nShutting down...")
finally:
data['play'] = False
m.join()
if __name__ == '__main__':
main()In this example:
- Task 1 generates a random number every second and updates the shared data dictionary.
- Task 2 reads the random number from the dictionary and prints it every second.
- The
Multithreadclass manages the concurrent execution of these tasks.
Contributions are welcome!
If you encounter any issues or have suggestions, please open an issue or submit
a pull request.
This project is licensed under the MIT License.
For any questions or support, please contact hexs.
Happy coding!
