Skip to content

Tag: python

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 (pyt…

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&#8230…

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 th…

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 se…