Results 1 to 5 of 5

Thread: Python

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2006
    Location
    MI
    Posts
    1,958

    Python

    Any python programmers here? I need help converting some python code to VB.net...

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,673

    Re: Python

    Yes-ish.

    I try to avoid it as much as possible because why in God's green earth would a programming language rely on whitespace. But I am familiar with it.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  3. #3
    Fanatic Member 2kaud's Avatar
    Join Date
    May 2014
    Location
    England
    Posts
    981

    Re: Python

    I try to avoid it as much as possible because why in God's green earth would a programming language rely on whitespace
    Seconded!
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  4. #4
    Addicted Member
    Join Date
    Jul 2022
    Posts
    169

    Re: Python

    While these converters aren't 100%, it may help to get you going in the right direction https://www.codeconvert.ai/python-to-vb.net-converter

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2006
    Location
    MI
    Posts
    1,958

    Re: Python

    I'm trying to convert the following python code snippet into the equivalent VB.net code:


    Code:
    url="http://line.greatstar.me/portal.php?type=stb&action=handshake&prehash=false&JsHttpRequest=1-xml"
    
    useragent="Mozilla/5.0 (QtEmbedded; U; Linux; C) AppleWebKit/533.3 (KHTML, like Gecko) MAG200 stbapp ver: 4 rev: 2721 Mobile Safari/533.3"
    
    header={
    "User-Agent":useragent ,
    "Referer": "http://line.greatstar.me/c/" ,
    "Accept": "application/json,application/javascript,text/javascript,text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" ,
    "Cookie": "mac=00%3A1A%3A79%3A38%3A83%3AD0; stb_lang=en; timezone=Europe/Paris;" ,
    "Accept-Encoding": "gzip, deflate" ,
    "Connection": "Keep-Alive" ,
    "X-User-Agent":"Model: MAG254; Link: Ethernet"
    }
    
    res = ses.get(url, headers=header, timeout=15, verify=False)
    I think the equivalent to ses.get() in .Net would be HttpClient.Get(), but I'm not sure. Any help would be greatly appreciated. Thanks...
    Last edited by nbrege; Dec 11th, 2023 at 08:41 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width