Note that there are some explanatory texts on larger screens.

plurals
  1. POPython RuntimeError: More keyword list entries (5) than format specifiers (1)
    primarykey
    data
    text
    <p>I am trying to develop a Simple Sound2Light Application for my Raspberry Pi in Python. I'm using the Impulse Library written by Ian Halpern (<a href="https://github.com/ianhalpern/Impulse" rel="nofollow">https://github.com/ianhalpern/Impulse</a>)</p> <p>However I first tried to extract 3 Values (Sub,Mid,Hi) from the Audio Array Impulse is delivering me.</p> <p>This is the Code:</p> <pre><code>#!/usr/bin/env python import sys, os, time import impulse def draw ( ): fft = True audio_sample_array = impulse.getSnapshot( fft ) if fft: ffted_array = list( audio_sample_array ) # start drawing spectrum red = 0 green = 0 blue = 0 for i in range(0,20): blue += ffted_array[i] for i in range(21,41): green += ffted_array[i] for i in range(42,62): red += ffted_array[i] print red, print blue, print green return False def main(args): try: while True: draw() time.sleep(1) except KeyboardInterrupt: pass return True if __name__ == '__main__': try: import ctypes libc = ctypes.CDLL('libc.so.6') libc.prctl(15, os.path.split( sys.argv[ 0 ] )[ 1 ], 0, 0, 0) except: pass sys.exit( main( sys.argv ) ) main( sys.argv ) </code></pre> <p>However this Code ist Running flawlessly on my Laptop (archlinux x64 python 2.7)</p> <pre><code>[felix@felix-think impulse]$ python2 --version Python 2.7.3 </code></pre> <p>but fails to run on my Rapsberry Pi (Running Raspbian)</p> <pre><code>pi@raspberrypi ~/music2light $ python --version Python 2.7.3 </code></pre> <p>This is the ErrorMessage</p> <pre><code>pi@raspberrypi ~/music2light $ python main.py Traceback (most recent call last): File "main.py", line 56, in &lt;module&gt; sys.exit( main( sys.argv ) ) File "main.py", line 40, in main draw() File "main.py", line 21, in draw for i in range(0,20): RuntimeError: More keyword list entries (5) than format specifiers (1) </code></pre> <p>I'm tried to Google for it but found nothing... The only thing I found out is, that the Error is thrown by the getargs.c File (<a href="http://svn.python.org/projects/python/branches/release27-maint/Python/getargs.c" rel="nofollow">http://svn.python.org/projects/python/branches/release27-maint/Python/getargs.c</a>)</p> <pre><code>if (IS_END_OF_FORMAT(*format)) { PyErr_Format(PyExc_RuntimeError, "More keyword list entries (%d) than " "format specifiers (%d)", len, i); return cleanreturn(0, freelist); } </code></pre> <p>Thanks in advance for your help :) Felix</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload