Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
jupyter-naas
GitHub Repository: jupyter-naas/awesome-notebooks
Path: blob/master/FEC/FEC_Lecture_des_fichiers.ipynb
2973 views
Kernel: Python 3

FEC.jpg

FEC - Lecture des fichiers

Give Feedback | Bug report

Tags: #fec #lecture #fichiers #python #data #analyse

Last update: 2023-05-24 (Created: 2023-05-24)

Description: This notebook will show how to read files with Python and how it is usefull for organization.

Input

Import libraries

import os

Setup Variables

  • file_name: Name of the file to read

  • file_path: Path of the file to read

file_name = "example.txt" file_path = os.path.join(os.getcwd(), file_name)

Model

Read file

Long description of the function to read a file without break.

# Open the file file_object = open(file_path, "r") # Read the file file_content = file_object.read() # Close the file file_object.close()

Output

Display result

print(file_content)