Not sure about the Python ones, but the Ruby read/write file examples aren't quite fully done/correct here:
# Equivalent of file_put_contents() in PHP
# This could also be used for appending if the correct mode is specified.
File.open("filename", "w") { |f| f.write("some data") }
# Equivalent of file_get_contents() in PHP
some_var = File.read("filename")