473,385 Members | 1,983 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,385 software developers and data experts.

Re: Getting a unknown word out of a list with no spaces

>>s = '--a href="/browse/brick"--brick--/a--'
>>s
'--a href="/browse/brick"--brick--/a--'
>>''.join('<%s>' % l if i % 2 == 1 else l for i, l in
enumerate(s.split('--')))
'<a href="/browse/brick">brick</a>'

Jul 17 '08 #1
0 645

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

Similar topics

303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
3
by: Adam | last post by:
How is best to extract word strings from a line = infile.readline() I wish to quickly check the first word of each line of a text file. Indeed, How do I break a lineinput() line into...
9
by: Steven Bethard | last post by:
I've got a list of word substrings (the "tokens") which I need to align to a string of text (the "sentence"). The sentence is basically the concatenation of the token list, with spaces sometimes...
7
by: onetitfemme | last post by:
Hi, for some reason Firefox is apparently inserting a new line somehow after some IPA symbols which I have written in their hexadecimal notation. Also, I would like to have two spaces by...
1
by: biznitchil | last post by:
it is a bit jacked up, but copy and paste it into an IDE(i use jGRASP) plz help me...it worked just fine before I added the menu..you can e-mail me if you have any <Removed> import java.util.*; ...
6
by: nagar | last post by:
I need to get the list of Autocorrect entries in word. Is there a way to do it without connecting to Word? Is the list saved somewhere? If I need to connect to Word, how can I detect if it's...
1
by: desivirus | last post by:
hi admin.. i followed your tip in "HOW TO LIST PROCESS ID IN WINDOWS" thread..and iam trying to compile this code in cygwin , $gcc -mno-cygwin process.c -o -L"psapi.lib" process.exe psapi.h...
11
by: arnuld | last post by:
C takes input character by character. I did not find any Standard Library function that can take a word as input. So I want to write one of my own to be used with "Self Referential Structures" of...
0
by: Alexnb | last post by:
Hello Lets say I have a string: --a href="/browse/brick"--brick--/a-- The -- needs to be replaced with < or where applicable. and I want the "brick" out of that string (the second brick...
0
by: Alexnb | last post by:
Alexandr N Zamaraev wrote: I'm sorry, I don't think I was being clear. I replaced the <'s with -- so it would post online w/o actually making a link. I just need to know how to get the "brick"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.