forked from synbiochem/galaxytools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestTool.py
54 lines (42 loc) · 1.33 KB
/
testTool.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 19 09:29:08 2019
@author: Pablo Carbonell, SYNBIOCHEM
@description: Test tool.
"""
import argparse
import requests
import os
def outHTML(outFile, outPath):
outfigname = 'sbc.png'
outfig = os.path.join( outPath, outfigname )
output = """
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
</head>
<body>
<p>This is an example of a simple HTML page with one paragraph.</p>
<div>An image:<img src="{}" width="100px"></img>.</didv>
</body>
</html>
""".format( outfigname )
with open(outFile,'w') as h:
h.write(output)
if not os.path.exists(outPath):
os.makedirs( outPath )
r = requests.get('https://pbs.twimg.com/profile_images/607846881331412992/stXUAIwe_400x400.png')
open(outfig,'wb').write(r.content)
def arguments():
parser = argparse.ArgumentParser(description='Read list of primers and output primer plate. Pablo Carbonell, SYNBIOCHEM, 2019')
parser.add_argument('-o', '--output',
help='Output file.')
parser.add_argument('-p', '--path',
help='Output path.')
return parser
if __name__ == '__main__':
parser = arguments()
args = parser.parse_args()
outHTML(args.output,args.path)