Python in Web Browser

  • (2 Pages)
  • +
  • 1
  • 2

19 Replies - 1324 Views - Last Post: 17 August 2012 - 05:46 PM Rate Topic: -----

#1 toyotajon93  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 04-August 12

Python in Web Browser

Posted 16 August 2012 - 10:59 AM

Hello everyone, I have my python script I wrote that I want to make available on the internet. Is there an easy way or running my python code from the internet or allowing others to run it without needing to install python or see my source code?

I've looked at pyjs, but wont my source code be visible? I also dont think pyjs supports some of the modules I use, urllib2 and json.

Any advice or thoughts are greatly appreciated.

Is This A Good Question/Topic? 0
  • +

Replies To: Python in Web Browser

#2 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Re: Python in Web Browser

Posted 16 August 2012 - 11:08 AM

Can I run Python in a browser? Nope. Browsers don't support Python. You could run it on a server and get user input via web pages and output results in the same way. If you do that, people won't be able to see your source code.

If you decided to distribute your program as a module, that's a little tougher. You could run your code through an obfuscater to make it VERY difficult to decipher, but it'll still be open source (albeit virtually unreadable source). You could also run your code through py2exe to turn it into an executable so that people won't see your source code... but then your cross platform application becomes a windows executable.

Or... you could make it open source. Allow people to see your code and then they can marvel at your programming ability and you'll be more respected in many circles for it.
Was This Post Helpful? 0
  • +
  • -

#3 toyotajon93  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 04-August 12

Re: Python in Web Browser

Posted 16 August 2012 - 11:14 AM

I have tried compling with py2exe but if I send out the exe file the user cannot run it, perhaps I am not compiling it correctly.

Any advice on compiling so I can send one exe file?
Was This Post Helpful? 0
  • +
  • -

#4 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Re: Python in Web Browser

Posted 16 August 2012 - 11:18 AM

We need more details. What version of Python are you using? What version of Py2exe are you using? Do you feel comfortable showing us the script you used to do the compile (not the source code)? Did you get any errors? What exactly happens when you try to run the exe file?
Was This Post Helpful? 0
  • +
  • -

#5 toyotajon93  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 04-August 12

Re: Python in Web Browser

Posted 16 August 2012 - 11:42 AM

I will get all that info once I get home and post it here. I may try building again with py2exe and see.
Was This Post Helpful? 0
  • +
  • -

#6 toyotajon93  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 04-August 12

Re: Python in Web Browser

Posted 16 August 2012 - 06:04 PM

Now that I am home I remember my issues with py2exe.

I cannot get it to install correctly. I have tried python 2.6 and 2.7, I always get the error:

Unable to find vcvarsall.bat on the installation.

I have researched this error and I have a path variable in my system properties.

I think I used IronPython last time to compile the exe and didnt like the results.
Was This Post Helpful? 0
  • +
  • -

#7 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Re: Python in Web Browser

Posted 16 August 2012 - 06:55 PM

why would you use IronPython?
Was This Post Helpful? 0
  • +
  • -

#8 toyotajon93  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 04-August 12

Re: Python in Web Browser

Posted 16 August 2012 - 07:09 PM

Honestly was experimenting and didnt know the differences. Any advice?? im trying pyinstaller now im so frustrated w py2exe. Cant anything be easy for a relative novice haha
Was This Post Helpful? 0
  • +
  • -

#9 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Re: Python in Web Browser

Posted 17 August 2012 - 09:46 AM

Python is meant to be cross platform and readable. It's not easy, nor should it be easy, to violate the fundamental principles on which the language was built.

This post has been edited by atraub: 17 August 2012 - 09:50 AM

Was This Post Helpful? 0
  • +
  • -

#10 toyotajon93  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 04-August 12

Re: Python in Web Browser

Posted 17 August 2012 - 09:48 AM

It was a general statement. lol.

So any advice?

Can I make an exe with pyinstaller within ubuntu?
Was This Post Helpful? 0
  • +
  • -

#11 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Re: Python in Web Browser

Posted 17 August 2012 - 09:53 AM

why are you so concerned with people seeing your source code if you are a novice?

This post has been edited by atraub: 17 August 2012 - 09:53 AM

Was This Post Helpful? 0
  • +
  • -

#12 toyotajon93  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 04-August 12

Re: Python in Web Browser

Posted 17 August 2012 - 09:58 AM

Its a script that automates a few things in a game I play with friends (since we all have kids and families). Dont want anyone changing it and taking credit for it or putting malicious code in it.
Was This Post Helpful? 0
  • +
  • -

#13 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Re: Python in Web Browser

Posted 17 August 2012 - 10:22 AM

put it on github, people will see you made it first.

EDIT:
AND they'll be able to see the lack of malice in the code :)

This post has been edited by atraub: 17 August 2012 - 10:23 AM

Was This Post Helpful? 0
  • +
  • -

#14 toyotajon93  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 04-August 12

Re: Python in Web Browser

Posted 17 August 2012 - 11:28 AM

Alot of the people that want to use it dont know Git, or python, or want to put a script on their computers. I'll talk to those that want it and see. I mainly didnt want them taking it and selling it as a subscription.
Was This Post Helpful? 0
  • +
  • -

#15 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Re: Python in Web Browser

Posted 17 August 2012 - 11:30 AM

If you upload it to git, the user can download it straight through the git site. If your program is written well, your users won't need to know Python. The only one who needs to know how to utilize these technologies will be you.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2