Python Forum

Full Version: Rasp Pi: "lp: not allowed to print" when using a python script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there,

I have an issue printing a textfile with a python script. The script is simple:

import os

os.system('lp "testdatei.txt"')
But instead of a clean print I get the error above. Tried also with "sudo".

Using 'lp "testdatei.txt"' directly in a terminal windows works perfectly. Even using the code above within the python interactive mode works, but not as a script. User "pi" is in the lp group. I have no idea were the right problem exists. I also tried with subprocess, but this also led to the error above