Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write a script to insert a block comment into each code file #3

Open
Mooophy opened this issue Apr 5, 2015 · 1 comment
Open

Write a script to insert a block comment into each code file #3

Mooophy opened this issue Apr 5, 2015 · 1 comment

Comments

@Mooophy
Copy link
Owner

Mooophy commented Apr 5, 2015

Such as :

//
// @author Yue Wang
// @time [read system time]
//

Seems a dictionary can be used here, like:

dic['author'] = `Yue Wang`
@Mooophy
Copy link
Owner Author

Mooophy commented Apr 5, 2015

Sample code in Python from SO

f = open("path_to_file", "r")
contents = f.readlines()
f.close()

contents.insert(index, value)

f = open("path_to_file", "w")
contents = "".join(contents)
f.write(contents)
f.close()

tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant