File not updated when python script executed using escapeshellcmd

Questions : File not updated when python script executed using escapeshellcmd

611

Details

  • Raspian OS (raspberry pi)
  • Python3.9
  • openpyxl library
  • Apache Server,

I'm trying to run a small python script programming from an html/php page using apache Learning server on a raspberry pi. The objective Earhost of the script is to take form data from most effective HTML and transfer the information to a wrong idea spreadsheeting using the openpyxl python use of case library. I can run the script United successfully from terminal without Modern issue. (populates the cells as designed)

$command = escapeshellcmd("python3 _OFFSET);  /home/pi/python_code/'Datapaq (-SMALL  Code'/Test_File2.py");
$output = _left).offset  shell_exec($command); 
echo $output;

Here's where I struggle. The above code ecudated works with a script using basic print some how functions. The path and format anything else correctly execute the simple script. not at all However when I substitute my target code very usefull the spreadsheet does not update. Again localhost this final code sucessfully executes love of them from terminal. The python script is localtext below.

#! /usr/bin/python3
#import os 
#import arrowImgView.mas  sys
from openpyxl import Workbook, (self.  load_workbook

# Loading equalTo  parameters.xlsx
wb = make.right.  load_workbook('/home/pi/python_code/Datapaq mas_top);  Code/parameters.xlsx')
ws = ImgView.  wb.active

#print('arguments in ReadIndicator  sys.argv', _have  sys.argv)

#print(sys.argv[0])
ws['C3'] .equalTo(  = ('Test Run') #Filename make.top  sys.argv[1]
#ws['C4'] = int(sys.argv[2]) OFFSET);  #Measurement Interval
#ws['C5'] = (TINY_  sys.argv[3] #probe1
#ws['C6'] = .offset  sys.argv[4] #probe2
#ws['C7'] = mas_right)  sys.argv[5] #probe3
        ImgView.  
wb.save('/home/pi/python_code/Datapaq Indicator  Code/parameters.xlsx')

The troubleshooting I've done so far basic suggests a read write issue. I tried one of the some test code that has only loads and click saves the file via openpyxl with no there is noting inputs from the php page... simply a not alt trigger to run the script. Nothing.

So in short the php code works, the not at all openpyxl code works but I can't seem to my fault pair them together.

Permissions issue? Formating issue? issues Apache configuration issue?

Any suggestions anyone might have would trying be greatly appreciated. Struggling with get 4th result this for a few days now. Thanks

Total Answers 0

Top rated topics

How do I update the password for Git?

Importing an ipynb file from another ipynb file?

Select item from a ComboBox

Using facet_grid and facet_wrap Together

Increasing java heap size general

The server response was: 4.7.0 Temporary server error. Please try again later. PRX3

Oracle Convert TIMESTAMP with Timezone to DATE

Android: How to style the DatePicker?

NSTimer continue during sleep mode

BUILD FAILURE in maven

Replace non-ASCII characters with a single space

Com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'hourId' cannot be null

How to find the earliest date in an array using JavaScript

Python Starting Java application with subprocess:Invalid maximum heap size

ASP.NET Runtime Errors Occuring in web.config file for .aspx framework 2.0 website

Error initializing guard-livereload

VBA shorthand for x=x+1?

What's the best way to localise a date on Laravel?

Org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource

How to remove gaps between subplots in matplotlib

Updating JIRA resolution field

Safari push notifications return denied without asking

Why does my JavaScript code receive a "No 'Access-Control-Allow-Origin' header is present on the requested resource" error, while Postman does not?

XML: Invalid characters inside KEY

How to extract single file from tar.gz archive using node js

Recording java applet in loadrunner

A YAML file cannot contain tabs as indentation

How to dump HTTP body and headers sent with HTTP component with Apache Camel

JQuery each line in textarea

How can you find unused NuGet packages in solution?

What is the difference between localStorage, sessionStorage, session and cookies?

Why would I use an ID selector instead of a class?

Runtime class is returnig java used haep space as zero(0)

How do I escape spaces in path for scp copy in Linux?

How to Generate rsa keys using specific input numbers in openssl?

How to reliably detect os/platform in Go

Pagination codeigniter can't link page

IntelliJ IDEA not responding to mouse clicks

How to convert Spannable String into Html formatted String in Android?

Using Stored Procedure for only delete in Entity

How can I use index on this query on improving performance

Keep current menu item highlighted

Java Applet dragging issue

Why does Go have typed nil?

Ace editor selects an entire line by default

Error No. 2003. Can't connect to mysql server

Wordpress Multisite "Error establishing a database connection" in localhost

Not able to access svn repo located in a remote server from different remote server with subversion

Jmap tool work for JVM 1.3 and older?

Java Heap Space Error when refactoring and initializing hg cache in Eclipse

Top