main
Last change
on this file was
42bd667,
checked in by David Fuertes <dfuertes@…>, 4 years ago
|
Historial Limpio
|
-
Property mode set to
100644
|
File size:
389 bytes
|
Line | |
---|
1 | import time |
---|
2 | from random import randint |
---|
3 | import threading |
---|
4 | |
---|
5 | |
---|
6 | |
---|
7 | _var_global = None |
---|
8 | |
---|
9 | _local = threading.local() |
---|
10 | |
---|
11 | def set_var(var): |
---|
12 | global _var_global |
---|
13 | _var_global = var |
---|
14 | global _local |
---|
15 | _local.var = var |
---|
16 | |
---|
17 | time.sleep(randint(10,20)) |
---|
18 | |
---|
19 | print('Module var pasada ' + str(var) + \ |
---|
20 | ' local var ' + str(_local.var) + \ |
---|
21 | ' non local ' + str(_var_global)) |
---|
Note: See
TracBrowser
for help on using the repository browser.