Skip to content

Instantly share code, notes, and snippets.

@almorel
Last active August 29, 2015 14:13
Show Gist options
  • Save almorel/4c5e8ccf643bb21c1096 to your computer and use it in GitHub Desktop.
Save almorel/4c5e8ccf643bb21c1096 to your computer and use it in GitHub Desktop.
import requests
import re
data = requests.get('', cookies={'PHPSESSID': ''})
match=re.search('.*U<sub>n\+1</sub> = \[ (?P<A>[-0-9]+) (?P<a>[+-]) U<sub>n</sub> ] (?P<b>[+-]) \[ n \* (?P<B>[-0-9]+) ]<br />\nU<sub>0</sub> = (?P<C>[-0-9]+)\n<br /> Trouver le terme n&deg;(?P<D>[-0-9]+).*', data.text)
print("Decode equation")
a="U(n+1) = ( " + match.group('A') + " " + match.group('a') + " " + "U(n)" + " ) " + match.group('b') + " ( " + "n" + " " + "*" + " " + match.group('B') + " )"
b="U0="+match.group('C')
c="n="+match.group('D')
print(a)
print(b)
print(c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment