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
Florestan Biaux
Messenger Statistics
Commits
b130a933
Commit
b130a933
authored
Jul 21, 2021
by
Florestan Biaux
💬
Browse files
ajout users.py
parent
2ac61ed6
Changes
2
Hide whitespace changes
Inline
Side-by-side
main.py
View file @
b130a933
import
tri
import
get
import
users
import
json
import
decode
...
...
@@ -9,7 +10,11 @@ if __name__ == "__main__":
name
=
str
(
input
(
"Quel est le nom de la conversation à analyser ? "
))
# get json file
data
=
get
.
getfile
(
name
)
# data = json
print
(
json
.
dumps
(
data
))
test
=
"Jules Fi
\u00c3\u00a9
vet"
print
(
decode
.
string_decode
(
test
))
# choose action to do
choice
=
0
while
choice
!=
3
:
choice
=
int
(
input
(
"
\n
1 - Afficher les messages
\n
2 - Afficher les participants
\n
3- Quitter l
\'
application
\n
"
))
if
choice
==
1
:
print
(
data
)
if
choice
==
2
:
print
(
users
.
userlist
(
data
))
users.py
0 → 100644
View file @
b130a933
import
decode
def
userlist
(
data
):
userlist
=
str
(
data
[
"participants"
])
userlist
=
userlist
.
replace
(
"name"
,
""
)
userlist
=
userlist
.
replace
(
"["
,
""
)
userlist
=
userlist
.
replace
(
"]"
,
""
)
userlist
=
userlist
.
replace
(
"'"
,
'"'
)
userlist
=
userlist
.
replace
(
'""'
,
""
)
userlist
=
userlist
.
replace
(
'{:'
,
""
)
userlist
=
userlist
.
replace
(
'}'
,
""
)
return
decode
.
string_decode
(
userlist
)
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