Apr-10-2024, 07:07 AM
(This post was last modified: Apr-10-2024, 07:32 AM by Gribouillis.)
hello
There is a string below.
FTP://21.105.28.15/abc/test1.txt
Cut this string
/abc/
I just want to get the path.
How do I parse the string?
There is a string below.
FTP://21.105.28.15/abc/test1.txt
Cut this string
/abc/
I just want to get the path.
How do I parse the string?
import pymssql conn = pymssql.connect('10.21.100.21', 'sa', 'abc', 'DBA', as_dict=False) cur = conn.cursor() cur.execute('select path From table') fetch = cur.fetchall() for i in fetch: print (i) <==== FTP://21.105.28.15/abc/test1.txt (Cut this string /abc/ I just want to get the path.) conn.close()
Gribouillis write Apr-10-2024, 07:32 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.