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

Coding style #21

Open
linroex opened this issue Feb 6, 2016 · 2 comments
Open

Coding style #21

linroex opened this issue Feb 6, 2016 · 2 comments
Assignees

Comments

@linroex
Copy link
Collaborator

linroex commented Feb 6, 2016

from datetime import datetime, timedelta
import threading
import requests
import json
import re

通常會分段,變成:

from datetime import datetime, timedelta

import threading
import requests
import json
import re
@linroex
Copy link
Collaborator Author

linroex commented Feb 6, 2016

topic  =  self.topic,  
author  =  self.author,  
datetime  =  self.datetime, 
text  =  self.text

不用兩個空白

@linroex
Copy link
Collaborator Author

linroex commented Feb 6, 2016

程式碼分段...

if __name__ == '__main__':
    target = myspider.Spider('https://tw.news.yahoo.com/')
    target.add_channel('https://tw.news.yahoo.com/society/')
    target.add_channel('https://tw.news.yahoo.com/finance/')
    target.add_channel('https://tw.news.yahoo.com/art-edu/')
    target.start()

分段後:

if __name__ == '__main__':
    target = myspider.Spider('https://tw.news.yahoo.com/')

    target.add_channel('https://tw.news.yahoo.com/society/')
    target.add_channel('https://tw.news.yahoo.com/finance/')
    target.add_channel('https://tw.news.yahoo.com/art-edu/')

    target.start()

@AugustHong AugustHong assigned linroex and unassigned AugustHong Feb 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants