Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TP B12 SDSWB
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CHEVRIER Vincent
TP B12 SDSWB
Commits
4872319c
Commit
4872319c
authored
3 years ago
by
ChevrierVincent
Browse files
Options
Downloads
Patches
Plain Diff
maj depot TP3
parent
f3702539
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
TP3/docu.md
+2
-0
2 additions, 0 deletions
TP3/docu.md
TP3/service3.py
+17
-0
17 additions, 0 deletions
TP3/service3.py
with
19 additions
and
0 deletions
TP3/docu.md
+
2
−
0
View file @
4872319c
...
...
@@ -69,6 +69,8 @@ In askservice1 client
-
Can you see an advantage to use it?
### service3.py
Use of global variables
##More interesting
### The shutdown problem
When the server is running it uses a givent port on the machine and forbids another server to be run.
...
...
This diff is collapsed.
Click to expand it.
TP3/service3.py
0 → 100644
+
17
−
0
View file @
4872319c
from
flask
import
Flask
from
datetime
import
datetime
compteur
=
0
app
=
Flask
(
__name__
)
# notre appli
@app.route
(
'
/service1
'
)
# service (service1) et la fonction associé
def
dire_coucou
():
global
compteur
compteur
+=
1
myTime
=
datetime
.
today
()
txt
=
str
(
myTime
.
hour
)
+
"
h
"
+
str
(
myTime
.
minute
)
+
"
min
"
+
str
(
myTime
.
second
)
+
"
s
"
return
'
appel n°
'
+
str
(
compteur
)
+
"
"
+
txt
#http://127.0.0.1:5000/service1 # appel
app
.
run
(
debug
=
True
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment