similar script in Python

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • abijiths
    New Member
    • Apr 2007
    • 1

    #1

    similar script in Python

    hi
    My VB SCript is like this

    Function submit
    wait(3)
    Set ws = CreateObject("W Script.Shell")

    ws.Sendkeys"{EN TER}"

    Set ws=nothing
    End Function

    Setting.WebPack age("ReplayType ") = 2
    Browser("iXXXXX XX").Page("InXX XX").Frame("fra BuildInvoiceDet ail").WebEdit(" WebEdit").Set DataTable("Line _Item", dtGlobalSheet)
    Setting.WebPack age("ReplayType ") = 1
    wait(3)
    Set ws = CreateObject("W Script.Shell")
    ws.SendKeys"{DO WN}"
    ws.Sendkeys"{EN TER}"

    how to write a similar code in Python
    thanks in advance
  • ghostdog74
    Recognized Expert Contributor
    • Apr 2006
    • 511

    #2
    2 ways i can think of
    using urllib2 module
    Code:
    #!/usr/bin/python
    import urllib2
    page = urllib2.urlopen("http://www.google.com")
    result = page.read()
    print result
    or webbrowser module. pls see the example at the end of that doc.

    Comment

    • bartonc
      Recognized Expert Expert
      • Sep 2006
      • 6478

      #3
      Originally posted by abijiths
      hi
      My VB SCript is like this

      Function submit
      wait(3)
      Set ws = CreateObject("W Script.Shell")

      ws.Sendkeys"{EN TER}"

      Set ws=nothing
      End Function

      Setting.WebPack age("ReplayType ") = 2
      Browser("iXXXXX XX").Page("InXX XX").Frame("fra BuildInvoiceDet ail").WebEdit(" WebEdit").Set DataTable("Line _Item", dtGlobalSheet)
      Setting.WebPack age("ReplayType ") = 1
      wait(3)
      Set ws = CreateObject("W Script.Shell")
      ws.SendKeys"{DO WN}"
      ws.Sendkeys"{EN TER}"

      how to write a similar code in Python
      thanks in advance
      If you're good in VB, you'll probably want to check out the win32com examples in the PythonWin package.

      Comment

      Working...