Hi Alex, I understand your code but its very difficult to read in python if the indentation is not clear. Run through the Python style guide - http://www.python.org/dev/peps/pep-0008/ or Google's pyguide - http://google-styleguide.googlecode.com/svn/trunk/pyguide.html
Typical indentation is 4 spaces. Cheers. On Fri, Jan 15, 2010 at 7:26 PM, Alex Hall <mehg...@gmail.com> 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: mehg...@gmail.com > _______________________________________________ > python-win32 mailing list > python-win32@python.org > http://mail.python.org/mailman/listinfo/python-win32 >
_______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32