Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use these methods? #1

Open
wowfee opened this issue Oct 29, 2019 · 2 comments
Open

How to use these methods? #1

wowfee opened this issue Oct 29, 2019 · 2 comments

Comments

@wowfee
Copy link

wowfee commented Oct 29, 2019

hello,after installed the statux by pip,how could i use it? could you please give me some advices?

@Arg0s1080
Copy link
Owner

Hi,

Use is usual with any python module. You can copy any example from the "examples" folder and test all methods described in README

For example:

sudo -H pip install statux

Using python interpreter:

yourname@yourdomain:~$ python3

>>> from statux.battery import wear_level, voltage
>>> print(str(wear_level()) + "% wear")
14.58% wear

>>> from statux.cpu import physical_cpus
>>> physical_cpus()
6

If you need more help I need you to be more specific please. Which module do you need to use?

Regards

@GanesanGuru
Copy link

Hi fellas, Whether it works in Raspberry Pi? I've got the following error!!

pi@raspberrypi:~/Desktop $ python3 battery.py
Traceback (most recent call last):
File "battery.py", line 5, in
print(str(wear_level()) + "% wear")
File "/home/pi/.local/lib/python3.7/site-packages/statux/battery.py", line 54, in wrapper
raise ValueNotFoundError(get_name(), _PTH, err_no=error, msg=msg)
statux._errors.ValueNotFoundError: [Errno 42] No message of desired type: join() argument must be str or bytes, not 'NoneType': '/sys/class/power_supply/'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants