Apr-24-2020, 07:38 AM
I'm trying to re-learn python after a 15 year break (I was only ever a very new novice!).
I'm working through an old program I wrote, and - embarrassingly - I understand it all except for one section (lines 7-9).
What's it looking for when it's trying to find '\0' ?
(If it said .find('\n') I would understand it was looking for the end of a line).
Thank you,
Steve
I'm working through an old program I wrote, and - embarrassingly - I understand it all except for one section (lines 7-9).
import win32clipboard as w w.OpenClipboard() data=w.GetClipboardData() w.CloseClipboard() nullIndex=data.find('\0') if nullIndex != -1: data=data[:nullIndex]This part of the program monitors the clipboard and checks if the data has changed from the last time it checked.
What's it looking for when it's trying to find '\0' ?
(If it said .find('\n') I would understand it was looking for the end of a line).
Thank you,
Steve