Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Ethan Mertz
/
CS-123-Final
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Pipelines
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b6b2f102
authored
Jun 01, 2018
by
Ethan Mertz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed some sturf
parent
f411ae04
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
Python/collectvariables.py
Python/toptext.py
Python/collectvariables.py
View file @
b6b2f102
...
...
@@ -18,12 +18,15 @@ def get_unique_vars(filename):
def
main
():
count
=
0
for
filename
in
glob
.
glob
(
"pydata/pyfile*.txt"
):
print
(
"working on "
+
filename
)
s
=
get_unique_vars
(
filename
)
with
open
(
"pyvariables/varfile"
+
str
(
count
)
+
".txt"
,
"w"
)
as
f
:
for
var
in
s
:
f
.
write
(
var
+
"
\n
"
)
count
+=
1
if
count
==
50000
:
return
else
:
print
(
"working on "
+
filename
)
s
=
get_unique_vars
(
filename
)
with
open
(
"pyvariables/varfile"
+
str
(
count
)
+
".txt"
,
"w"
)
as
f
:
for
var
in
s
:
f
.
write
(
var
+
"
\n
"
)
count
+=
1
if
__name__
==
'__main__'
:
...
...
Python/toptext.py
View file @
b6b2f102
...
...
@@ -17,7 +17,7 @@ class MRWordFreqCount(MRJob):
def
mapper
(
self
,
_
,
line
):
file1
,
file2
,
total
=
line
.
split
(
","
)
file2name
=
"pyfile"
+
file2
+
".txt"
for
file_number
in
{
file1
,
file2
}:
for
file_number
in
{
file1
,
file2
}:
#If file1 == file2
filename
=
"pyfile"
+
file_number
+
".txt"
file_text
=
filename
.
read
()
for
i
in
range
(
int
(
file1
)
+
1
,
int
(
total
)):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment