So I have a very interesting task ahead of me and it is to loop through an email using the 'gmail dot trick'. Essentially this trick puts periods throughout your email to make it look different. Even though it has periods gmail will replace them all and send it to that email.
<br><br>So <a href="mailto:blah@gmail.com">blah@gmail.com</a> is the same as <a href="mailto:bl.ah@gmail.com">bl.ah@gmail.com</a>.<br><br>My task is this: Loop through an email and create as many combinations of periods as possible. So all the combinations for blah would be:
<br><br>b.lah<br>bl.ah<br>bla.h<br>b.l.ah<br>b.la.h<br>bl.a.h<br><br>I'm still rather new to python so this is turning out to be rather tricky. My current code is as follows:<br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
for d in range(1, len(email)):<br>    for i in range(1, len(email)):<br>        y = i<br>        temail = email<br>        for x in range(d):<br>            if email[y] == '.': break<br>            temail = temail.replace
(email[y], '.' + email[y])<br>            if not y > len(email) - 2: y += 1<br>        print temail<br></blockquote><br>It's not looking too bad except for some reason it's making emails like bl..ah which is invalid. So can anyone help me out with getting this to work? Thanks.
<br><br>Cheers,<br>Josh<br>