My crontab is In new.sh I have In new.py I open images with the Pillow module and play music, but when I boot it only plays the music. Any help is appreciated. EDIT: The music plays perfectly. Edit: The shell script runs it fine in terminal. ANSWERED! Answer In the bash script, write export DISPLAY=”:0.0.
Tag: python
Letsencrypt ImportError: No module named interface on amazon linux while renewing
Today when i tried to renew my certificates using this command I’m facing error also tried this command Error : I did lot of research no solution found. Answer After doing lots of research I found it. You have to unset Python install layout then update letsencrypt for more refer this blog https://o-mkar.com/facing-problem-while-renewing-letsencrypt-certificates-importerror-no-module-named-interface-amazon-linux
Re-write write-protected file
Every 4 hours files are updated with new information if needed – i.e. if any new information has been processed for that particular file (files correspond to people). I’m running this command to convert my .stp files (those being updated every 4 hours) to .xml files. My script is in Snakemake (python based) but I’m running the convert.exe through a
Fabric nonzero return code 137
I have the following task in fabric, designed to brute force kill all celery workers in an emergency It fails with Why is this? The commnd itself works fine from the an ssh shell as user “operatore” on the server. Or at least how can I get fabric to give me some more information to work with… I’ve also tried
Subprocess doesn’t respect arguments when using multiprocessing
The main objective here is to create a daemon-spawning function. The daemons need to run arbitrary programs (i.e. use subprocess). What I have so far in my daemonizer.py module is: When trying to run this in bash (This will create a file called test.log in your current directory.): It correctly spawns a daemon that launches ping but it doesn’t respect
Python Using Fileinput to Replace Words
I am using Python 2.7 with MAC OS X and wrote a program to replace a word in a file with another word. Any time that word shows up in that file I want it replaced with another word that the user specifies. It seems to be working but it seems to be outputting a couple extra lines on the
How do I kill a Python script in Java?
I am launching a Python script in Java using Runtime.getRuntime().exec(“python myWebService.py”) and I am not doing anything else with it in Java. However, now I need to terminate the process from within my Java application. I’ve tried issuing a pkill command from the terminal, outside of the application, and this will not kill the script. Finding the pid in the
Get the status of a python process that was executed in another terminal
I have a python program that will create and execute another python script in a new terminal. To do so, I’m using subprocess.Popen. I’m trying to get the PID of the new process using .pid. However, the value of this pid doesn’t seem to match the real pid of the newly created process (the two values don’t match). Here’s a
How to get one line from a print output in linux?
I’m trying to pull one line from a subprocess.check_output but so far I have no luck. I’m running a Python script and this is my code: and this is what I get back when I run the script: Now I want to get the 9th line (RMS amplitude) out of this list. I already tried something with sed but it
How to connect to my remote SQL server
I have a linux ubuntu server that I rent from DigitalOcean for storing streaming real time data in MySQL by coding with python. Problem is that I am coding not in the linux server environment but in my local computer python(personal Windows 10(not a server)). So in the coding, I need to connect to my linux server in order to