[python-win32] syntax?
Alex Hall
mehgcap at gmail.com
Sat Jan 16 01:26:17 CET 2010
Hi all
I am getting a "syntax error" on the line
def sayUsedRam():
and I am not sure why. Nothing is wrong with that line, but I was playing
with the preceeding function when this started happening. Does anyone see
anything obvious about these two functions that would cause an error? I do
not always trust errors with line numbers to give me the right line number.
Thanks in advance for any help.
def sayLoad():
i=0
#get proc load, currently only first core for some reason
load=[]
for p in c.Win32_PerfFormattedData_PerfOS_Processor():
load.push(p.PercentProcessorTime)
#speaker.say(str(load))
i=i+1
#end for
speaker.say(str(load[0])+", "+str(load[1])
#end def
def sayUsedRam():
#get total ram and ram available
#then speak used ram as a percent, rounded to 1 place
for info in c.Win32_OperatingSystem():
ram=info.TotalVisibleMemorySize
freeRam=info.FreePhysicalMemory
#end for
#speaker.say(toBiggestBytes(freeRam,2)+". ")
used=100-(float(freeRam)/float(ram)*100)
speaker.say(str(round(used,1))+"% ram used.")
#end def
Have a great day,
Alex
Email: mehgcap at gmail.com
More information about the python-win32
mailing list