python window open please

 
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI
View previous topic :: View next topic  
Author Message
garyanderson
-


Joined: 08 Apr 2004
Posts: 40

PostPosted: Fri May 07, 2004 9:05 pm    Post subject: python window open please Reply with quote

on my web site I want to make a link to a python program that when the user clicks it it will execute a python program. I saw this somewhere before, but i'm not sure how it was done. i tried to simple set a href = prog.py, and i've configured my web server to accept that extension, but i keep getting an internal 500 error.

Any ideas how to do this.
Back to top View user's profile Send private message Yahoo Messenger
nquin321
-


Joined: 29 Jan 2004
Posts: 296
Location: Right Behind You

PostPosted: Fri May 07, 2004 9:15 pm    Post subject: Reply with quote

Try following this tutorial:

http://www.aprelium.com/forum/viewtopic.php?t=1222
_________________
How many forum members does it takes to change a light bulb?
Back to top View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Fri May 07, 2004 9:23 pm    Post subject: Reply with quote

Download one of the Python versions
does it execute the script ?

http://vhosting.cjb.net
Back to top View user's profile Send private message Visit poster's website
garyanderson
-


Joined: 08 Apr 2004
Posts: 40

PostPosted: Fri May 07, 2004 9:59 pm    Post subject: Reply with quote

nquin321 wrote:
Try following this tutorial:

http://www.aprelium.com/forum/viewtopic.php?t=1222



Try reading my question.


to truspunk: yeah, the cgi output is fine. i use python reguralry for cgi stuff and web development. i just want the user to be able to have a dos shell pop up with my python program. thats all.
Back to top View user's profile Send private message Yahoo Messenger
nquin321
-


Joined: 29 Jan 2004
Posts: 296
Location: Right Behind You

PostPosted: Fri May 07, 2004 10:34 pm    Post subject: Reply with quote

I tried to read your question:

Quote:
on my web site I want to make a link to a python program that when the user clicks it it will execute a python program.


that doesn't sound like you want a dos shell to pop-up
_________________
How many forum members does it takes to change a light bulb?
Back to top View user's profile Send private message
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Sat May 08, 2004 12:08 am    Post subject: Reply with quote

It depends on how you have it set up. This python file is supposed to run on the user's system, and not execute on the webpage, correct? If you want a user to locally run a python script that is stored on your server, and you have python installed, you will need to put it in a zip, or make a PHP script that forces the user to download it. Also, for a user to run a python program, they must have python installed on their system.

The whole issue about "making it pop up in a little box" is something different...
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
garyanderson
-


Joined: 08 Apr 2004
Posts: 40

PostPosted: Sat May 08, 2004 7:01 am    Post subject: Reply with quote

actualy i want it to execute on the web page. is that not possible. thye make a call to the scipt i have it stored and abyss has the interpreter and it executes. why can that not be done?
Back to top View user's profile Send private message Yahoo Messenger
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Sat May 08, 2004 7:14 am    Post subject: Reply with quote

No, you can do that. Set up the Python interpreter just as you would another interpreter to interpret files with the extention "py" or anything of your choice.
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
garyanderson
-


Joined: 08 Apr 2004
Posts: 40

PostPosted: Sat May 08, 2004 7:56 pm    Post subject: Reply with quote

Thanks for the reply. That is what i thought. i have my server set up to except the following eextensions. py pyw cgi however when i try to access the python "execuatable" i get an internal server error 500. in fact, i can't even get an executable to download.

here is my webapge i'm testing. : http://tantrum-technologies.com/homepage.htm
Back to top View user's profile Send private message Yahoo Messenger
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Sat May 08, 2004 8:05 pm    Post subject: Reply with quote

When you say "python executable," you mean something like http://tantrum-technologies.com/file.py, right?

Do you have any other interpreters set up using the CGI extention, such as Perl?
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
garyanderson
-


Joined: 08 Apr 2004
Posts: 40

PostPosted: Sat May 08, 2004 8:56 pm    Post subject: Reply with quote

yeah thats exactly what i mean. sort of how javascript is used to create dynamic web sites. I want to use python like that.

i did some searching on the site and it seems that since i have python set up as my cgi interpreter. I'm gonna need to first rename my cgi scripts with a .cgi perhaps. I might need an ftp server for my C programs .exe so they can be downloaded.


I'm just thinking though that since i have python installed already, there must be a way for the user to execute a script and my interperter would run it on the site, they would not need to have python installed.
Back to top View user's profile Send private message Yahoo Messenger
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Sat May 08, 2004 9:10 pm    Post subject: Reply with quote

If they execute on the server, then the user would not have to have Python installed on their system (just as PHP and the others do).

If Python is your only interpreter set up, just rename the Python scripts to .cgi and see if they work.

Also, it could be very well possible that your script is misconfigured. Try this and see if it works:
Code:
while (1) :
        print "Hello World";

_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
garyanderson
-


Joined: 08 Apr 2004
Posts: 40

PostPosted: Sat May 08, 2004 9:28 pm    Post subject: Reply with quote

yeah, i renamed my cgi scripts with a .cgi extension and i made suere to change the cgi path to just/*cgi, they all work fine, and since i haven't set it up to have .py extensions be my cgi scripts, it gives me the python code for extensions with .py and pyw. what i want it to do though is run the code. I know i'm gonna need an ftp server for my C executables, i wouldn't think that would be the same for python though.

also.

if i download an frp server, it will just incorporate with abyss right. its not a different type of server altogather? I can't imagine going through setting up my web page all over again.
Back to top View user's profile Send private message Yahoo Messenger
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Sat May 08, 2004 9:38 pm    Post subject: Reply with quote

Say you put the "hello world" code into a script called "hello.cgi" and ran it. The page would say "Hello, World!" because the Python interpreter interpreted the code and gave the output to Abyss, which in turn gave the output to you. That's how it works with every script. Is that what you want?

Also, you need to download a whole different FTP server to serve files via FTP. It won't exactly "integrate" with Abyss, but you can run both on the same computer.
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
garyanderson
-


Joined: 08 Apr 2004
Posts: 40

PostPosted: Sun May 09, 2004 5:38 am    Post subject: Reply with quote

iNaNimAtE wrote:
Say you put the "hello world" code into a script called "hello.cgi" and ran it. The page would say "Hello, World!" because the Python interpreter interpreted the code and gave the output to Abyss, which in turn gave the output to you. That's how it works with every script. Is that what you want?
not at all what i want. Thats works fine for handling basic forms and such. i already do that.

what i want is say i create a tic tac toe game in python and the user presses on tictactoe.py, i want the program to run not display the source code. The thing is i know it can be done because i saw this one site where someone did it, but i can't find it anymore.

oh and thank you for your replies in the other subjects. i appreaciate it a lot.
Back to top View user's profile Send private message Yahoo Messenger
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Sun May 09, 2004 6:29 am    Post subject: Reply with quote

I think I get you. This would be like a program that one could normally run on their computer, as a GUI or whatnot, and in this case it runs on a webpage. In that case, it is probably a question for Aprelium to answer.

The only thing I can suggest is try making it more web-based; using forms, et cetera.
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sun May 09, 2004 1:48 pm    Post subject: Re: python window open please Reply with quote

garyanderson,

When you install Python support in Abyss, the Python scripts will run on the server and the client will only see the result of the processing.
If you get error 500, this means that there is an error in your script (usually a syntax error or missing CGI headers).
Please send to support@aprelium.com your abyss.Conf file and your script and we'll tell you what's wrong and how to fix it.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
garyanderson
-


Joined: 08 Apr 2004
Posts: 40

PostPosted: Mon May 10, 2004 12:47 am    Post subject: Re: python window open please Reply with quote

aprelium wrote:
garyanderson,

When you install Python support in Abyss, the Python scripts will run on the server and the client will only see the result of the processing.
If you get error 500, this means that there is an error in your script (usually a syntax error or missing CGI headers).
Please send to support@aprelium.com your abyss.Conf file and your script and we'll tell you what's wrong and how to fix it.


from what your telling me then, I can only use abyss to do form processing right. I can't have it run an .exe. cause that is what i really want. innanimate got it. but you seem to be saying that i can't do it.
becuase the prog i wanted to run was NOT a cgi form processing type, it was supposed to be an excutable. is it possible to have an executable still by maybe changing the header mime type? Please say yes.
Back to top View user's profile Send private message Yahoo Messenger
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Mon May 10, 2004 5:29 am    Post subject: Reply with quote

If you want me to go ahead and say "yes," then I can do it. However, I might be lying to you. Python and other scripting languages basically just process data and take in variables when run on the web. The closest thing to a real application on the web is Java.

May I ask, what is the application supposed to do? We might be able to find an alternative solution.
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
garyanderson
-


Joined: 08 Apr 2004
Posts: 40

PostPosted: Mon May 10, 2004 3:43 pm    Post subject: Reply with quote

I just want to be able to create dynamic web pages with python instead of javascript that is all. if i create a tic tac toe game, the user can play tic tac toe in the python "shell" on the site. stuff like that. I saw this somehwere before and now i'm wondering if possibly it wasn't because i had python on my system. not too sure. but whatever. Thanks for all your help anyway. I appreaciate it very much.

on a another note: when is there going to be a python forum here. you have perl and another one. what about python. I have scripts i'd like to post in there and references to tutorials and the like. Thanks a lot.
Back to top View user's profile Send private message Yahoo Messenger
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Mon May 10, 2004 11:50 pm    Post subject: Reply with quote

Well if you just want to have Tic-Tac-Toe, then you can make it out of forms and whatnot. The only problem is, it won't be instantaneous like JavaScript.

garyanderson wrote:
on a another note: when is there going to be a python forum here. you have perl and another one. what about python. I have scripts i'd like to post in there and references to tutorials and the like. Thanks a lot.

Some other people wanted that also.
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Wed May 12, 2004 1:01 pm    Post subject: Re: python window open please Reply with quote

garyanderson wrote:
from what your telling me then, I can only use abyss to do form processing right. I can't have it run an .exe.

Since web servers (all web servers) dialog with browsers, the only form of dynamic exchange they can have is through form processing. You can't run any executable as you want. Your executable must be conforming to the CGI specification that can (only) handle forms processing.
For more dynamic things, you'll have to use Java applets.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group