>> >>> i = long(-1972144115) & 0x
>
> Ah, thanks. I've never had a need to to bit manipulation in Python (or in
For anyone interested, my new OS topic has a section on bitwise
operations in Python - they are needed for checking stat flags...
(see the sig for the link)
Alan G
Author of
On Wed, 4 Jan 2006, Kent Johnson wrote:
> To get the desired representation, you have to find a way to make Python
> interpret the number as an unsigned integer. One way to do this is to
> convert it to a long integer, then mask off the sign bits:
> >>> i = long(-1972144115) & 0x
Ah,
Terry Carroll wrote:
> I'm assuming you want the same serial # that shows up when you do a
> DIR on the CD, e.g.:
>
> >dir d:
>Volume in drive D is 050512_1752
>Volume Serial Number is 8A73-780D
>
> Here's some code:
>
>
import win32api
CD_Info = win32api.GetVolumeInformation
On Wed, 4 Jan 2006, John Fouhy wrote:
> On 04/01/06, Terry Carroll <[EMAIL PROTECTED]> wrote:
> > I hope someone more artful than I can show a quick and easy way to convert
> > either '758C87F3' or -1972144115 to the '8A73780D' that is your goal.
>
> Hmm, well,
>
> >>> i = -1972144115
> >>> '%X
On 04/01/06, Terry Carroll <[EMAIL PROTECTED]> wrote:
> I hope someone more artful than I can show a quick and easy way to convert
> either '758C87F3' or -1972144115 to the '8A73780D' that is your goal.
Hmm, well,
>>> i = -1972144115
>>> '%X' % (pow(2, 32)-(~i+1))
'8A73780D'
Although my bitwise
On Tue, 3 Jan 2006, Ron Speerstra wrote:
> my question: howtoo read the HD/CD/DVD serial-numbers with Python.
I can take you part-way there, at least under Windows. Hopefully
someone can finish the job.
I'm assuming you want the same serial # that shows up when you do a
DIR on the CD, e.g.:
On 04/01/06, Ron Speerstra <[EMAIL PROTECTED]> wrote:
> my question: howtoo read the HD/CD/DVD serial-numbers with Python.
> Volume-name, dir name, file name. no problem etc
Are you running Microsoft Windows? If so, are any of the scripts at
http://www.microsoft.com/technet/scriptcenter/scripts/p
Hi, M-list, my name Ron Speerstra(the Netherlands)
my question: howtoo read the HD/CD/DVD serial-numbers with Python.
Volume-name, dir name, file name. no problem etc.
Gr Ron$
_
Vind alles terug op je PC: MSN Search Toolbar http:/