Skip to content

Instantly share code, notes, and snippets.

@luisenriquecorona
Created April 18, 2019 17:34
Show Gist options
  • Save luisenriquecorona/100d223916cbf7e0fdd4d9d89d4e0357 to your computer and use it in GitHub Desktop.
Save luisenriquecorona/100d223916cbf7e0fdd4d9d89d4e0357 to your computer and use it in GitHub Desktop.
Test text Python
>>> f = open('data.txt') >>> text = f.read()
>>> text 'Hello\nworld\n'
>>> print(text) Hello
world
>>> text.split() ['Hello', 'world']
# 'r' (read) is the default processing mode # Read entire file into a string
# print interprets control characters
# File content is always a string
@luisenriquecorona
Copy link
Author

Run Code Python 3.3
Python (command line)
C:\code> python Helloword.py
View
Hello world

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment