Offline download vs code plugin Python source

Source: Internet
Author: User

1 ImportArgparse2 ImportOS3 ImportRequests4 5 6HEADERS = {7     'user-agent':'mozilla/5.0 (Windows NT 10.0; WOW64) applewebkit/537.36'8                   '(khtml, like Gecko) chrome/56.0.2924.87 safari/537.36'9 }Ten  OneExt_url="https://{0}.gallery.vsassets.io/_apis/public/gallery/publisher/{1}/extension/{2}/{3}/assetbyname/ Microsoft.VisualStudio.Services.VSIXPackage" A  - defDownload_ext (publisher,name,ver): -Url=Ext_url.format (publisher,publisher,name,ver) the     Print(URL) -Res=requests.get (url,headers=HEADERS) - res.raise_for_status () -Playfile = open (publisher+'.'+name+'. VSIX','WB')   +      forChunkinchRes.iter_content (1024):   - Playfile.write (Chunk) + playfile.close () A  at  - defarg_parse (): -Parse=argparse. Argumentparser (description='vscode Extension Download CLI Tools') -Parse.add_argument ("- I.",'--identifier', type=str,help='Extension Unique identifier') -Parse.add_argument ('- v','--version', type=str,help='Extension Version') -     returnParse in  - defcommand_parse (): toParse=Arg_parse () +args=VARs (Parse.parse_args ()) -     Print(args) the  *key=args["identifier"] $ Panax NotoginsengIndex=key.find ('.') -Publisher=Key[:index] theName=key[index+1:] +Download_ext (publisher,name,args['version']) A     the  + if __name__=="__main__": - Command_parse () $            

Offline download vs code plugin Python source

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.