Skip to content

Instantly share code, notes, and snippets.

@dequis
Created August 3, 2014 22:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dequis/1b61a3c8ee90b28332bb to your computer and use it in GitHub Desktop.
Save dequis/1b61a3c8ee90b28332bb to your computer and use it in GitHub Desktop.
GNU Ed 2.0 (python version)
#!/usr/bin/env python
# GNU Ed 2.0 (python version)
#
# Copyright (C) 1994 Andrew L. Moore.
# Copyright (C) 2014 Free Software Foundation, Inc.
# Copyright (C) 2014 dx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import signal
def what(*args):
if args:
print("")
print("?")
for x in dir(signal):
if x.startswith("SIG"):
try:
signal.signal(getattr(signal, x), what)
except:
pass
try:
input = raw_input
except:
pass
while True:
try:
input()
except:
pass
what()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment