How to find any documentation for smbus?

2023-10-30 Thread Chris Green via Python-list
I am using the python3 smbus module, but it's hard work because of the
lack of documentation.  Web searches confirm that the documentation is
somewhat thin!

If you do the obvious this is what you get:-

>>> import smbus
>>> dir (smbus)
['SMBus', '__doc__', '__file__', '__loader__', '__name__', '__package__', 
'__spec__']
>>> help(smbus)


Help on module SMBus:

NAME
SMBus

DESCRIPTION
This module defines an object type that allows SMBus transactions
on hosts running the Linux kernel.  The host kernel must have I2C
support, I2C device interface support, and a bus adapter driver.
All of these can be either built-in to the kernel, or loaded from
modules.

Because the I2C device interface is opened R/W, users of this
module usually must have root permissions.

FILE
/usr/lib/python3/dist-packages/smbus.cpython-39-arm-linux-gnueabihf.so


Even a list of available methods would be handy! :-)


Presumably python3's smbus is just a wrapper so if I could find the underlying 
C/C++
documentation it might help.

-- 
Chris Green
·
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to find any documentation for smbus?

2023-10-30 Thread Chris Green via Python-list
km  wrote:
> Il Sat, 28 Oct 2023 17:08:00 +0100, Chris Green ha scritto:
> 
> > I am using the python3 smbus module, but it's hard work because of the
> > lack of documentation.  Web searches confirm that the documentation is
> > somewhat thin!
> > 
> > If you do the obvious this is what you get:-
> > 
> > >>> import smbus dir (smbus)
> > ['SMBus', '__doc__', '__file__', '__loader__', '__name__',
> > '__package__', '__spec__']
> > >>> help(smbus)
> > 
> > 
> > Help on module SMBus:
> > 
> > NAME
> > SMBus
> > 
> > DESCRIPTION
> > This module defines an object type that allows SMBus
> > transactions on hosts running the Linux kernel.  The host kernel
> > must have I2C support, I2C device interface support, and a bus
> > adapter driver.
> > All of these can be either built-in to the kernel, or loaded
> > from modules.
> > 
> > Because the I2C device interface is opened R/W, users of this
> > module usually must have root permissions.
> > 
> > FILE
> > /usr/lib/python3/dist-packages/smbus.cpython-39-arm-linux-
> gnueabihf.so
> > 
> > 
> > Even a list of available methods would be handy! :-)
> > 
> > 
> > Presumably python3's smbus is just a wrapper so if I could find the
> > underlying C/C++
> > documentation it might help.
> 
> https://pypi.org/project/smbus2/
> 
> smbus2 is designed to be a "drop-in replacement of smbus". SO you can look 
> at its documentation for or use it instead of smbus.
> 
> Disclaimer: I haven't any experience on this library

Ah, thank you, I had come across smbus2 but wanted to stay with smbus
if I could as it's in the Debian repositories.  However, as you say,
it claims to be a "drop-in replacement of smbus" so the documentation
should be some help at least.

-- 
Chris Green
·
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to find any documentation for smbus?

2023-10-30 Thread km via Python-list
Il Sat, 28 Oct 2023 17:08:00 +0100, Chris Green ha scritto:

> I am using the python3 smbus module, but it's hard work because of the
> lack of documentation.  Web searches confirm that the documentation is
> somewhat thin!
> 
> If you do the obvious this is what you get:-
> 
> >>> import smbus dir (smbus)
> ['SMBus', '__doc__', '__file__', '__loader__', '__name__',
> '__package__', '__spec__']
> >>> help(smbus)
> 
> 
> Help on module SMBus:
> 
> NAME
> SMBus
> 
> DESCRIPTION
> This module defines an object type that allows SMBus
> transactions on hosts running the Linux kernel.  The host kernel
> must have I2C support, I2C device interface support, and a bus
> adapter driver.
> All of these can be either built-in to the kernel, or loaded
> from modules.
> 
> Because the I2C device interface is opened R/W, users of this
> module usually must have root permissions.
> 
> FILE
> /usr/lib/python3/dist-packages/smbus.cpython-39-arm-linux-
gnueabihf.so
> 
> 
> Even a list of available methods would be handy! :-)
> 
> 
> Presumably python3's smbus is just a wrapper so if I could find the
> underlying C/C++
> documentation it might help.

https://pypi.org/project/smbus2/

smbus2 is designed to be a "drop-in replacement of smbus". SO you can look 
at its documentation for or use it instead of smbus.

Disclaimer: I haven't any experience on this library
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to find any documentation for smbus?

2023-10-30 Thread Chris Green via Python-list
Dan Purgert  wrote:
> On 2023-10-28, Chris Green wrote:
> > I am using the python3 smbus module, but it's hard work because of the
> > lack of documentation.  Web searches confirm that the documentation is
> > somewhat thin!
> >
> 
> The SMBus spec is available from http://smbus.org (or at least it used
> to be ... watch it be hidden behind a paywall now).
> 
That provides very detailed hardware information but virtually nothing
at all about software libraries and such.  Lots of interesting
reading, for example there's an appendix detailing the differences
between smbus and i2c, but nothing very helpful for a poor old
application programmer like me! :-)

-- 
Chris Green
·
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to find any documentation for smbus?

2023-10-30 Thread Dieter Maurer via Python-list
Chris Green wrote at 2023-10-28 17:08 +0100:
>I am using the python3 smbus module, but it's hard work because of the
>lack of documentation.  Web searches confirm that the documentation is
>somewhat thin!
>
>If you do the obvious this is what you get:-
>
>>>> import smbus
>>>> dir (smbus)
>['SMBus', '__doc__', '__file__', '__loader__', '__name__', '__package__', 
> '__spec__']
>>>> help(smbus)
> ...

What does `help(smbus.SMBus`) tell you?

Almost surely, `SMBus` is a class providing the main access methods.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PyInstaller value error: Invalid Windows resource specifier

2023-10-30 Thread MRAB via Python-list

On 2023-10-30 19:19, McDermott Family via Python-list wrote:

Hello, I am trying to create a one file executable with pyinstaller 6.1.0
and auto-py-to-exe 2.41.0 using Python version 3.10.9 in a virtual
environment.

Some points before the output of pinstaller is shown. My resource .py file
is there where it should be. Also I can fun my program from the command-line


and it does work with the compiled resource file without a problem. Any help
would be greatly appreciated. Thank you.


Running auto-py-to-exe v2.41.0

Building directory: C:\Users\icnte\AppData\Local\Temp\tmpp870eytg

Provided command: pyinstaller --noconfirm --onefile --windowed --icon
"D:/Work/Python/cfepy310/xl/cfegui/Resources/Conform-e_48_1.ico" --name
"Conform-e" --clean --log-level "DEBUG" --debug "all" --version-file
"D:/Work/Python/cfepy310/xl/cfegui/cfe_versionfile.txt" --resource
"D:/Work/Python/cfepy310/xl/cfegui/cfe_Resource_rc.py"
"D:/Work/Python/cfepy310/xl/cfegui/cfe_MainForm.py"

Recursion Limit is set to 5000

Executing: pyinstaller --noconfirm --onefile --windowed --icon
D:/Work/Python/cfepy310/xl/cfegui/Resources/Conform-e_48_1.ico --name
Conform-e --clean --log-level DEBUG --debug all --version-file
D:/Work/Python/cfepy310/xl/cfegui/cfe_versionfile.txt --resource
D:/Work/Python/cfepy310/xl/cfegui/cfe_Resource_rc.py
D:/Work/Python/cfepy310/xl/cfegui/cfe_MainForm.py --distpath
C:\Users\icnte\AppData\Local\Temp\tmpp870eytg\application --workpath
C:\Users\icnte\AppData\Local\Temp\tmpp870eytg\build --specpath
C:\Users\icnte\AppData\Local\Temp\tmpp870eytg


[snip]


ValueError: Invalid Windows resource specifier
'D:WorkPythoncfepy310xlcfeguicfe_Resource_rc.py'!
For arbitrary data file, the format is 'filename,type,name,[language]'!

  


Project output will not be moved to output folder

Complete.


In the docs for "--resource" it says:

"""FILE can be a data file or an exe/dll. For data files, at least TYPE 
and NAME must be specified."""


That might be the problem, but I haven't been able to find out what 
"TYPE" means!


I also wonder whether "--add-data" would work.

--
https://mail.python.org/mailman/listinfo/python-list