Replace "\n"
with n
in Python scripts
This commit is contained in:
parent
b60bb22112
commit
5185bcb6a7
@ -19,7 +19,7 @@ for channelId in list(os.walk('.'))[1]:
|
|||||||
filePath = f'{channelId}/requests/{str(numberOfRequests - 1)}.json'
|
filePath = f'{channelId}/requests/{str(numberOfRequests - 1)}.json'
|
||||||
with open(filePath) as f:
|
with open(filePath) as f:
|
||||||
print(filePath)
|
print(filePath)
|
||||||
#content = "\n".join(f.read().splitlines()[1:])
|
#content = '\n'.join(f.read().splitlines()[1:])
|
||||||
data = json.load(f)#json.loads(content)
|
data = json.load(f)#json.loads(content)
|
||||||
snippet = data['items'][-1]['snippet']
|
snippet = data['items'][-1]['snippet']
|
||||||
if 'topLevelComment' in snippet:
|
if 'topLevelComment' in snippet:
|
||||||
|
@ -27,7 +27,7 @@ def write(s):
|
|||||||
read = f.read()
|
read = f.read()
|
||||||
# We are appening content, as we moved in-file cursor.
|
# We are appening content, as we moved in-file cursor.
|
||||||
if read != '':
|
if read != '':
|
||||||
f.write("\n")
|
f.write('\n')
|
||||||
f.write(s)
|
f.write(s)
|
||||||
f.flush()
|
f.flush()
|
||||||
fcntl.flock(f, fcntl.LOCK_UN)
|
fcntl.flock(f, fcntl.LOCK_UN)
|
||||||
|
Loading…
Reference in New Issue
Block a user