Difference in writing method to read external source code between Ruby and Python

What is this?

When writing a program in both Ruby and Python, the way to read the external source code may be confused as "Which is which?". It is a memorandum for such a case.

For Ruby

python


require './foobar'

For Python

python


from . import foobar

In the case of Python, there are related concepts such as "packages", but this time I will not touch on those items.

Recommended Posts

Difference in writing method to read external source code between Ruby and Python
Difference in how to write if statement between ruby ​​and python
Difference between Ruby and Python in terms of variables
Difference between Ruby and Python split
Difference between list () and [] in Python
Difference between == and is in python
[Python] Difference between function and method
List concatenation method in python, difference between list.extend () and “+” operator
Differences between Ruby and Python in scope
Difference between @classmethod and @staticmethod in Python
Difference between append and + = in Python list
Difference between nonlocal and global in Python
[Python] Difference between class method and static method
[python] Difference between variables and self. Variables in class
About the difference between "==" and "is" in python
Difference between return, return None, and no return description in Python
Tips for coding short and easy to read in Python
How to execute external shell scripts and commands in python
PyArmor ~ Easy way to encrypt and deliver python source code ~
Difference between java and python (memo)
Reading and writing text in Python
[Python] Read the Flask source code
Python --Difference between exec and eval
[Python] Difference between randrange () and randint ()
[Python] Difference between sorted and sorted (Colaboratory)
Create and read messagepacks in Python
Read big endian binary in Python and convert it to ndarray
Articles to read when Blender Python script code doesn't work in 2.80
File open function in Python3 (difference between open and codecs.open and speed comparison)
I tried to find out the difference between A + = B and A = A + B in Python, so make a note
Differences in authenticity between Python and JavaScript
Method to build Python environment in Xcode 6
[Introduction to Python] What is the difference between a list and a tuple?
How to write the correct shebang in Perl, Python and Ruby scripts
Big difference in ruby, python, httpd performance
Differences in syntax between Python and Java
Difference between PHP and Python finally and exit
How to get the date and time difference in seconds with python
Sample code to get the Twitter API oauth_token and oauth_token_secret in Python 2.7
Read Python csv and export to txt
Read and write JSON files in Python
[Python Iroha] Difference between List and Tuple
[python] Difference between rand and randn output
Differences in multithreading between Python and Jython
Differences between Ruby and Python (basic syntax)
How to use is and == in Python
How to write Ruby to_s in Python
How to generate a QR code and barcode in Python and read it normally or in real time with OpenCV
Differences in string processing between Python, Ruby, JS, PHP (combination and variable expansion)
Sorting AtCoder ARC 086 C hashes to solve in Ruby, Perl, Java and Python
[Python] How to name table data and output it in csv (to_csv method)
[Python] Read the source code of Bottle Part 2
Instant method grammar for Python and Ruby (studying)
How to generate permutations in Python and C ++
Personal notes to doc Python code in Sphinx
[Python] How to read data from CIFAR-10 and CIFAR-100
To dynamically replace the next method in python
Reading and writing CSV and JSON files in Python
Send messages to Skype and Chatwork in Python
[Python] Read the source code of Bottle Part 1
Method to convert between Western calendar and Japanese calendar