• Courses
  • Code Compiler
  • Discuss
  • Pricing
  • Teams
Menu
+ 2
You can just open it like a text file, for example: file = open('path/pythonfile. py') string = file.read() file.close() Then you have the text in the python file ready as a long string.
4th Aug 2018, 10:37 AM
HonFu
HonFu - avatar

Often have questions like this?

Learn more efficiently, for free:

  • Introduction to Python

    7.1M learners

  • Introduction to Java

    4.7M learners

  • Introduction to C

    1.5M learners

  • Introduction to HTML

    7.5M learners

See all courses
Hot today
How do I spawn random obstacles in my game if I'm using canvas?
2 Votes
Negative indexed, while positive indexed, slices
1 Votes
How to do a game
0 Votes
GitHub
0 Votes
What could i use c# and c++ for?
1 Votes
the language in Arabic is wrong the English words with the Arabic words make faults please fix this problem fastest you can
1 Votes
Hey Guys, How to learn PHP in sololearn???
0 Votes
ÂżCĂłmo puedo aprender esto no entiendo del todo?
0 Votes
Are there sounds in lessons?
0 Votes
Which language to start with
1 Votes