473,324 Members | 1,646 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Getting indented code snippets into blogger

I got tired of Bloggers inadequate comment editor so wrote this for
transforming code snippets:

=========================
'''
blogspace.py
Turns leading spaces into HTML &nbsp tokens which shows
as correct indentation on Blogger comment fields
(and maybe other blogs).

Donald. 'Paddy' McCarthy Sept 2011
'''
import fileinput, re
for l in fileinput.input():
print re.sub(r'^(\s*)\s',
lambda m: ' '*m.end(),
l.rstrip())
=========================

If you find it works on other blogs then please reply.to this thread.

- Paddy.

Sep 18 '07 #1
0 1025

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

Similar topics

11
by: Aurélien Géron | last post by:
Hi, Does anyone know where I can find a lot of Python code snippets? I searched the Python wiki and Internet but could not find more than five or ten code snippets at a time. I'm looking...
2
by: Ergobob | last post by:
Hello, I have a blog and RSS Feed running through Blogger and FeedBurner, respectively. I use the BlogIt button on the Google toolbar to post new items to the blog. If I create a second blog...
3
by: Spartanicus | last post by:
How to get help from this group, and how to construct a minimised test case: http://www.spartanicus.utvinternet.ie/help_us_help_you.htm -- Spartanicus
2
by: - Steve - | last post by:
I'm working on my asp.net site and I'm wondering what the best way to reuse little snippets of code is? Right now I have a Class in it's own cs file that I call Snippets. Then when I want to...
15
by: Brady Love | last post by:
I am currently working an an app that will post and edit blogs on blogger. Right now I have it so I can recive a list of the blogs and the content of those blogs using Atomizer. This is my first...
2
by: Pete.Cloth | last post by:
Can someone please help me with this. I need to align a picture onto a "blogger"? HELP!
5
by: pauldepstein | last post by:
#include "../require.h" What does ../ mean here? Thank you, Paul Epstein
13
by: frk.won | last post by:
I am interested in learning how to use the VS 2005 code snippets. However, I wish to know what are the best ways to source control the code snippets? Are there any source safe/subversion...
0
by: talluri | last post by:
Hi, I am new to this.Before explaining my problem i would like you guys watch this site. http://www.blogger.com,register in the site and try to post one artilce ,while posting you can...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.