Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Rasp Pi: "lp: not allowed to print" when using a python script
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
Cross-Post with solution:
buran likes this post
My code examples are always for Python >=3.6.0
Almost dead, but too lazy to die:
All humans together. We don't need politicians!

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  How to kill a bash script running as root from a python script? jc_lafleur 4 282 Jun-26-2020, 10:50 PM
Last Post: jc_lafleur
  crontab on RHEL7 not calling python script wrapped in shell script benthomson 1 262 May-28-2020, 05:27 PM
Last Post: micseydel
  Package python script which has different libraries as a single executable or script tej7gandhi 1 626 May-11-2019, 08:12 PM
Last Post: keames
  python ibeacon rasp pi localization joefreedy 13 1,326 Feb-12-2019, 08:52 PM
Last Post: joefreedy
  Script to average 2 columns in .csv file, and print results to the file name. Manveer_Dhillon 3 1,714 Sep-18-2017, 10:27 PM
Last Post: Larz60+
  Check Python version from inside script? Run Pythons script in v2 compatibility mode? pstein 2 6,727 Jul-07-2017, 08:59 AM
Last Post: snippsat
  Cant pass corect variables to python script in bash script neradp 3 3,077 Nov-05-2016, 01:26 AM
Last Post: Larz60+

Forum Jump:

Users browsing this thread: 1 Guest(s)