Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F83466411
find_conseq.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Sep 17, 07:19
Size
523 B
Mime Type
text/x-python
Expires
Thu, Sep 19, 07:19 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
20842962
Attached To
R12526 perf-test-akantu
find_conseq.py
View Options
#!/usr/bin/env python3
first_id
=
-
2
last_id
=
-
2
def
print_id
(
id
):
global
first_id
global
last_id
if
last_id
==
-
2
:
pass
elif
last_id
==
first_id
:
print
(
f
'jobs.id = {last_id}'
)
else
:
print
(
f
'jobs.id>{first_id - 1}, jobs.id<{last_id+1}'
)
first_id
=
id
last_id
=
id
with
open
(
'list'
,
'r'
)
as
fh
:
for
line
in
fh
.
readlines
():
id
=
int
(
line
.
strip
())
if
id
==
last_id
+
1
:
last_id
=
id
else
:
print_id
(
id
)
print_id
(
id
)
Event Timeline
Log In to Comment