Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #51648 > unrolled thread

Re: Script that converts between indentation and curly braces in Python code

Started byJoel Goldstick <joel.goldstick@gmail.com>
First post2013-07-31 08:37 -0400
Last post2013-07-31 08:37 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Script that converts between indentation and curly braces in Python code Joel Goldstick <joel.goldstick@gmail.com> - 2013-07-31 08:37 -0400

#51648 — Re: Script that converts between indentation and curly braces in Python code

FromJoel Goldstick <joel.goldstick@gmail.com>
Date2013-07-31 08:37 -0400
SubjectRe: Script that converts between indentation and curly braces in Python code
Message-ID<mailman.18.1375274285.1251.python-list@python.org>
On Tue, Jul 30, 2013 at 11:45 PM, Musical Notation
<musicdenotation@gmail.com> wrote:
> Is there any script that converts indentation in Python code to curly braces? The indentation is sometime lost when I copy my code to an application or a website.

I guess you could google that.

What do you mean that indentation is 'sometimes' lost when copying.  I
think you should walk down that path to understand why you are losing
your indentation.  It could be you are using tabs instead of spaces
for indentation.  It could also be that you are inserting your code
directly into HTML which of course will eat the extra whitespace.
That problem can be solved with <pre> tags, or maybe even <code> (but
I am not sure about that)

If you are copying code to a website like stack exchange you need to
precede each line of code with  (2 I think!) spaces.  They use
markdown.

If you wanted to add in curly braces, I am guesses the only purpose
for this would be that you would convert them back to proper
indentation in the copied to environment.  So then you have to figure
out a way to do that.



> --
> http://mail.python.org/mailman/listinfo/python-list



-- 
Joel Goldstick
http://joelgoldstick.com

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web