On Fri, Jan 15, 2010 at 6:26 PM, Alex Hall <[email protected]> wrote:

> 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: [email protected]
>

You appear to be missing a close paren on this line:

speaker.say(str(load[0])+", "+str(load[1])

in the sayLoad() function

Kevin Horn
_______________________________________________
python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to