ubuntu

PDF is not saving in locally in flask server

PDF is not saving in locally in flask server Question: im running a script that converts images to a pdf file and saves the pdf locally, it works on my windows machine, but on my flask server they arent saving. here is the code from cmath import e from os import link from pickle import …

Total answers: 1

SLURM Array Job BASH scripting within python subprocess

SLURM Array Job BASH scripting within python subprocess Question: Update: I was able to get a variable assignment from SLURM_JOB_ID with this line. JOBID=`echo ${SLURM_JOB_ID}` However, I haven’t yet gotten SLURM_ARRAY_JOB_ID to assign itself to JOBID. Due to needing to support existing HPC workflows. I have a need to pass a bash script within a …

Total answers: 1

Python SMTP 'unable to get local issuer certificate' in python virtualenv

Python SMTP 'unable to get local issuer certificate' in python virtualenv Question: Sorry if title is unclear. I’m trying to send an email through python 3.10 through the standard library. It works locally on my machine with these default settings. smtp_server = "smtp.office365.com" port = 587 # For starttls sender_email = os.environ.get("EMAIL") password = os.environ.get("EMAIL_PASSWORD") …

Total answers: 1

Error: "self" is not defined error on VSCode on Ubuntu

Error: "self" is not defined error on VSCode on Ubuntu Question: I’m following a tutorial on understanding writing python publisher in ROS2. This is an example that I’m creating. The code does not seem to have any errors but in vscode, the self word is underlined in red and when I hover the mouse it …

Total answers: 1

Prevent Selenium from taking the focus to the opened window

Prevent Selenium from taking the focus to the opened window Question: I have 40 Python unit tests and each of them open a Selenium driver as they are separate files and cannot share the same driver. from selenium import webdriver webdriver.Firefox() The above commands will take the focus to the new opened window. For example, …

Total answers: 2

ImportError: cannot import name 'TimedJSONWebSignatureSerializer' from 'itsdangerous'

ImportError: cannot import name 'TimedJSONWebSignatureSerializer' from 'itsdangerous' Question: I’m running a flask app using itsdangerous python package in AWS EC2 instance. Traceback (most recent call last): File "run.py", line 4, in <module> app = create_app() File "/home/ubuntu/RHS_US/application/portal/__init__.py", line 29, in create_app from portal.users.routes import users File "/home/ubuntu/RHS_US/application/portal/users/routes.py", line 7, in <module> from portal.models import User …

Total answers: 3

How to launch the python selenium script on Ubuntu?

How to launch the python selenium script on Ubuntu? Question: I’m trying to launch it after xvfb-run firefox but it returns me these mistakes. When I try to launch it with python3 command it returns me NotADirectoryError: [Errno 20] Not a directory: ‘/home/druid/.wdm/drivers/geckodriver/linux64/v0.31.0/geckodriver’ Here’s a piece of my code: import time from selenium import webdriver …

Total answers: 1

Run public python http.server on Plesk

Run public python http.server on Plesk Question: I have a script that runs with python3 -m http.server 8080 locally without issues on http://localhost:8080 I wanted to make it live on my web server running Plesk/Ubuntu. First, I installed python3 via SSH and tried to run the same and it returns: View in browser: http://localhost:8080 however, …

Total answers: 1

How to set the Ubuntu Python3 interpreter path in VS Code?

How to set the Ubuntu Python3 interpreter path in VS Code? Question: I’m using Python3 on Ubuntu 20.04 inside WSL2, running print(sys.executable) outputs /usr/bin/python3 Within VS Code, pressing "Select Interpreter" then "Enter Interpreter Path" I have tried both /usr/bin/python3 and the full windows path \wsl$Ubuntu/usrbin/python3 (which is reachable inside file explorer). Both paths returns the …

Total answers: 1