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
fa8e3fdf
Commit
fa8e3fdf
authored
Jul 21, 2021
by
Florestan Biaux
💬
Browse files
optimisation getter
parent
f2491e94
Changes
2
Hide whitespace changes
Inline
Side-by-side
get.py
View file @
fa8e3fdf
...
...
@@ -20,7 +20,7 @@ def getfile(name):
path
=
os
.
getcwd
()
+
"/messages/inbox/"
os
.
chdir
(
path
)
oslist
=
os
.
listdir
()
r
=
re
.
compile
(
name
)
r
=
re
.
compile
(
get
name
(
name
)
)
conv
=
list
(
filter
(
r
.
match
,
oslist
))
conv
=
conv
.
__getitem__
(
0
)
os
.
chdir
(
path
+
"/"
+
conv
)
...
...
@@ -29,3 +29,4 @@ def getfile(name):
data_str
=
json
.
dumps
(
data
)
print
(
data_str
)
os
.
chdir
(
originpath
)
main.py
View file @
fa8e3fdf
...
...
@@ -6,5 +6,4 @@ if __name__ == "__main__":
# demander le nom de la conv à analyser
name
=
str
(
input
(
"Quel est le nom de la conversation à analyser ?"
))
# give regex of conversation name
conv
=
get
.
getname
(
name
)
get
.
getfile
(
conv
)
get
.
getfile
(
name
)
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