@SnoopJeDi/

EmotionalInterestingLogic

Python

No description

fork
loading
Files
  • main.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.6494490094749159","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"bDEgPSBbdSdGb3Jnb3QgeW91ciBwYXNzd29yZD9cbkZvcmdvdCB5b3VyIGNvbXB1dGluZyBJRD9cbkNvbXB1dGluZyBJRCBNYW5hZ2VtZW50XG5teUxpYnJhcnknLCB1J05hbWU6ICNGSUxMRVIjXG5Db21tb24gTmFtZTogI0ZJTExFUiNcblJvbGVzOiBVbmRlcmdyYWRcbkRlcHQ6XG5QaG9uZTpcbkV4dGVybmFsIEVtYWlsOlxuU0ZVIElEOiAjRklMTEVSI1xuTGlicmFyeSBCYXJjb2RlOiAjRklMTEVSI1xuQWNjb3VudCBpcyBzcG9uc29yZWQ6IE5vXG5BY2NvdW50IGlzIGxpZ2h0d2VpZ2h0OiBOb1xuQWNjb3VudCBleHBpcnk6JywgdSIjRklMTEVSI1xuVG8gcHJvdGVjdCB5b3VyIHByaXZhY3ksIHF1aXQgdGhlIGJyb3dzZXIgd2hlbiB5b3UncmUgZmluaXNoZWQuXG5Mb2dvdXQiXQoKbDIgPSBbdSdDdXJyZW50IE1haWxpbmcgQWRkcmVzc1xuSG9tZS9QZXJtYW5lbnQgQWRkcmVzc1wjRklMTEVSI1wjRklMTEVSI1xuTm9uZVxuTWFpbiBQaG9uZSBOdW1iZXJcblNGVSBFbWFpbCBBZGRyZXNzXG5Ob25lXCNGSUxMRVIjJ10KCmZvciBzIGluIGwxOgogIGlmIHMubG93ZXIoKS5zdGFydHN3aXRoKCduYW1lJyk6CiAgICBuYW1lID0gcy5zcGxpdCgpWzFdICAjIHRoZSBuYW1lIGlzIGJldHdlZW4gYSBzcGFjZSBhbmQgYSBuZXdsaW5lLCBzbyBzcGxpdCgpIHdpbGwgaGl0IGJvdGggYW5kIG5lYXRseSBwYXJ0aXRpb24gdGhlIGRhdGEgd2Ugd2FudAogICAgcHJpbnQoZiduYW1lOiB7bmFtZX0nKQoKZm9yIHMgaW4gbDI6CiAgaWYgcy5sb3dlcigpLnN0YXJ0c3dpdGgoJ2N1cnJlbnQgbWFpbGluZyBhZGRyZXNzJyk6CiAgICBhZGRyID0gcy5zcGxpdCgnXG4nKVsxXS5sc3RyaXAoJ0hvbWUvUGVybWFuZW50IEFkZHJlc3NcXCcpICMgaWYgdGhlcmUncyBhIHNwYWNlIG9yIG90aGVyIGRlbGltaXRpbmcgY2hhcmFjdGVyLCB3ZSBjYW4gYmUgbW9yZSBjbGV2ZXIgaGVyZS4uLgogICAgcHJpbnQoZidhZGRyZXNzOiB7YWRkcn0nKQ=="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
l1 = [u'Forgot your password?\nForgot your computing ID?\nComputing ID Management\nmyLibrary', u'Name: #FILLER#\nCommon Name: #FILLER#\nRoles: Undergrad\nDept:\nPhone:\nExternal Email:\nSFU ID: #FILLER#\nLibrary Barcode: #FILLER#\nAccount is sponsored: No\nAccount is lightweight: No\nAccount expiry:', u"#FILLER#\nTo protect your privacy, quit the browser when you're finished.\nLogout"]

l2 = [u'Current Mailing Address\nHome/Permanent Address\#FILLER#\#FILLER#\nNone\nMain Phone Number\nSFU Email Address\nNone\#FILLER#']

for s in l1:
  if s.lower().startswith('name'):
    name = s.split()[1]  # the name is between a space and a newline, so split() will hit both and neatly partition the data we want
    print(f'name: {name}')

for s in l2:
  if s.lower().startswith('current mailing address'):
    addr = s.split('\n')[1].lstrip('Home/Permanent Address\\') # if there's a space or other delimiting character, we can be more clever here...
    print(f'address: {addr}')