Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102269096
toStaticUrls.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Feb 18, 23:02
Size
915 B
Mime Type
text/x-python
Expires
Thu, Feb 20, 23:02 (2 d)
Engine
blob
Format
Raw Data
Handle
24318666
Attached To
rOPTIMIZINGRDM Optimizing your research data management
toStaticUrls.py
View Options
#!/usr/bin/python3
import
os
root
=
'http://php.jankrause.net/rdm-sfp/'
f_in
=
'OptimizeResearchDataManagement-NoNotes.ipynb'
f_out
=
'OptimizeResearchDataManagement-NoNotes-StaticUrls.ipynb'
lines
=
open
(
f_in
,
'r'
)
.
readlines
()
out
=
''
for
line
in
lines
:
if
(
not
'.ipynb'
in
line
)
and
(
not
'](http'
in
line
):
lt
=
line
if
'](./'
in
line
:
lt
=
line
.
replace
(
'](./'
,
']('
)
l2
=
lt
.
replace
(
']('
,
']('
+
root
)
else
:
l2
=
line
out
+=
l2
open
(
f_out
,
'w'
)
.
write
(
out
)
###########
f_in
=
'SnakeMake.ipynb'
f_out
=
'SnakeMake-StaticUrls.ipynb'
lines
=
open
(
f_in
,
'r'
)
.
readlines
()
out
=
''
for
line
in
lines
:
if
(
not
'.ipynb'
in
line
)
and
(
not
'](http'
in
line
):
lt
=
line
if
'](./'
in
line
:
lt
=
line
.
replace
(
'](./'
,
']('
)
l2
=
lt
.
replace
(
']('
,
']('
+
root
)
else
:
l2
=
line
out
+=
l2
open
(
f_out
,
'w'
)
.
write
(
out
)
Event Timeline
Log In to Comment