FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python/pythonchallenge/19.py at master · bjd1111/python · GitHub
bjd1111
python
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python
/
pythonchallenge
/
19.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (19 loc) · 570 Bytes
Breadcrumbs
python
/
pythonchallenge
/
19.py
Copy path
File metadata and controls
29 lines (19 loc) · 570 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import
urllib
import
re
import
email
import
wave
url
=
'http://butter:fly@www.pythonchallenge.com/pc/hex/bin.html'
src
=
urllib
.
urlopen
(
url
).
read
()
c
=
re
.
compile
(
"<!--
\n
(.*)
\n
-->"
,
re
.
DOTALL
)
data
=
c
.
findall
(
src
)[
0
]
message
=
email
.
message_from_string
(
data
)
audio
=
message
.
get_payload
(
0
).
get_payload
(
decode
=
True
)
f
=
open
(
'19.wav'
,
'w'
)
f
.
write
(
audio
)
f
.
close
()
a
=
wave
.
open
(
'19.wav'
,
'r'
)
reverse
=
wave
.
open
(
'reversed.wav'
,
'wb'
)
reverse
.
setparams
(
a
.
getparams
())
for
i
in
range
(
a
.
getnframes
()):
reverse
.
writeframes
(
a
.
readframes
(
1
)[::
-
1
])
reverse
.
close
()
Back
|
FazBrowse Home
|
New Git URL