tutorials on xslt

2005-12-28 Thread Iyer, Prasad C

Hi,
Is there any tutorial available for python-xslt processing.
It would be really helpful

regards
prasad chandrasekaran



This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.

-- 
http://mail.python.org/mailman/listinfo/python-list


RE: python cgi script not understood as html

2005-10-25 Thread Iyer, Prasad C

Your python script is not getting executed.
I guess there is something wrong with the server configuration.



#-Original Message-
#From: Philippe C. Martin [mailto:[EMAIL PROTECTED]
#Sent: Tuesday, October 25, 2005 1:27 AM
#To: python-list@python.org
#Subject: python cgi script not understood as html
#
#Hi,
#
#The following code outputs the actual HTML text to the browser, not the
#interpreted text.
#
#Any idea ?
#
#Regards,
#
#Philippe
#import cgi
#import logging
#import auth #this is the one you must implement (or use SCF ;-)
#
#html_ok = """
#Content-Type: text/html\n
#http://www.w3.org/TR/html4/loose.dtd";>\n
#\n
#\n
#  Access Granted\n
#  \n
#  \n
#\n
#\n
#Access Granted\n
#\n
#Welcome %s \n
#\n
#\n
#\n
#"""
#
#html_nok = """
#"Content-Type: text/html\n\n"
#http://www.w3.org/TR/html4/loose.dtd";>
#
#
#
#  Access Granted
#  
#  
#
#
#Access Denied
#
#
#
#
#
#"""
## DISPLAY ACCESS DENIED PAGE
#def Failure():
#print html_nok
#
##DISPLAY ACCESS GRANTED PAGE
#def Success(p_data):
#print html_ok % (p_data)


This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.

-- 
http://mail.python.org/mailman/listinfo/python-list


Small utility program for the windows

2005-10-24 Thread Iyer, Prasad C

Hi,
I am trying to create a small utility program which would be configured
in registry. Something like this
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\ShortCut\command]
@="\"python C:\\workspace\\python\\Tut\\ShortCut.py\""


It gives me access denied exception when I try it.
Can anyone help me out.
Following is the code

from Tkinter import *
import sys

class BaseClass(Frame):
def __init__(self, master=None):
Frame.__init__(self, master)
self.grid()
self.createWidget()
def createWidget(self):
self.text=Text(self, width=20, height=3)
self.text.grid(row=0,column=0)
Button(self, text="ok", command=self.addText).grid(row=1,
column=0)
def addText(self):
print "hello world"

baseClass=BaseClass()
print sys.argv[0]
for i in range(0, len(sys.argv)):
print sys.argv[i]
baseClass.mainloop()



I have to modify the code further so that it takes argument.

This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.

-- 
http://mail.python.org/mailman/listinfo/python-list


Abstract Methods & Abstract Class

2005-10-19 Thread Iyer, Prasad C

Do we have something like abstract methods & Abstract class.

So that my class would just define the method. And the implementation
would be defined by somebody else.


This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.

-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Don't want to serialize a variable of object

2005-10-18 Thread Iyer, Prasad C

Thanks a lot.

Actually you are right I would be trying same thing now.
Writing my own custom serializable for the object.

But everyone else who face the same problem would come up with their own
Serializable code.

Can't we plug something into cpickle So that it discards some variable from 
being serializable. Similar to __data for private variables. But on second 
thought that would be too much of change that I am asking.

Anyway thanks a lot.

regards
prasad chandrasekaran










--- Cancer cures smoking

#-Original Message-
#From: Tarek Ziadé [mailto:[EMAIL PROTECTED]
#Sent: Tuesday, October 18, 2005 1:01 PM
#To: Iyer, Prasad C
#Cc: python-list@python.org
#Subject: Re: Don't want to serialize a variable of object
#
#Iyer, Prasad C wrote:
#
#>Hi,
#>I got a class which I need to serialize, except for couple of variable.
#>i.e.
#>
#>import cPickle as p
#>class Color:
#>def __init__(self):
#>print "hello world"
#>self.x=10
#>self.somechar="this are the characters"
#>color=Color()
#>f=file('poem.txt', 'w')
#>p.dump(color, f)
#>f.close()
#>
#>How do I serialize the object color without serializing the x and
#>somechar variables?
#>Is there any modifier which prevents the variable from being serialized.
#>
#>
#You can create your own serialization process, by providing some kind of
#serialize() method
# in a base class that would dump part of the object.
#
#Let's say, the instance __dict__ dictionnary ?
#this serialize method can then remove the attributes that starts with '_v_'
#(that's what we do in Zope to avoid pickling some attribute)
#
#>
#>
#>
#>Another question:
#>  Is there a concept of private variables?
#>
#>
#That's a long discussion, you should look at the archives in the list.
#
#But anyway, all attributes that starts with '__' are considered private
#to the class.
#(ie: can't be reached by "instance.__attribute")
#
#even though you can find it if you dig into instance.__dict__
#
#
#Regards,
#
#Tarek


This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.

-- 
http://mail.python.org/mailman/listinfo/python-list


Don't want to serialize a variable of object

2005-10-17 Thread Iyer, Prasad C

Hi,
I got a class which I need to serialize, except for couple of variable.
i.e.

import cPickle as p
class Color:
def __init__(self):
print "hello world"
self.x=10
self.somechar="this are the characters"
color=Color()
f=file('poem.txt', 'w')
p.dump(color, f)
f.close()

How do I serialize the object color without serializing the x and
somechar variables?
Is there any modifier which prevents the variable from being serialized.




Another question:
Is there a concept of private variables?



regards
prasad chandrasekaran










--- Cancer cures smoking
#-Original Message-
#From: [EMAIL PROTECTED]
#[mailto:[EMAIL PROTECTED] On
#Behalf Of [EMAIL PROTECTED]
#Sent: Tuesday, October 18, 2005 11:00 AM
#To: python-list@python.org
#Subject: Python-list Digest, Vol 25, Issue 322
#
#Send Python-list mailing list submissions to
#   python-list@python.org
#
#To subscribe or unsubscribe via the World Wide Web, visit
#   http://mail.python.org/mailman/listinfo/python-list
#or, via email, send a message with subject or body 'help' to
#   [EMAIL PROTECTED]
#
#You can reach the person managing the list at
#   [EMAIL PROTECTED]
#
#When replying, please edit your Subject line so it is more specific
#than "Re: Contents of Python-list digest..."

This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.

-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Confused with module and .py files

2005-10-05 Thread Iyer, Prasad C

Sorry guys for that .py in import.
It was typing mistake.

Extremely sorry

regards
prasad chandrasekaran










--- Cancer cures smoking

#-Original Message-
#From: Steve Holden [mailto:[EMAIL PROTECTED]
#Sent: Wednesday, October 05, 2005 2:43 PM
#To: python-list@python.org
#Subject: Re: Confused with module and .py files
#
#Iyer, Prasad C wrote:
#> Actually I am bit confused between the modules and .py file
#> How do I differentiate between the 2.
#>
#> For example
#> I have a file import1.py, import2.py file
#> Which has few functions and classes
#> And if I have a class with same name "BaseClass" in both the file
#>
#> How would I use it if I declare it as given below in my 3rd class
#>
#> from import1.py import *
#> from import2.py import *
#>
#You can't do that. The "from module import *" mechanism explicitly
#defines names in the importing module's namespace, so if you use this
#technique to import two modules that define the same name you will
#inevitably find that the second import overwrites the duplicate name
#imported by the first import.
#
#Note also that the ".py" should not be included in the import statement
#- the interpreter finds the appropriate code from the module name, so
#you should anyway be doing something like
#
#   from import2 import *
#   from import2 import *
#
#It would be much better, though, to write:
#
#   import import1
#   import import2
#
#Then you can refer to import1.BaseClass and import2.baseClass without
#getting any naming conflicts. In general the "from module import *"
form
#should only be used under specific conditions, which we needn't discuss
#here now.
#
#regards
#  Steve
#--
#Steve Holden   +44 150 684 7255  +1 800 494 3119
#Holden Web LLC www.holdenweb.com
#PyCon TX 2006  www.python.org/pycon/
#


This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.

-- 
http://mail.python.org/mailman/listinfo/python-list


Confused with module and .py files

2005-10-05 Thread Iyer, Prasad C

Actually I am bit confused between the modules and .py file
How do I differentiate between the 2.

For example
I have a file import1.py, import2.py file
Which has few functions and classes
And if I have a class with same name "BaseClass" in both the file

How would I use it if I declare it as given below in my 3rd class

from import1.py import *
from import2.py import *





regards
prasad chandrasekaran










--- Cancer cures smoking

#-Original Message-
#From: [EMAIL PROTECTED]
#[mailto:[EMAIL PROTECTED] On
#Behalf Of [EMAIL PROTECTED]
#Sent: Wednesday, October 05, 2005 1:32 PM
#To: python-list@python.org
#Subject: Python-list Digest, Vol 25, Issue 65
#
#Send Python-list mailing list submissions to
#   python-list@python.org
#
#To subscribe or unsubscribe via the World Wide Web, visit
#   http://mail.python.org/mailman/listinfo/python-list
#or, via email, send a message with subject or body 'help' to
#   [EMAIL PROTECTED]
#
#You can reach the person managing the list at
#   [EMAIL PROTECTED]
#
#When replying, please edit your Subject line so it is more specific
#than "Re: Contents of Python-list digest..."

This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.

-- 
http://mail.python.org/mailman/listinfo/python-list


2 class with same name in different module

2005-10-05 Thread Iyer, Prasad C

I have a class in a module which is getting imported in main module.
How do you differentiate between the 2 class

regards
prasad chandrasekaran






This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.

-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Python CGI Script

2005-10-02 Thread Iyer, Prasad C

I guess your python script isn't getting executed.

a. I guess you might have to tweak the server if the script is not
getting executed.
b. Maybe your script is getting executed but you are not setting the
"Content-type" parameter which is essential for browser that it is an
html page.

Note :- Set "Content-type" to "text/html" I guess this should work


regards
prasad chandrasekaran










--- Cancer cures smoking

-Original Message-
From: Efrat Regev [mailto:[EMAIL PROTECTED]
Sent: Friday, September 30, 2005 4:20 PM
To: python-list@python.org
Subject: Python CGI Script

 Hello,

 I'm a data-structures course TA trying to write a python CGI script

for automatically compiling and testing students' projects.
Unfortunately, I've run into some questions while writing this, which I
couldn't solve with the various (and helpful) python-CGI documentation.
(It's possible that I'm posting to the wrong group; if so, I'd
appreciate suggestions for the appropriate group.)


1. In my HTML page, I have the following:





 In the above, submission_processor.py is the python CGI script. I
didn't write a URL in the action field, since I'm first testing
everyting on a local machine (running FC4). The first line of
submission_processor.py is

#!/usr/bin/python

and I've done

chmod +x submission_processor.py

 When I hit the "submit" button, my browser (Firefox on FC4) doesn't

run the script; it asks me whether it should open
submission_processor.py or save it to disk. I couldn't figure out why.

2. My HTML page has the option for an instructor to list the various
submissions and scores. Obviously, this should be inaccessible to
students. The instructor has a password for doing this, therefore.
Suppose I place the password inside a python script, and give this
script only +x permission for others. Is this  adequate as far as
security?


 Thanks in advance for answering these questions.


  Efrat


This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.

-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Overloading __init__ & Function overloading

2005-09-30 Thread Iyer, Prasad C

Thanks a lot for the reply.
But I want to do something like this

class BaseClass:
def __init__(self):
# Some code over here
def __init__(self, a, b):
# Some code over here
def __init__(self, a, b, c):
# some code here

baseclass1=BaseClass()
baseclass2=BaseClass(2,3)
baseclass3=BaseClass(4,5,3)




regards
prasad chandrasekaran










--- Cancer cures smoking

-Original Message-
From: Larry Bates [mailto:[EMAIL PROTECTED]
Sent: Friday, September 30, 2005 7:39 PM
To: Iyer, Prasad C
Subject: Re: Overloading __init__ & Function overloading

I may be reading this question different than Fredrik.

This example is with old-style classes.

class baseclass:
def __init__(self, arg):
#
# Do some initialization
#

def method1(self, arg):
#
# baseclass method goes here
#

class myclass(baseclass):
def __init__(self, arg):
#
# This method gets called when I instantiate this class.
# If I want to call the baseclass.__init__ method I must
# do it myself.
#
baseclass.__init__(arg)

def method1(self, arg):
#
# This method would replace method1 in the baseclass
# in this instance of the class.
#

myObj=myclass(arg)

I could be way off base, but maybe it will help.

-Larry Bates



Iyer, Prasad C wrote:
> I am new to python.
>
> I have few questions
> a. Is there something like function overloading in python?
> b. Can I overload __init__ method
>
> Thanks in advance
>
>
>
> regards
> prasad chandrasekaran
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --- Cancer cures smoking
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of [EMAIL PROTECTED]
> Sent: Friday, September 30, 2005 6:36 PM
> To: python-list@python.org
> Subject: Python-list Digest, Vol 24, Issue 455
>
> Send Python-list mailing list submissions to
>   python-list@python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>   http://mail.python.org/mailman/listinfo/python-list
> or, via email, send a message with subject or body 'help' to
>   [EMAIL PROTECTED]
>
> You can reach the person managing the list at
>   [EMAIL PROTECTED]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Python-list digest..."
>
> This message contains information that may be privileged or
confidential and is the property of the Capgemini Group. It is intended
only for the person to whom it is addressed. If you are not the intended
recipient,  you are not authorized to read, print, retain, copy,
disseminate,  distribute, or use this message or any part thereof. If
you receive this  message in error, please notify the sender immediately
and delete all  copies of this message.
>


This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.

-- 
http://mail.python.org/mailman/listinfo/python-list


Overloading & Overriden

2005-09-30 Thread Iyer, Prasad C

Hi,
Does python supports Overloading & Overriding  of the function?


regards
prasad chandrasekaran


This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.

-- 
http://mail.python.org/mailman/listinfo/python-list


Overloading __init__ & Function overloading

2005-09-30 Thread Iyer, Prasad C

I am new to python.
I have few questions
a. Is there something like function overloading in python?
b. Can I overload __init__ method

Thanks in advance



regards
prasad chandrasekaran










--- Cancer cures smoking
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: Friday, September 30, 2005 6:36 PM
To: python-list@python.org
Subject: Python-list Digest, Vol 24, Issue 455

Send Python-list mailing list submissions to
python-list@python.org

To subscribe or unsubscribe via the World Wide Web, visit
http://mail.python.org/mailman/listinfo/python-list
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]

You can reach the person managing the list at
[EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Python-list digest..."

This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.

-- 
http://mail.python.org/mailman/listinfo/python-list