IDLE on Windows; save files as UNIX?

J

Jay O'Connor

I'm doing some Python CGI programming under Windows (Win95) but my CGIs need to
run on Linux. If I try to write and save the files in IDLE, they get saved in
DOS format and won't run on the Linux server. If I load the files into another
text editor and explictely "Save As" in UNIX format, they work fine, but the
other editor is not Python aware so I'd rather not have to use if for main
development, and having to load and resave my scripts before uploading to the
server is a bit obnoxious.

Is there any way to for IDLE in Windows to save files in UNIX format?

Note: Pythonwin does not work on my machine so I can't use it as an alternative

Thanks
 
E

Erik Max Francis

Jay said:
Is there any way to for IDLE in Windows to save files in UNIX format?

Probably not, so use or write a script to convert the line endings
before you transfer it. If you're transferring via FTP, you can use
ASCII mode rather than BINARY and it will automatically convert the line
endings for you.
 
K

Kurt B. Kaiser

Jay O'Connor said:
Is there any way to for IDLE in Windows to save files in UNIX format?

Sure, IDLE could be enhanced to do that, but it would be an example of
creeping features IMO. Few people need it and it would clutter the
interface.

You proably have a shebang line at the beginning of the file. Why not
create a "template" with Linux line endings which has this one line.
When IDLE loads it, it will continue with that line ending pattern.
 
P

Paxcal

You can use the UNIX (also in cygwin) command dos2unix and unix2dos command
to do the convertion...

Regards

Paxcal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top