Hi,
I have a python script on a unix system that runs fine. I have a python
script on a windows system that runs fine. Both use tabs to indent
sections of the code. I now want to run them on the same system,
actually in the same script by combining bits and pieces. But whatever
I try my windows tabs get converted to spaces when I transfer it to the
unix system and the interpreter complains that the indentation style is
not consistent throughout the file. Short of going through 350 lines of
code and manually replacing spaces with tabs what an I do? I'm thinking
there surely must be a simple solution I have missed here!
Cheers,
Ben
Dec 27 '06
35 2725
In message <ro************ *************** *****@4ax.com>, Tom Plunket wrote:
Perhaps interestingly, for development I have my editor set to show tabs
as fairly short, but my diff program shows them as eight characters. I
find that makes indentation changes easier to spot in the diffs.
I think there should be a single environment variable, perhaps
called "TABS", which specifies the tab settings across all relevant tools
that work with text, including less and diff. So for example setting this
as
export TABS=4
will cause these tools to treat tabs as equivalent to stepping to the next
multiple of four columns from the start of the line.
Lawrence D'Oliveiro wrote:
I think there should be a single environment variable, perhaps
called "TABS", which specifies the tab settings across all relevant tools
that work with text, including less and diff. So for example setting this
as
export TABS=4
will cause these tools to treat tabs as equivalent to stepping to the next
multiple of four columns from the start of the line.
Maybe I'm also weird, but I use a variable-pitch font when programming
in Python. So a "tab equals some number of spaces" really isn't useful
to me. My setup is, "tab equals this much space".
-tom!
--
On 1/1/07, Tom Plunket <to***@fancy.or gwrote:
Maybe I'm also weird, but I use a variable-pitch font when programming
in Python. So a "tab equals some number of spaces" really isn't useful
to me. My setup is, "tab equals this much space".
A year ago I would have thought you were weird, but after reading a
post by Ed Leafe, one of the creators of Dabo about using proportional
fonts for readability, I thought I'd try it out, thinking that it was
pretty wacky. Turns out that after a very brief adjustment period, I
liked it! I've been using proportional fonts ever since, and have
found only one drawback: code that is indented with spaces looks
butt-ugly. I'm glad I switched to tabs for my code.
--
# p.d.
On 2007-01-02, Peter Decker <py******@gmail .comwrote:
On 1/1/07, Tom Plunket <to***@fancy.or gwrote:
>Maybe I'm also weird, but I use a variable-pitch font when programming in Python. So a "tab equals some number of spaces" really isn't useful to me. My setup is, "tab equals this much space".
A year ago I would have thought you were weird, but after
reading a post by Ed Leafe, one of the creators of Dabo about
using proportional fonts for readability, I thought I'd try it
out, thinking that it was pretty wacky. Turns out that after a
very brief adjustment period, I liked it! I've been using
proportional fonts ever since, and have found only one
drawback: code that is indented with spaces looks butt-ugly.
I'm glad I switched to tabs for my code.
I first came accross it in Stroustrup's _The C++ Programming
Language_. I liked the look and the idea immediately, but my
editor of choice (by historical accident) Vim, doesn't yet
support it.
--
Neil Cerutti
I've had a wonderful evening, but this wasn't it. --Groucho Marx
Peter Decker wrote:
Maybe I'm also weird, but I use a variable-pitch font when programming
in Python. So a "tab equals some number of spaces" really isn't useful
to me. My setup is, "tab equals this much space".
A year ago I would have thought you were weird, but after reading a
post by Ed Leafe, one of the creators of Dabo about using proportional
fonts for readability, I thought I'd try it out, thinking that it was
pretty wacky. Turns out that after a very brief adjustment period, I
liked it!
Yep, I had a similar experience although a bit more forced. The editor
that I was using was configured out-of-the-box with variable-pitch, and
I didn't want to bother figuring out how to change it for the quickie
stuff I was writing, then eventually I found that it no longer bothered
me...
-tom!
--
Tim Roberts wrote:
"Ben" <Be************ *@gmail.comwrot e:
>Great - that worked.Thanks! Is that a general method in linux you can always use to redirect standard output to a file?
Works in Windows, too.
For some value of "work" :)
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
Blog of Note: http://holdenweb.blogspot.com This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Kayle |
last post by:
For preservation of indentation when moving the C source file from Windows
to Linux machine, what is the advice to format the code.
Should the code formatted using spaces instead of tabs?
When opened using nedit in Linux, the indentation was not preserved, or
should we limit the length of each line ?
Any advice on this ? Thanks
|
by: Xah Lee |
last post by:
Tabs versus Spaces in Source Code
Xah Lee, 2006-05-13
In coding a computer program, there's often the choices of tabs or
spaces for code indentation. There is a large amount of confusion about
which is better. It has become what's known as “religious war” —
a heated fight over trivia. In this essay, i like to explain what is
the situation behind it, and which is proper.
|
by: Ben |
last post by:
Hi,
I have a python script on a unix system that runs fine. I have a python
script on a windows system that runs fine. Both use tabs to indent
sections of the code. I now want to run them on the same system,
actually in the same script by combining bits and pieces. But whatever
I try my windows tabs get converted to spaces when I transfer it to the
unix system and the interpreter complains that the indentation style is
not consistant...
|
by: Phil Reynolds |
last post by:
I'm using a tab control in Access 2000, and the user requested to have
buttons in the form header, instead of the built-in tabs (so that when they
scroll down, they can still switch tabs). Now, this works fine. However,
when I'm in Design View, I can't access the tabs without changing the tab
control's Style back to Tabs. But I want to be able to place controls in
that space at the top where the tabs used to be. But if I need to turn the...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| | |