Comments (4)
Possible solution: https://stackoverflow.com/questions/22227569/check-a-condition-while-running-subprocess
from favites.
Potential Stack Overflow post to ask if I can't figure it out:
Stack Overflow post
I have a Python 3 script that calls an external tool that repeats itself until it succeeds, and depending on parameter choices to the tool, it may quickly (e.g. instantly) succeed, it may take a few times to succeed, or it may (seemingly) never succeed. When it fails, the tool prints in a manner like this:
Failed to coalesce lineages: 1
Failed to coalesce lineages: 2
Failed to coalesce lineages: 3
...
I am calling the tool like this:
subprocess.call(command, stdout=open("log.txt",'w'))
I want to kill the subprocess call (and throw an error message) after a certain number of failures occur, e.g. when the log file I'm redirecting to has the string Failed to coalesce lineages: 100
in it (meaning the tool failed 100 times). How can I do this cleanly?
from favites.
Potentially fixed in 1b4e9df
from favites.
Fix has been integrated into an official release (1.1.1): https://github.com/niemasd/FAVITES/releases/tag/1.1.1
from favites.
Related Issues (20)
- Singularity Compatible Version of Favites Issue HOT 3
- Allow some communities to have 0 seeds HOT 1
- Create helper script that labels internal nodes of output trees HOT 1
- float('inf') in CONFIG file doesn't work in run_favites_docker.py (and potentially Singularity) HOT 1
- Implement πBUSS as a SequenceEvolution module
- Breaks when using "-u" in command line and not specifying the version HOT 2
- "KeyError: 'None'", for my Transmission Network File HOT 2
- Running config_designer.py causes my computer account logging out HOT 3
- No such file or directory: 'ID_xxx_simple.nex' HOT 2
- Create transmission module implementations for EoN
- Does not properly identify seed nodes HOT 2
- Issue with label_internal_nodes helper script HOT 1
- Allow user to specify sample times in file HOT 1
- Add ReSeq
- Enquiry about backward-in-time models HOT 5
- Add SANTA-SIM
- run_favites_docker.py only works on Linux with sudo HOT 3
- Sampling times file not found HOT 3
- config_designer.py fails to write JSON HOT 2
- ERROR? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from favites.