search

Home  >  Q&A  >  body text

python - 在pycharm中,如何快速建立类、方法

if __name__=="__main__" :

root_url = "http://baike.baidu.com/view/21087.htm"
obj_spider = SpiderMan()
obj_spider.craw(root_url)

在视频教程中,看到别人使用eclipse,在SpiderMan上ctrl+1就能弹出菜单快速新建类,建完类之后在craw()上的菜单能在SpiderMan这个类下快速新建出一个方法,请问在pychram中这些如何操作,谢谢

阿神阿神2889 days ago498

reply all(5)I'll reply

  • PHPz

    PHPz2017-04-17 17:39:08

    Try alt+enter in the yellow area, or shift+insert

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 17:39:08

    Generally, better IDEs have shortcut key settings. You can set the shortcut keys in pycharm to be similar to eclipse, it depends on your own habits

    reply
    0
  • PHPz

    PHPz2017-04-17 17:39:08

    I found it, it’s alt+enter. Is there any way to quickly set it up similar to eclipse? It’s too troublesome to change one by one

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 17:39:08

    File-Settings-Keymap
    Just set the keymaps to eclipse.

    reply
    0
  • PHPz

    PHPz2017-04-17 17:39:08

    You should be looking at the crawler course on MOOC.com

    reply
    0
  • Cancelreply