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
#1
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
Quote
#2
Cross-Post with solution: https://www.raspberrypi.org/forums/viewt...&p=1174200
buran likes this post
My code examples are always for Python >=3.6.0
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Package python script which has different libraries as a single executable or script tej7gandhi 1 253 May-11-2019, 08:12 PM
Last Post: keames
  python ibeacon rasp pi localization joefreedy 13 613 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,279 Sep-18-2017, 10:27 PM
Last Post: Larz60+
  Check Python version from inside script? Run Pythons script in v2 compatibility mode? pstein 2 4,996 Jul-07-2017, 08:59 AM
Last Post: snippsat
  Cant pass corect variables to python script in bash script neradp 3 2,332 Nov-05-2016, 01:26 AM
Last Post: Larz60+

Forum Jump:


Users browsing this thread: 1 Guest(s)