Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Insert scrypt inside file.py ?
#11
JohnnyCoffee Wrote:How do I insert any python script into file2.py ?
You can do
from pathlib import Path

Path('file2.py').write_text(
"""
print("hello world, I'm file2.py")
""")
Reply
#12
(Oct-06-2019, 08:13 PM)Gribouillis Wrote:
JohnnyCoffee Wrote:How do I insert any python script into file2.py ?
You can do
 from pathlib import Path Path('file2.py').write_text( """ print("hello world, I'm file2.py") """) 
Thanks.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020