Questions tagged [python-server-pages]

32 questions
0
votes
2 answers

Why do local test servers open a "save file" dialog?

I have been trying to develop web pages locally (in Windows 10) and running in my local browser (chrome, vivaldi). Right now I have 3 different ways to run simple servers locally: php's built in server, python's http.server module, and vscode's…
RufusVS
  • 4,008
  • 3
  • 29
  • 40
0
votes
1 answer

Python 3.7 TypeError: missing 1 required positional argument: 'input'

I have already finished my function, but when I run the webserver I get the following error: TypeError : index() missing 1 required positional argument:'input' This is my code: from sklearn import tree from flask import Flask app =…
0
votes
0 answers

python keyword can't be an expression server

why i got a keyword error on this server script? i'm already made my inference engine script python (python inference engine script) into a server after that i'm make a new script that combine that answer with my inference script just like these…
0
votes
1 answer

Is there a way to start a server-like notebook?

Apologies if this is not strictly a programming question, if someone has a better avenue for asking this question, please do let me know. I have been searching for answers, but not finding quite what I am looking for. There is Jupyter notebook,…
kloop
  • 4,537
  • 13
  • 42
  • 66
0
votes
1 answer

Not able to access parts of imported .PY in a .PSP

I'm trying to load a weather plugin for a website I'm working on. The weather plugin is a separate weather.py file located at /var/www/piss/plugins/base/weather.py. In the PSP it seems to import correctly, but I am unable to access any variables…
chris
  • 135
  • 1
  • 5
0
votes
1 answer

How to stop my python server from shutting down after the first connection?

I started writing python servers this week, and I wrote just the simplest server I could make for an example. the server and client use sockets, the server listens to a socket, then sends back to the client what it got after saying "I got: ". I run…
talbor49
  • 3
  • 4
0
votes
0 answers

Deploy Rails Server and Python Server on the same Machine

I have a normal rails server already deployed and is running on a ubuntu machine with port 80 for http service. For the saving cost reason, I would like to run an internal python server on the same ubuntu machine at different port say 8888 and let…
sovanlandy
  • 1,700
  • 2
  • 19
  • 24
0
votes
1 answer

Python: For loop problem

I have a PSP page with html embedded. I need to place another for loop so i can insert another %s next to background-color: which will instert a appropriate colour to colour in the html table. For example i need to insert for z in colours so it can…
James
  • 1
  • 2
0
votes
4 answers

Python server pages, tables and lists

I am using MySQL and python server pages to show the data in a database. In the db I have selected this data: a list x =[1, 61, 121, 181, 241, 301] and a list of lists z = (['a','b'],['c','d'],['e','f'],['g','h'],['i','j'],['k','l']) and I would…
sat_s
  • 277
  • 1
  • 5
  • 11
0
votes
1 answer

Python: PSP & HTML tables

I have a python psp page code is shown below. Currently it only prints out the characters in single rows of 60, with the character count in the left column. <% s = ''.join(aa[i] for i in table if i in aa) for i in range(0, len(s), 60): …
Andrew
  • 3
  • 1
0
votes
2 answers

PSP class import + MySQL connect

Ok so im trying to import a class i made which connects to a MySQL database the class code is shown below: class connection def__init__( self ): self.cnx = MySQLdb.connect(user='xxx',host='xxx',passwd='xxx',db='xxx') All of the…
James
  • 13
  • 2
0
votes
2 answers

How to make python web server to respond on IP adress?

I am testing some python functionalities as web server. Typed : $ python -m SimpleHTTPServer 8080 ...and setup port forwarding on router to this 8080. I can access via web with http://my.ip.adr.ess:8080/, whereas my.ip.adr.ess stands for my IP…
Alex
  • 3,167
  • 6
  • 35
  • 50
0
votes
1 answer

Unable to write to files with mod_python and PSP

So, I have a Python Server Pages script that when ran, saves stuff to a file in /var/www/. It opens the file with: open(filename, 'wb') Which causes this: IOError: [Errno 13] Permission denied: 'file.txt' I'm using Apache and have set /var/www/ to…
user1814016
  • 2,273
  • 5
  • 25
  • 28
0
votes
1 answer

Print statement not working in PSP (Python server pages)

Below is a code for python server pages(PSP); using mysqldb, I am trying to fetch records from the table "addr" and then print the same onto an html page. But for some reason the print statement inside the for loop (containing table rows) and…
Sumit Jindal
  • 13
  • 1
  • 5
-1
votes
1 answer

Python script is not running in python web server

This below code is my html.py file in my cgi-bin directory. print "Content-type:text/html" print '' print '' print 'Hello Word - First CGI Program' print '' print '' print '

Hello Word! This is my first CGI…