Hi guys.
Im having a little trouble with one of my phyon cgi scripts.
Basically i need to a function that runs on the server size as a python cgi script but returns the IP address of the web based user on the website. I then use the IP as an ideantifier for some other processes and data logging.
The script i have is:
def getIP():
"""Get host IP address"""...
User Profile
Collapse
-
Python CGI grab user IP Address
-
Problems with running Python CGI Scripts
Hey guys.
Im having problems running a python cgi. Im using the example code from:
http://www.python.org/doc/essays/ppt...ast/sld041.htm as writen by Van Rossum himself
I can get the script to run the python script but all that happens is that the black python box appears then disapears, the html that the python scripts should generate is never output.
My html is:
<html><head>... -
Nested loops and goto line
Hello.
I have a quick question about loops, i just cant seem to get it to work correctly. the code generates a tuple containing a set of numbers. The if statement is designed to catch tuples that are not valid, if its not a valid one then i need it to go back to line 1 and regenerate the tuple.
def function():
............... ............... # line1
............... ............... # line2
............... .................. -
nested loops and goto line
Hello.
I have a quick question about loops, i just cant seem to get it to work correctly. the code generates a tuple containing a set of numbers. The if statement is designed to catch tuples that are not valid, if its not a valid one then i need it to go back to line 1 and regenerate the tuple.
def function():
............... ............... # line1
............... ............... # line2
............... .................. -
Errors when creating and writing to text file
moderators - please delete -
Cheers.
Got it sorted now.
Vertually finished my 3 month project, just writing the final report now. In terms of my dialog box i just need to sort out user input verification and thats it.
Quite nicely it absolutly nails every test image i pass it with at most 5 pixels error in a 2Mp image, pretty sweet!!!
Thanks for all of your help on this forum over the past 3 months.
I go back to uni for a year coming in september... -
Hey Guys.
Right i am coming close to the end of my project and am starting to think about how to invoke my dialog box once a .raw file is selected.
What i am trying to do at the moment is create a small test bench that will open the file and present the filepath to my dialog. The test bench then invokes my dialog
What i am missing is how to pass the filepath into the dialog box. I know how to inport variables into modules that...Leave a comment:
-
-
Split string without delimiters
Hey Guys.
If I have a string say "abcdefg" how do i split the string without delimiters.
What i need is a list containing each of the chars:
e.g. ['a', 'b', 'c', 'd', 'e', 'f', 'g']
The string.split() method wont work as it requires a delimiter within the string to split on and returns ['abcdefg'].
Just going to use it for some error checking and validation used in a wx.TextCtrl in my GUI.... -
Hiya.
Cheers. Yeah ive already sorted out the code to open the file once the dialog box is running, just using the openfile dialog box class.
Yeah thought it may need to wait till right at the end before i can accociate it with the .raw file type.
Thanks.
EdLeave a comment:
-
Invoking dialog box on file selection
Hey Guys.
This is kind of a mixed question involving the os platform, python and wxpython. I hope this is in the right place, if not then a quick link to somewhere suitable would be great.
Ok basicly i have a dialog box that is acting as the GUI for an image program i'm running. The program is a front end support app for raw image files.
Does anyone know how to invoke the dialog box if the user of the os clicks and tries... -
Hey Guys. I managed to do it, thats for your help.
Here is what i came up with:
[CODE=python]
def GetPxValue(open file, bitdepth): #can iterate this part to get the next pixel
read_bytes = operator.div(bi tdepth, 8)
px_value = openfile.read(r ead_bytes)
if (bitdepth == 8):
unpack_code = 'B'
if (bitdepth == 16):
unpack_code = 'BB'
...Leave a comment:
-
Cheers guys, will give these ideas a try and see how they turn out.
Thanks.
EdLeave a comment:
-
Thanks guys.
Will investigate those options once i have time.
The RAW format i am working with is literally just raw data, it doesnt have a header file or start and stop bytes. The pixels have a bitdepth of 2bytes however the actual image data is only 10bits out of those 16, the rest are parity and padding bits.
Edit:
Ok just looking at the f.read(2) code above. The method returns the value of those two bytes as...Leave a comment:
-
Reading Binary Image Data
Hey Guys.
I'm looking for some info on how to read binary image data. Basicly RAW image files are strings of bits with say 2 bytes per pixel. What i need to do is read the value of each pixel in turn and store then in another variable, px1, pix2 etc. I'm running an iterative algorithm on 2 pixels at a time then moving to the next two pixels.
I am having alot of problems however reading the data. from the net and various books i see...
No activity results to display
Show More
Leave a comment: