-2

I've got a script in python to run in pythonista on my iPhone. I am trying to change a URL of the form: https://www.evernote.com/shard/s2/sh/xxx/yyy to a URL of the form: evernote:///view/79211/s2/xxx/xxx/

It all seems to be working fine except for the replace command. I get the following error: TypeError: replace() takes at least 2 arguments (1 given)

Could anyone tell me what I'm doing wrong?

The code is as follows:

import clipboard
import sys
import webbrowser
import console
import urllib

mytext = (sys.argv[1])
head, sep, tail = mytext.rpartition('/')
parttwo = head.replace('https://www.evernote.com/shard/s2/sh/' '')
evernoteurl = ('evernote:///view/79211/s2/' + parttwo + '/' + parttwo + '/')

webbrowser.open('drafts://x-callback-url/create?text=' + evernoteurl + '&action=Copy%20to%20Clipboard')
4

1 回答 1

1

您显然缺少逗号

parttwo = head.replace('https://www.evernote.com/shard/s2/sh/' '')

parttwo = head.replace('https://www.evernote.com/shard/s2/sh/', '')
于 2013-10-14T08:10:29.017 回答