Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
AVPetukhov
Practica 2021
Commits
dbb543bc
Commit
dbb543bc
authored
Jul 10, 2021
by
MVMolchanova
Browse files
Upload New File
parent
2241ff51
Changes
1
Show whitespace changes
Inline
Side-by-side
mainV2.py
0 → 100644
View file @
dbb543bc
import
pika
import
json
x
=
list
(
range
(
0
,
101
,
1
))
y
=
[]
for
num
in
x
:
a
=
num
y
.
append
(
a
)
z
=
[
x
,
y
]
json_string
=
json
.
dumps
(
z
)
credentials
=
pika
.
PlainCredentials
(
'Anton'
,
'Anton'
)
connection
=
pika
.
BlockingConnection
(
pika
.
ConnectionParameters
(
host
=
'217.9.89.214'
,
port
=
5672
,
virtual_host
=
'/'
,
credentials
=
credentials
))
channel
=
connection
.
channel
()
channel
.
queue_declare
(
queue
=
'Anton'
)
channel
.
basic_publish
(
exchange
=
''
,
routing_key
=
'Anton'
,
body
=
json_string
)
print
(
"Sent"
)
connection
.
close
()
\ No newline at end of file
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