Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #20764
| Date | 2012-02-23 17:43 -0500 |
|---|---|
| From | Dave Angel <d@davea.name> |
| Subject | Re: Please verify!! |
| References | <724ccbd6-30d1-41bd-bf38-2a5ce82953a1@x19g2000yqh.googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.101.1330037037.3037.python-list@python.org> (permalink) |
On 02/23/2012 05:13 PM, Manish Sharma wrote: > Hi I am new to python language. On my first day, somebody told me that > if any python script file is opened with any editor except python > editor, the file is corrupted. Some spacing or indentation is changed > and script stops working. I was opening the script file in Windows > using Notepad++ but I didn't save anything and closed it. Still it was > suggested to never open the python file in any other editor. > > Can anybody please verify this? Can opening a python script in any > editor other than python editor corrupt the script? Did anybody ever > face such type of issue or its just misunderstanding of the concept. > > I hope this group is the best place to ask this. Please reply ! > > :) > Manish That is nonsense. I've used at least a dozen text editors, from Windows Notepad to emacs on Linux. And since I know of no program called "python editor," I'm sure none of them was that one. Of course, there are editors that are broken, or can be configured to be broken. I certainly wouldn't try wordpad, even in text mode. But a good editor with a good configuration can be much nicer to use than Notepad. First thing I'd do is to disable tab logic in the editor. When you press the tab key, there's no excuse for an editor to actually put a tab in the file. It should adjust the column by adding the appropriate number of spaces. The main place you get in trouble is when a file has tabs in some lines, and uses spaces for indenting on other lines. Since tabs are not interpreted the same way in various utilities, it's just better not to use them at all. As Amirouche has pointed out, line endings can be inconsistent between different operating systems, and not all editors can handle the differences. But the python compiler/interpreter doesn't care about which line ending is used. One other issue could be files that have non-ASCII characters. Since a text file has no standard way to indicate what format it uses (utf8, ucs2, or dozens of "extended ASCII" encodings), another editor might not deal with it correctly. There is a standard way to indicate to Python how to interpret non-ascii characters, so if you either 1) always use ASCII1 2) always use the same character encoding, or 3) have your editor look for the declaration and honor it, you'd have no trouble. If these problems do occur, they'll be pretty easy to spot. And you can always revert to an earlier version, by using your revision control system. Enabling one of those is about as important as choosing your editor. -- DaveA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Please verify!! Manish Sharma <manish2aug@gmail.com> - 2012-02-23 14:13 -0800
Re: Please verify!! Ben <bungiman@gmail.com> - 2012-02-23 14:29 -0800
Re: Please verify!! Dave Angel <d@davea.name> - 2012-02-23 17:43 -0500
Re: Please verify!! Joshua Miller <milleja46@gmail.com> - 2012-02-23 20:57 -0500
Re: Please verify!! Andrew Berg <bahamutzero8825@gmail.com> - 2012-02-23 21:45 -0600
Re: Please verify!! Ben Finney <ben+python@benfinney.id.au> - 2012-02-24 19:32 +1100
Re: Please verify!! Andrew Berg <bahamutzero8825@gmail.com> - 2012-02-24 03:18 -0600
Re: Please verify!! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-02-24 12:20 +0000
Re: Please verify!! Andrew Berg <bahamutzero8825@gmail.com> - 2012-02-24 07:20 -0600
Re: Please verify!! Chris Angelico <rosuav@gmail.com> - 2012-02-25 07:41 +1100
Re: Please verify!! Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-02-25 00:49 +0000
Re: Please verify!! Chris Angelico <rosuav@gmail.com> - 2012-02-25 12:25 +1100
Re: Please verify!! Dave Angel <d@davea.name> - 2012-02-24 21:36 -0500
Re: Please verify!! Duncan Booth <duncan.booth@invalid.invalid> - 2012-02-24 11:21 +0000
Re: Please verify!! Andrew Berg <bahamutzero8825@gmail.com> - 2012-02-24 05:36 -0600
Re: Please verify!! Andrew Berg <bahamutzero8825@gmail.com> - 2012-02-24 01:26 -0600
Re: Please verify!! Jugurtha Hadjar <jugurtha.hadjar@gmail.com> - 2012-02-24 12:10 +0100
csiph-web