Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
converting .py to .asc
#1
Hello
i have a .py file i want to open it using open() and convert it to .asc file . Am completely new to python. Any help will be appreciated.
Reply
#2
Why do you want to convert the .py file into a .asc file?
Reply
#3
The file already is ASCII, just rename
filename.py to filename.txt

To display the text file using the systems default text viewer:

import webbrowser
webbrowser.open('filename.txt')
(Jul-09-2020, 05:29 PM)ana Wrote: Hello
i have a .py file i want to open it using open() and convert it to .asc file . Am completely new to python. Any help will be appreciated.
Reply
#4
(Jul-10-2020, 10:07 AM)steve_shambles Wrote: The file already is ASCII, just rename
I don't think ASCII has something to do with this.
.asc file extension are script files that have been written in the ActionScript programming language.

So @Gribouillis why question is something i also wonder about.
Can look at code in .py and try to rewrite in ActionScript,but then use Python open() i can't make sense of.
Reply
#5
Oh dear looks like I misunderstood, sorry.

(Jul-10-2020, 12:28 PM)snippsat Wrote:
(Jul-10-2020, 10:07 AM)steve_shambles Wrote: The file already is ASCII, just rename
I don't think ASCII has something to do with this.
.asc file extension are script files that have been written in the ActionScript programming language.

So @Gribouillis why question is something i also wonder about.
Can look at code in .py and try to rewrite in ActionScript,but then use Python open() i can't make sense of.
Reply


Forum Jump:

User Panel Messages

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