我来自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