Hi, I'm trying out python scripts and can't get the variables posted from a form accross. I'm calling the script from a dtml method via <dtml-var python-script-name> but keep getting "unknown variable" as the error .. it's a simple script that adds two numbers together (x = first_number + second_number) and first_number, second_number are from the form. The show answer method can display both variables (<dtml-var first_number>) I'm using python 2 (compiled zope from source) is this the problem? if it is, can I run python 2 with pyton 1.52? Regards, Mehmet
Hi, a new problem has appeared :-( Ok, I want to upload an Image into my ZOPE which only exists on an external Server. The pictures url could be http://somewhere.com/pic.jpg. So, I need a way, to insert this Image in my ZODB. But how, ... ??? I tried it with the manage_addImange tag, but without success. It seems as this tag only accepts files from my local file system. Perhaps, someone of you can help me, ... thank you, ... Marc
"Marc Fischer" <marcbpc@gmx.de> wrote:
Ok, I want to upload an Image into my ZOPE which only exists on an external Server. The pictures url could be http://somewhere.com/pic.jpg. So, I need a way, to insert this Image in my ZODB. But how, ... ???
There are probably many ways to do this. An immediate one I just tested uses Jerome Alet's lovely evolving ZShell: http://cortex.unice.fr/~jerome/zshell/ [note:Zshell 0.3 does not yet have security issues resolved] First install and create an instance of Zshell call it http://yoursite.com/zhell [or whatever you name your instance] <inside Zshell window> type 'man' or 'help' to see commands, arguments and caveats. Print this page.. ok now you are all ready: Zshell has a 'wget' command which is very easy to use cd to the folder you want, or mkdir to create one and then cd to it wget http://somewhere.com/pic.jpg </inside Zshell window> voila! a new image is created named 'pic.jpg_jpeg' Take a look at his zshell source to see how this is done. You can then write Zope methods to suit your own image needs, presumably to automate the process with sensible parameters. hth ./Jason ___________________________________________________________ Jason CUNLIFFE = NOMADICS['Interactive Art and Technology']
Mehmet Yousouf wrote:
Hi, I'm trying out python scripts and can't get the variables posted from a form accross. I'm calling the script from a dtml method via <dtml-var python-script-name> but keep getting "unknown variable" as the error .. it's a simple script that adds two numbers together (x = first_number + second_number) and first_number, second_number are from the form. The show answer method can display both variables (<dtml-var first_number>) I'm using python 2 (compiled zope from source) is this the problem? if it is, can I run python 2 with pyton 1.52?
Regards, Mehmet
If you want them to be passed implicitly, bind the namespace to "_" in the Python script bindings tab and use _['first_number'] _['second_number'] to access them. Or, make REQUEST the sole argument of the script (it will be passed by zope implicitly) and use REQUEST.first_number, etc. -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
participants (4)
-
Casey Duncan -
Jason Cunliffe -
Marc Fischer -
Mehmet Yousouf