Your code looks really good, and there's very little I can see here that can be improved, nonetheless, the show goes on.
with open(file_path, "r+") as code_file:
return code_file.read()
I can't see that you re-use code_file
again to save, meaning plain r
is acceptable, over r+
, but as @QPaysTaxes pointed out in the comments, if provided an empty file path, the empty file would be created, and that would be run, so displaying an error here would be a good idea.
The .replace().replace()
can be improved, I had the following solution in mind:
return file_string.replace(
"until", "while not"
).replace(
"unless", "if not"
)
into:
changes = {
"until": "while not",
"unless": "if not",
}
return [file_string.replace(k, v) for k, v in changes.items()]
I think it'd be best if you set execute_results
by default to false
, as it's better than returning an error with a flag, if the flag is empty, because those kinda flags are usually optional, right?
execute_results = argv[2]
Possibly into the following, if you can accept it's malformed appearance.
execute_results = argv[2] if argv[2] else "-false"
(Thanks @frerich-raabe @frerich-raabe for the suggestion)
I can't really see anything other than that, well done!
Your code looks really good, and there's very little I can see here that can be improved, nonetheless, the show goes on.
with open(file_path, "r+") as code_file:
return code_file.read()
I can't see that you re-use code_file
again to save, meaning plain r
is acceptable, over r+
, but as @QPaysTaxes pointed out in the comments, if provided an empty file path, the empty file would be created, and that would be run, so displaying an error here would be a good idea.
The .replace().replace()
can be improved, I had the following solution in mind:
return file_string.replace(
"until", "while not"
).replace(
"unless", "if not"
)
into:
changes = {
"until": "while not",
"unless": "if not",
}
return [file_string.replace(k, v) for k, v in changes.items()]
I think it'd be best if you set execute_results
by default to false
, as it's better than returning an error with a flag, if the flag is empty, because those kinda flags are usually optional, right?
execute_results = argv[2]
Possibly into the following, if you can accept it's malformed appearance.
execute_results = argv[2] if argv[2] else "-false"
(Thanks @frerich-raabe for the suggestion)
I can't really see anything other than that, well done!
Your code looks really good, and there's very little I can see here that can be improved, nonetheless, the show goes on.
with open(file_path, "r+") as code_file:
return code_file.read()
I can't see that you re-use code_file
again to save, meaning plain r
is acceptable, over r+
, but as @QPaysTaxes pointed out in the comments, if provided an empty file path, the empty file would be created, and that would be run, so displaying an error here would be a good idea.
The .replace().replace()
can be improved, I had the following solution in mind:
return file_string.replace(
"until", "while not"
).replace(
"unless", "if not"
)
into:
changes = {
"until": "while not",
"unless": "if not",
}
return [file_string.replace(k, v) for k, v in changes.items()]
I think it'd be best if you set execute_results
by default to false
, as it's better than returning an error with a flag, if the flag is empty, because those kinda flags are usually optional, right?
execute_results = argv[2]
Possibly into the following, if you can accept it's malformed appearance.
execute_results = argv[2] if argv[2] else "-false"
(Thanks @frerich-raabe for the suggestion)
I can't really see anything other than that, well done!
Your code looks really good, and there's very little I can see here that can be improved, nonetheless, the show goes on.
with open(file_path, "r+") as code_file:
return code_file.read()
I can't see that you re-use code_file
again to save, meaning plain r
is acceptable, over r+
, but as @QPaysTaxes pointed out in the comments, if provided an empty file path, the empty file would be created, and that would be run, so displaying an error here would be a good idea.
The .replace().replace()
can be improved, I had the following solution in mind:
return file_string.replace(
"until", "while not"
).replace(
"unless", "if not"
)
into:
changes = {
"until": "while not",
"unless": "if not",
}
return [file_string.replace(k, v) for k, v in changes.items()]
I think it'd be best if you set execute_results
by default to false
, as it's better than returning an error with a flag, if the flag is empty, because those kinda flags are usually optional, right?
execute_results = argv[2]
Possibly into the following, if you can accept it's malformed appearance.
execute_results = argv[2] if argv[2] is not "" else "-false"
(Thanks @frerich-raabe for the suggestion)
I can't really see anything other than that, well done!
Your code looks really good, and there's very little I can see here that can be improved, nonetheless, the show goes on.
with open(file_path, "r+") as code_file:
return code_file.read()
I can't see that you re-use code_file
again to save, meaning plain r
is acceptable, over r+
, but as @QPaysTaxes pointed out in the comments, if provided an empty file path, the empty file would be created, and that would be run, so displaying an error here would be a good idea.
The .replace().replace()
can be improved, I had the following solution in mind:
return file_string.replace(
"until", "while not"
).replace(
"unless", "if not"
)
into:
changes = {
"until": "while not",
"unless": "if not",
}
return [file_string.replace(k, v) for k, v in changes.items()]
I think it'd be best if you set execute_results
by default to false
, as it's better than returning an error with a flag, if the flag is empty, because those kinda flags are usually optional, right?
execute_results = argv[2]
Possibly into the following, if you can accept it's malformed appearance.
execute_results = argv[2] if argv[2] is not "" else "-false"
I can't really see anything other than that, well done!
Your code looks really good, and there's very little I can see here that can be improved, nonetheless, the show goes on.
with open(file_path, "r+") as code_file:
return code_file.read()
I can't see that you re-use code_file
again to save, meaning plain r
is acceptable, over r+
, but as @QPaysTaxes pointed out in the comments, if provided an empty file path, the empty file would be created, and that would be run, so displaying an error here would be a good idea.
The .replace().replace()
can be improved, I had the following solution in mind:
return file_string.replace(
"until", "while not"
).replace(
"unless", "if not"
)
into:
changes = {
"until": "while not",
"unless": "if not",
}
return [file_string.replace(k, v) for k, v in changes.items()]
I think it'd be best if you set execute_results
by default to false
, as it's better than returning an error with a flag, if the flag is empty, because those kinda flags are usually optional, right?
execute_results = argv[2]
Possibly into the following, if you can accept it's malformed appearance.
execute_results = argv[2] if argv[2] else "-false"
(Thanks @frerich-raabe for the suggestion)
I can't really see anything other than that, well done!
Your code looks really good, and there's very little I can see here that can be improved, nonetheless, the show goes on.
with open(file_path, "r+") as code_file:
return code_file.read()
I can't see that you re-use code_file
, other than again to opensave, meaning plain r
is acceptable, over r+
, but as @QPaysTaxes pointed out in the comments, if provided an empty file path, the empty file would be created, and that would be run, so displaying an error here would be a good idea.
The .replace().replace()
can be improved, I had the following solution in mind:
return file_string.replace(
"until", "while not"
).replace(
"unless", "if not"
)
into:
changes = {
"until": "while not",
"unless": "if not",
}
return [file_string.replace(k, v) for k, v in changes.items()]
I think it'd be best if you set execute_results
by default to false
, as it's better than returning an error with a flag, if the flag is empty, because those kinda flags are usually optional, right?
execute_results = argv[2]
Possibly into the following, if you can accept it's malformed appearance.
execute_results = argv[2] if argv[2] is not "" else "-false"
I can't really see anything other than that, well done!
Your code looks really good, and there's very little I can see here that can be improved, nonetheless, the show goes on.
with open(file_path, "r+") as code_file:
return code_file.read()
I can't see that you re-use code_file
, other than to open, meaning plain r
is acceptable, over r+
.
The .replace().replace()
can be improved, I had the following solution in mind:
return file_string.replace(
"until", "while not"
).replace(
"unless", "if not"
)
into:
changes = {
"until": "while not",
"unless": "if not",
}
return [file_string.replace(k, v) for k, v in changes.items()]
I think it'd be best if you set execute_results
by default to false
, as it's better than returning an error with a flag, if the flag is empty, because those kinda flags are usually optional, right?
execute_results = argv[2]
Possibly into the following, if you can accept it's malformed appearance.
execute_results = argv[2] if argv[2] is not "" else "-false"
I can't really see anything other than that, well done!
Your code looks really good, and there's very little I can see here that can be improved, nonetheless, the show goes on.
with open(file_path, "r+") as code_file:
return code_file.read()
I can't see that you re-use code_file
again to save, meaning plain r
is acceptable, over r+
, but as @QPaysTaxes pointed out in the comments, if provided an empty file path, the empty file would be created, and that would be run, so displaying an error here would be a good idea.
The .replace().replace()
can be improved, I had the following solution in mind:
return file_string.replace(
"until", "while not"
).replace(
"unless", "if not"
)
into:
changes = {
"until": "while not",
"unless": "if not",
}
return [file_string.replace(k, v) for k, v in changes.items()]
I think it'd be best if you set execute_results
by default to false
, as it's better than returning an error with a flag, if the flag is empty, because those kinda flags are usually optional, right?
execute_results = argv[2]
Possibly into the following, if you can accept it's malformed appearance.
execute_results = argv[2] if argv[2] is not "" else "-false"
I can't really see anything other than that, well done!