I have two scripts a.py and b.py and two virtual environments “venv” and “pypdf_env”. a.py should work on “venv” and b.py should work on “pypdf_env”. And I am passing subject to second script process_library_jobs()
.
Is there any solution?
a.py runs venv based on header.
a.py
#! /var/www/cgi-bin/luemail_new/venv/bin/python
import cgi
import json
import logging
import datetime
import re
import smtplib
from email.utils import parseaddr
from b import process_library_jobs
print("Going to library")
if subject == "Library Package":
process_library_jobs(subject)
b.py
#! /var/www/cgi-bin/luemail_new/pypdf_env/bin/python
from PyPDF2 import PdfFileReader
pdf_path = r"/home/flock/Downloads/certificate.pdf"
def process_library_jobs(subject):
with open(pdf_path, 'rb') as f:
pdf = PdfFileReader(f)
information = pdf.getDocumentInfo()
print(information)
number_of_pages = pdf.getNumPages()
print(subject)
return number_of_pages
1