Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Samuel Kemmler
FA Server Client
Commits
433d7cca
Commit
433d7cca
authored
Sep 07, 2021
by
Samuel Kemmler
Browse files
Make client.py flake8 conform
parent
7755e2ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
client.py
View file @
433d7cca
...
...
@@ -4,8 +4,8 @@ import random
def
jacobi_iteration
(
u
):
for
i
in
range
(
1
,
len
(
u
)
-
1
):
u
[
i
]
=
0.5
*
(
u
[
i
-
1
]
+
u
[
i
+
1
])
for
i
in
range
(
1
,
len
(
u
)
-
1
):
u
[
i
]
=
0.5
*
(
u
[
i
-
1
]
+
u
[
i
+
1
])
context
=
zmq
.
Context
()
...
...
@@ -25,9 +25,9 @@ u[len(u) - 1] = 0.0
socket
.
send
(
"-"
.
join
(
str
(
x
)
for
x
in
u
).
encode
(
"ascii"
))
while
True
:
# if requested, perform jacobi iteration and send result
message
=
socket
.
recv
().
decode
(
"ascii"
)
if
message
!=
"next"
:
break
jacobi_iteration
(
u
)
socket
.
send
(
"-"
.
join
(
str
(
x
)
for
x
in
u
).
encode
(
"ascii"
))
# if requested, perform jacobi iteration and send result
message
=
socket
.
recv
().
decode
(
"ascii"
)
if
message
!=
"next"
:
break
jacobi_iteration
(
u
)
socket
.
send
(
"-"
.
join
(
str
(
x
)
for
x
in
u
).
encode
(
"ascii"
))
Write
Preview
Supports
Markdown
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