Page MenuHomeDevCentral

D1352.diff
No OneTemporary

D1352.diff

Index: eliminate-common-nouns
===================================================================
--- eliminate-common-nouns
+++ eliminate-common-nouns
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import sys
import os.path
@@ -8,13 +8,13 @@
#
if len(sys.argv) != 2:
- print 'Usage:', sys.argv[0], '<text file>'
+ print('Usage:', sys.argv[0], '<text file>')
sys.exit(1)
filename = sys.argv[1]
if not os.path.exists(filename):
- print filename + ': no such file'
+ print(filename + ': no such file')
sys.exit(2)
#
@@ -28,4 +28,4 @@
for line in file:
candidate = line.strip()
if candidate.lower() not in englishWords:
- print candidate
+ print(candidate)
Index: extract-proper-nouns
===================================================================
--- extract-proper-nouns
+++ extract-proper-nouns
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import sys
import os.path
@@ -13,13 +13,13 @@
#
if len(sys.argv) != 2:
- print 'Usage:', sys.argv[0], '<text file>'
+ print('Usage:', sys.argv[0], '<text file>')
sys.exit(1)
filename = sys.argv[1]
if not os.path.exists(filename):
- print filename + ': no such file'
+ print(filename + ': no such file')
sys.exit(2)
#
@@ -53,8 +53,8 @@
continue
if len(currentCandidate) > 0:
- print ' '.join(currentCandidate)
+ print(' '.join(currentCandidate))
currentCandidate = []
if len(currentCandidate) > 0:
- print ' '.join(currentCandidate)
+ print(' '.join(currentCandidate))

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 28, 19:40 (22 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2269752
Default Alt Text
D1352.diff (1 KB)

Event Timeline