FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonVSCode/src/test/python_files/debugging/wait_for_file.py at main · chechi/pythonVSCode · GitHub
chechi
/
pythonVSCode
Public
forked from
DonJayamanne/pythonVSCode
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonVSCode
/
src
/
test
/
python_files
/
debugging
/
wait_for_file.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (31 loc) · 842 Bytes
Breadcrumbs
pythonVSCode
/
src
/
test
/
python_files
/
debugging
/
wait_for_file.py
Copy path
File metadata and controls
35 lines (31 loc) · 842 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import
os
.
path
import
sys
import
time
try
:
_
,
filename
=
sys
.
argv
except
ValueError
:
_
,
filename
,
outfile
=
sys
.
argv
sys
.
stdout
=
open
(
outfile
,
'w'
)
print
(
'waiting for file {!r}'
.
format
(
filename
))
# We use sys.stdout.write() instead of print() because Python 2...
if
not
os
.
path
.
exists
(
filename
):
time
.
sleep
(
0.1
)
sys
.
stdout
.
write
(
'.'
)
sys
.
stdout
.
flush
()
i
=
1
while
not
os
.
path
.
exists
(
filename
):
time
.
sleep
(
0.1
)
if
i
%
10
==
0
:
sys
.
stdout
.
write
(
' '
)
if
i
%
600
==
0
:
if
i
==
600
:
sys
.
stdout
.
write
(
'
\n
= 1 minute =
\n
'
)
else
:
sys
.
stdout
.
write
(
'
\n
= {} minutes =
\n
'
.
format
(
i
//
600
))
elif
i
%
100
==
0
:
sys
.
stdout
.
write
(
'
\n
'
)
sys
.
stdout
.
write
(
'.'
)
sys
.
stdout
.
flush
()
i
+=
1
print
(
'
\n
found file {!r}'
.
format
(
filename
))
print
(
'done!'
)
Back
|
FazBrowse Home
|
New Git URL