Python Forum
Rasp Pi: "lp: not allowed to print" when using a python script
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
Reply
#2
Cross-Post with solution: https://www.raspberrypi.org/forums/viewt...&p=1174200
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 3,007 Jun-29-2023, 11:57 AM
Last Post: gologica
  Adafruits Neotrellis interrupt with RAsp and Python Moris526 5 3,477 Jan-01-2021, 11:43 PM
Last Post: Moris526
  How to kill a bash script running as root from a python script? jc_lafleur 4 5,788 Jun-26-2020, 10:50 PM
Last Post: jc_lafleur
  crontab on RHEL7 not calling python script wrapped in shell script benthomson 1 2,248 May-28-2020, 05:27 PM
Last Post: micseydel
  Package python script which has different libraries as a single executable or script tej7gandhi 1 2,583 May-11-2019, 08:12 PM
Last Post: keames
  python ibeacon rasp pi localization joefreedy 13 6,062 Feb-12-2019, 08:52 PM
Last Post: joefreedy
  How to run python script which has dependent python script in another folder? PrateekG 1 3,105 May-23-2018, 04:50 PM
Last Post: snippsat
  How to call one python script and use its output in another python script lravikumarvsp 3 32,286 May-16-2018, 02:08 AM
Last Post: lravikumarvsp
  Script to average 2 columns in .csv file, and print results to the file name. Manveer_Dhillon 3 3,552 Sep-18-2017, 10:27 PM
Last Post: Larz60+
  Check Python version from inside script? Run Pythons script in v2 compatibility mode? pstein 2 9,788 Jul-07-2017, 08:59 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020