Noob interactive help problem

Discussions on extending SharpCap using the built in Python scripting functionality
Post Reply
FlankerOneTwo
Posts: 6
Joined: Sun Feb 25, 2024 6:14 pm

Noob interactive help problem

#1

Post by FlankerOneTwo »

Hi all,

New to SharpCap scripting, thought I'd get started browsing through the interactive help in the Python Console. however typing help() results in the following error:
help> Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Files\SharpCap 4.1 (64 bit)\PythonLib.zip\_sitebuiltins.py", line 103, in __call__
File "C:\Program Files\SharpCap 4.1 (64 bit)\PythonLib.zip\pydoc.py", line 1846, in __call__
File "C:\Program Files\SharpCap 4.1 (64 bit)\PythonLib.zip\pydoc.py", line 1858, in interact
File "C:\Program Files\SharpCap 4.1 (64 bit)\PythonLib.zip\pydoc.py", line 1869, in getline
LookupError: unknown encoding: codepage___0
>>>

I've uninstalled and reinstalled, same result. Running the most recent release 4.1.11804, 64-bit with Pro license. Not sure if I've screwed something up or what. Script commands such as opening a camera, etc seem to work fine so I'm not sure what the problem is.

Thanks for helping out a noob!

-Patrick
User avatar
admin
Site Admin
Posts: 13348
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Noob interactive help problem

#2

Post by admin »

Hi Patrick,

I see the same when just running 'help()' at the console, however, I do get useful results when running either of

Code: Select all

helpme() # SharpCap's brief getting started help
help(SharpCap) # Help on the properties/methods of the global 'SharpCap' object

hope this helps,

Robin
FlankerOneTwo
Posts: 6
Joined: Sun Feb 25, 2024 6:14 pm

Re: Noob interactive help problem

#3

Post by FlankerOneTwo »

Hi,

Those commands appear to work fine for me as well, I was a little concerned that somehow the install had become corrupted. Apparently I was misled by the startup prompt "Type "help", <...> for more information". Typing "help" results in "Type help() for interactive help, or help(object) <...>"

I guess I'll just script on and not worry about it. Thanks!
User avatar
admin
Site Admin
Posts: 13348
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Noob interactive help problem

#4

Post by admin »

Hi,

actually, looking at the error again, I think the root cause of it may be that the SharpCap Python environment does *not* support python code reading input from the terminal, which help tries to do. If you try to run

Code: Select all

x = input()
then you get the same 'Codepage 0' error. Since it can't read input from the terminal, the 'interactive' help doesn't work, but you can still use help(object).

I did look into supporting input() in the python console code - it turned out to be surprisingly complex for what is really quite a niche use case, so I didn't end up doing it.

cheers,

Robin
Post Reply