From 5fd0e13ee01e48f3d8b10f02f42b58bcdcca157e Mon Sep 17 00:00:00 2001 From: Paulo Custodio Date: Sat, 31 Aug 2024 11:15:00 +0100 Subject: Add Python solution to challenge 045 --- challenge-045/paulo-custodio/python/ch-2.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 challenge-045/paulo-custodio/python/ch-2.py (limited to 'challenge-045/paulo-custodio/python/ch-2.py') 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='') -- cgit