[Tutor] cgi on novell/Appache

2008-12-02 Thread Jim Morcombe
I have a cgi script that I want to get running on an Apache server running under Novel. I know absolutely nothing about novell. I need to have the first line of the script point to the Python interpretter, but have no idea where it is. (I don't have access to the server to play around on it.

Re: [Tutor] cgi scripts

2008-11-10 Thread Jim Morcombe
Actually, that's good to know. I was thinking it was going to be pretty hard to debug if I couldn't tell the difference between HTML errors and Python errors. I have been using import cgitb; cgitb.enable() It seems to re-direct some of the errors to the browser, but obviously not all. Ji

Re: [Tutor] cgi scripts

2008-11-08 Thread Jim Morcombe
might have been producing illegal HTML code before. I think I'd better brush up on my HTML skills. Jim Alan Gauld wrote: "Jim Morcombe" <[EMAIL PROTECTED]> wrote The code I sent before had a silly mistake in it. Here is a better example of the things I am trying

Re: [Tutor] cgi scripts

2008-11-08 Thread Jim Morcombe
Bt "Crash", I mean the browser displays: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. The code I sent before had a silly mistake in it. Here is a better example of the things I am trying and failing at. I can

[Tutor] cgi scripts

2008-11-07 Thread Jim Morcombe
I want to print a list of the keys and their values passed to a cgi script by an HTML form. I have tried this, but just seems to crash. Any ideas? Jim Morcombe #!C:\python25\python.exe import cgi, sys # import cgitb; cgitb.enable() #Send errors to browser sys.stderr = sys.stdout #Parse

[Tutor] Using Python to replace javascript

2008-11-06 Thread Jim Morcombe
Is there any way to write python code inside a HTML page instead of using Javascript? Jim ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Multi-User file system

2008-11-01 Thread Jim Morcombe
Would pySQLite be a reasonable choice for this? Jim Morcombe Jim Morcombe wrote: I want to have a couple of files that can be updated simultaneously be several users. I don't want to go to the effort of having the users set up a RDMS and would like to control everything from Python.

[Tutor] Multi-User file system

2008-11-01 Thread Jim Morcombe
I want to have a couple of files that can be updated simultaneously be several users. I don't want to go to the effort of having the users set up a RDMS and would like to control everything from Python. I am after something like shelve, but with record locking. Is there such a thing?

[Tutor] Finding the IP address for your own PC

2008-10-12 Thread Jim Morcombe
Hopefully this is an easy one. How do you get the IP address of the Windows PC that your Python program is running on? Jim Morcombe ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Simple physics simulations)

2008-09-14 Thread Jim Morcombe
and simple objects, and allowing the User to do the same. So the question - What is the best thing to use to draw and manipulate simple 2D objects in an application like this? Jim Morcombe ___ Tutor maillist - Tutor@python.org http

[Tutor] Calling Python Programs from Word, pdfs, etc

2008-09-04 Thread Jim Morcombe
I am thinking about some long term teaching aids, so I'm simply interested in whether these things can be done. I don't need to know how yet. 1. Is it possible to invoke a Python Program from some kind of link in a Word document, similar to the way a Java Applet is run from a Web Page. Obv

[Tutor] names and variables

2008-08-20 Thread Jim Morcombe
want to have a line of code: something like this: print myObject.myAttribute and have Python interpret it as meaning "print myObject.colour" and hence print "red" Can this be done? If so, how? Jim Morcombe ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] regular expressions

2008-08-05 Thread Jim Morcombe
"(Susan)", how do I do this. First, the "(" seems to muck things up. Second, how do I just use "re" to delete characters. I tried using "sub", but it doesn't seem to like Jim Morcombe ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] destroying windows

2008-06-30 Thread Jim Morcombe
I want to have a program that uses Tkinter to display a window. If the user selects an option, then I want to destroy that window and then display a second window. In turn, the user can select an option to change back to the first window and I want to destroy that window and then display the fir

Re: [Tutor] Closing GUI program

2007-12-27 Thread Jim Morcombe
Oops! Here's the program: --- from Tkinter import * root = Tk() z = Label(root, text="Hello World!") z.grid() root.mainloop() -- Jim - Original Message ----- From: Jim Morcombe To: python tutor mailing list

[Tutor] Closing GUI program

2007-12-27 Thread Jim Morcombe
I have copied the following program. When I run it, (By pressing F5 from IDLE), it displays the "Hello world" message. When I close the window, the "Hello world" message disappears, but it seems that the program is still running, because when I close the shell, i get the message "The program i

Re: [Tutor] Microsoft Access

2007-12-27 Thread Jim Morcombe
-- From: Darren Williams To: Jim Morcombe ; tutor@python.org Sent: Friday, December 28, 2007 11:12 AM Subject: Re: [Tutor] Microsoft Access Typing 'Using MS Access from Python' into Google returned a few results, one in particular - http://wwwmarkcarter.me.uk/computing/python/a

[Tutor] Microsoft Access

2007-12-27 Thread Jim Morcombe
Are there any simple tutorials on using MS Access from Python? Jim ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] re-initialising shells

2007-12-20 Thread Jim Morcombe
I have had a couple of strange cases I don't understand. I am using IDLE on Windows My program imports some stuff from another file using the statement "from qwerty import *" I have changed qwerty and saved it away. I have then run my program (F5) and the program acts as if it is using an old

[Tutor] constants, flags or whatever

2007-12-19 Thread Jim Morcombe
In a program, I want to set some kind of variable or object to indicate what "mode" the program is currently in. What is the most elegant way of doing this? Jim --- constant: moving = "m" constant: inserting = "i" constant:ju

[Tutor] Placing entire Application inside a class

2007-12-18 Thread Jim Morcombe
I have just read through "Creating a GUI in Python - by Dakota Lemaster" In it, Dakota recomends placing the entire application within a class. Why is this so? Surely in many cases you end up with a constructor for the class that is cumbersome and complex? Is this a recomended Python programmi

[Tutor] Oops:

2007-12-17 Thread Jim Morcombe
I solved my last problem. The data was string data and of course '1' is > 5. Now, if I take int(string) the code will work, except it crashes out when the data is null. student.row = int(student.row) ValueError: invalid literal for int() with base 10: '' What is the easiest and recomended w

[Tutor] Something I don't understand

2007-12-17 Thread Jim Morcombe
Below, "student_seats" is a list of the class "student". Why does this code set every student.row to zero when there is only one student in the list with row > 5? It still sets them all to zero if I change the test to ">200" when there are no student.rows > 200. But if I change the test to "<1"

[Tutor] using quotes in IDLE

2007-12-13 Thread Jim Morcombe
A really dumb question... When typing things into IDLE, how are quotes meant to work? If I type" employee.name = "Susan" then IDLE ignores the last " and I get an error. Jim ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listi