我來自ruby的python。 Python中require(Ruby)的等價語句是什麼?Python中的「require」(Ruby)等價於什麼?
回答
該import
聲明。
也許是明智的,你跟着一個Python tutorial其中許多基本的解釋
導入(Python)和require(Ruby)之間有區別。如果我需要在紅寶石(只需要語句),文件可以被執行,而只有導入語句不能。對於例如假設我有紅寶石程序(hello.rb),它有一行打印「hello」。我可以通過這樣做來執行這個文件 - >要求「你好」 – abhishek 2010-09-21 12:32:23
@abhishek,這是完全錯誤的。導入時會執行一個python模塊__is__!它將包含的類和函數如何定義? – aaronasterling 2010-09-21 12:48:33
@ AaronMcSmooth - 你是對的。 – abhishek 2010-09-21 13:10:51
- 1. Ruby中的Java CLASSPATH等價於什麼?
- 2. python等價於ruby的__method__?
- 3. python等價於ruby的StringScanner?
- 4. Ruby等價於Python的DictWriter?
- 5. python等價於ruby的`map.with_index`?
- 6. Python`itertools.chain`的Ruby等價物是什麼?
- 7. 在ruby中,python的__file__等價於什麼?
- 8. 在Python中,Ruby的class @@變量等價於什麼?
- 9. python等價於ruby bundler包
- 10. Ruby的等價於Python的多處理模塊是什麼?
- 11. 什麼是Ruby中的「sys.stdout.write()」等價物?
- 12. Python等價於Ruby的包函數
- 13. Ruby中Python的itertools.product的等價物是什麼?
- 14. fromCharCode等價於Ruby
- 15. charCodeAt()等價於Ruby
- 16. Ruby中Python文檔字符串的等價物是什麼?
- 17. Python的等價Ruby的'method_missing'
- 18. Ruby的等價的Python setattr()
- 19. 什麼是Ruby的substr等價物?
- 20. Go defer的ruby等價物是什麼?
- 21. 什麼是preg_quote()的Ruby等價物?
- 22. 什麼是C?:operator的Ruby等價物?
- 23. 什麼是PHP $ _ENV的Ruby等價物?
- 24. 什麼是「pythonic」的Ruby等價物?
- 25. python中'gem'的等價物是什麼?
- 26. Python中imadjust的等價物是什麼?
- 27. python中print_r()的等價物是什麼?
- 28. Python中perluniprops的等價性是什麼?
- 29. 什麼是Twisted Python的Lua等價物,Ruby的Eventmachine,Java的NIO等等?
- 30. 什麼等價於SQL中的strtotime?
什麼的Python教程是您使用? – 2010-09-21 13:35:31