CaptureSingleFrameTo error

Discussions on extending SharpCap using the built in Python scripting functionality
Post Reply
denjoan
Posts: 5
Joined: Sat Jan 27, 2018 2:10 am

CaptureSingleFrameTo error

#1

Post by denjoan »

When I execute the following command:
SharpCap.SelectedCamera.CaptureSingleFrameTo("c:\test.fits")

I get the error message:
Path must be an absolute path

Not sure why I get this message.

Thank you.

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

Re: CaptureSingleFrameTo error

#2

Post by admin »

Hi,

I think that the python language is interpreting 'c:\test.fits' as 'c:<tab>est.fits' since '\t' is the way to put a tab in a python string. Try 'c:\\test.fits' - I think that's the right way to do it.

cheers,

Robin
denjoan
Posts: 5
Joined: Sat Jan 27, 2018 2:10 am

Re: CaptureSingleFrameTo error

#3

Post by denjoan »

Hi Robin,

Actually, I found that if "/" is used instead of "\", it works - must be a Windows file naming thing.

Thanks anyway for your response.

Dennis
denjoan
Posts: 5
Joined: Sat Jan 27, 2018 2:10 am

Re: CaptureSingleFrameTo error

#4

Post by denjoan »

Hi Robin,

BTW: your suggestion works as well.

Dennis
Post Reply