473,770 Members | 4,029 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

auto indent

Hi there;

i have a script that is not indented properly. Is there a way that i can
have it auto indented.

thanks
moe smadi
Nov 6 '06 #1
5 1986
M.N.Smadi wrote:
Hi there;

i have a script that is not indented properly. Is there a way that i can
have it auto indented.

thanks
moe smadi
Not really. Indention in python conveys blocks so there is no way
anything automatic could determine where blocks end. Its just like
asking if you could have something automatically insert parenthesis
everywhere they are needed.

-Larry
Nov 6 '06 #2
M.N.Smadi wrote:
Hi there;

i have a script that is not indented properly. Is there a way that i can
have it auto indented.

thanks
moe smadi
Not really. Indention in python conveys blocks so there is no way
anything automatic could determine where blocks end. Its just like
asking if you could have something automatically insert parenthesis
everywhere they are needed.

-Larry

Nov 6 '06 #3

M.N.Smadi wrote:
Hi there;

i have a script that is not indented properly. Is there a way that i can
have it auto indented.

thanks
moe smadi
It depends what exactly you mean. I use Textpad and they have an
"indent selected block" feature.

Nov 6 '06 #4
M.N.Smadi wrote:
Hi there;

i have a script that is not indented properly. Is there a way that i can
have it auto indented.
It depends on what you mean by "not indented properly". Indentation is
part of the Python grammar.

If the script compiles OK, and works as expected, but you have (say)
4-space indent in parts, and 3-space in other parts, or a mixture of
tabs and spaces, you could use the supplied reindent script. It's
C:\Python25\Too ls\Scripts\rein dent.py on my machine. Do read the
documentation at the start of the script before you run it.

If you mean that the indentation is just plain wrong, such that the
script will not compile without error, or incorrect indentation of one
or more lines is causing incorrect results, then you will have to fix
it manually. There is no "artificial intelligence" that can work out
what the indentation should be.

HTH,
John

Nov 7 '06 #5
M.N.Smadi wrote:
i have a script that is not indented properly. Is there
a way that i can have it auto indented.
FWIW the Zeus for Windows IDE will fold Pyhon code:

http://www.zeusedit.com/features.html

With the code folded you can then select the folded line and
using 'tab'/'shift tab' Zeus will indent/re-indent all the
lines contained in the fold.

It is not an automatic re-indenting solution but it might be
better than nothing ;)

Jussi Jumppanen
Author: Zeus for Windows IDE

Nov 9 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
4147
by: John Wellesz | last post by:
If you are coding php using GVIM, you will appreciate this new indent script: Download there: http://www.vim.org/scripts/download_script.php?src_id=3710 or here: http://www.2072productions.com/vim/indent/php.vim
4
4610
by: Alex Bell | last post by:
I am developing at http://www.members.iinet.net.au/~abell1/test/index.htm with city.css at http://www.members.iinet.net.au/~abell1/test/city.css. Both validate. In index.htm there is a block of text that I want to be centered and left justified. I have used this technique <p class="indent"> 11 Frederick Street<br /> Launceston<br />
6
6700
by: Harlan Messinger | last post by:
A publication style guide indicates that for a table heading like the following, Table 3. Wheat and rye harvest in European countries in years that end in 3 or 7 or when a new prime minister takes office. when the heading flows over more than one line, a hanging indent should be used, such that the remainder of the heading should be left-aligned, in this example, with "Wheat", leaving "Table 3. " standing off by itself on the left.
1
1239
by: Zorpiedoman | last post by:
I have many different projects and solutions I am working on. All but one of them work fine. One of them, for a reason I can't figure out, has stopped 'auto formatting' as I work in the development environment... Things don't auto-indent, auto-fill does not work, etc. Once I compile the program, it fixes everything, but it's kind of a pain to keep doing this... is there some setting that got changed somewhere I don't know about? --...
3
2473
by: Robin Tucker | last post by:
Hi there, I have this really frustrating problem with Visual Studio (Microsoft Visual Basic .NET 2003 69586-335-0000007-18843). I have got used to using the autocomplete and auto indent features of this excellent source editor but recently it has only operated on some of my source files and not others. I have made sure the settings in "tools->options->text editor" are set correctly but to no avail. For example, hitting enter at the...
7
2515
by: Aaron | last post by:
I like some of the auto-formatting features of VB.NET (god help me) but I really prefer to use CSharp (C#) is there any way to get the features of auto-indenting, auto-capitalization, and advanced intellisense like VB does?
5
2967
by: Divvy Ballacks | last post by:
Hello, does anyone know of such a freebie. If so a link would be much appreciated.
0
1003
by: Jack | last post by:
How to enable the auto indent function in visual studio? For example: void f() { for(int i = 0; i < 10; i++) { cout << a; //When I type this line, indent automatically. }
18
4629
by: MNNovice | last post by:
I have a table called tblFunds with these fields: FundID (PK / Auto), FundNo (Text), FundDescr(Text), GrantNo (Text). In a form I have several fields that came from different tables. Two of the fields came from the tblFunds: FundID (Name: cboFund) and GrantNo (txtGrant). I have this After Update Event for FundID: Private Sub cboFund_AfterUpdate() Me.txtGrant = Me.cboFund.Column(3) End Sub But it’s not populating the Grant...
0
9439
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,...
0
10237
Oralloy
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...
0
10071
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8905
agi2029
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 project—planning, coding, testing, and deployment—without 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...
1
7431
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6690
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();...
0
5326
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...
2
3589
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2832
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.