aboutsummaryrefslogtreecommitdiff
path: root/challenge-045/paulo-custodio/python/ch-2.py
diff options
context:
space:
mode:
authorMohammad Sajid Anwar <Mohammad.Anwar@yahoo.com>2024-08-31 14:35:19 +0100
committerGitHub <noreply@github.com>2024-08-31 14:35:19 +0100
commit3dbb7440153e0276d79a0c4ab96443eaabf4f0c2 (patch)
treeb169ce1993bf89ffe83bc323f49a2ca0df59b42e /challenge-045/paulo-custodio/python/ch-2.py
parent21744df9e8a8dca71166fe7ecb3e53ff39d93402 (diff)
parent038c86e09d59d3754ab2814e568010d11ca4be89 (diff)
downloadperlweeklychallenge-club-3dbb7440153e0276d79a0c4ab96443eaabf4f0c2.tar.gz
perlweeklychallenge-club-3dbb7440153e0276d79a0c4ab96443eaabf4f0c2.tar.bz2
perlweeklychallenge-club-3dbb7440153e0276d79a0c4ab96443eaabf4f0c2.zip
Merge pull request #10737 from pauloscustodio/master
Add Python solutions
Diffstat (limited to 'challenge-045/paulo-custodio/python/ch-2.py')
-rw-r--r--challenge-045/paulo-custodio/python/ch-2.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/challenge-045/paulo-custodio/python/ch-2.py b/challenge-045/paulo-custodio/python/ch-2.py
new file mode 100644
index 0000000000..28fd2e75d4
--- /dev/null
+++ b/challenge-045/paulo-custodio/python/ch-2.py
@@ -0,0 +1,15 @@
+#!/usr/bin/env python3
+
+# Challenge 045
+#
+# TASK #2
+# Source Dumper
+# Write a script that dumps its own source code. For example, say, the script
+# name is ch-2.pl then the following command should returns nothing.
+#
+# $ perl ch-2.pl | diff - ch-2.pl
+
+import sys
+
+file = open(sys.argv[0])
+print(file.read(), end='')