Python Forum
sys.executable python 2.7 vs 3.6
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sys.executable python 2.7 vs 3.6
#5
This web.py script runs fine in both 2.7 and 3.6.
import webbrowser

def websites():
    new = 2
    choice = input('Type site name:\n> ') # I have raw_input here to run in 2.7
    site = choice
    url1 = 'www..com'
    url = 'http://' + url1[:4] + site + url1[4:]
    webbrowser.open(url,new)

if __name__ == "__main__":
    websites()
I do have both programs in the same directory so I don't know why the one won't open the other in 3.6.
Reply


Messages In This Thread
sys.executable python 2.7 vs 3.6 - by mcmxl22 - Jan-03-2017, 09:05 PM
RE: sys.executable python 2.7 vs 3.6 - by wavic - Jan-03-2017, 09:33 PM
RE: sys.executable python 2.7 vs 3.6 - by snippsat - Jan-03-2017, 09:44 PM
RE: sys.executable python 2.7 vs 3.6 - by nilamo - Jan-04-2017, 03:21 PM
RE: sys.executable python 2.7 vs 3.6 - by mcmxl22 - Jan-04-2017, 05:27 PM
RE: sys.executable python 2.7 vs 3.6 - by snippsat - Jan-04-2017, 09:46 PM
RE: sys.executable python 2.7 vs 3.6 - by mcmxl22 - Jan-04-2017, 10:19 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to compile a Python script for a Windows / Linux executable? netanelst 2 1,378 May-24-2022, 07:02 AM
Last Post: netanelst
  Python executable Script (Wrapper) Hwang 2 1,943 Jan-12-2022, 06:53 PM
Last Post: Hwang
  No module named '_cffi_backend' error with executable not with python script stephanh 2 5,790 Nov-25-2021, 06:52 AM
Last Post: stephanh
  Python 3.7, Windows 10, pyinstaller, winsound, no sound in executable kmarien 3 3,732 Nov-30-2020, 04:10 PM
Last Post: buran
  Make a Python program executable in Windows Pedroski55 1 2,148 Sep-26-2020, 12:34 AM
Last Post: bowlofred
  How to keep a loop containing a web import working in python executable? coder1384 3 2,927 Feb-22-2020, 06:49 PM
Last Post: snippsat
  Error while trying to see Python version with "sys.executable" karkas 5 6,092 Feb-09-2020, 01:55 AM
Last Post: karkas
  Best method: Python script called from another app, package as complete executable ironfelix717 2 2,180 Jul-24-2019, 07:39 AM
Last Post: DeaD_EyE
  Package python script which has different libraries as a single executable or script tej7gandhi 1 2,662 May-11-2019, 08:12 PM
Last Post: keames

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020