Re: post xml payload with urllib

2007-08-14 Thread mirandacascade
On Aug 14, 11:57 am, brad <[EMAIL PROTECTED]> wrote: > Has anyone sent an xml payload via post using urllib? Haven't used urllib, but have used urllib2 to do a POST. Might something like this work... import urllib2 logon_request = """ "the_password" "the_user" """ req = urllib2.Reques

socket module - recv() method

2007-04-30 Thread mirandacascade
Currently using the following technique in serveral client applications to send a request message and receive a response: import socket bufferSize = 50 connectionHandle = socket.socket(socket.AF_INET, socket.SOCK_STREAM) connectionHandle.connect(sa) connectionHandle.sendall(requestMessage) ful

SSLCrypto package

2007-04-18 Thread mirandacascade
When I review: - the site that describes the SSLCrypto package: http://www.freenet.org.nz/python/SSLCrypto/ - the documention for SSLCrypto: http://www.freenet.org.nz/python/SSLCrypto/Doco/ - the examples provided http://www.freenet.org.nz/python/SSLCrypto/#examples

on which site or Usenet group should this question be posted?

2007-01-14 Thread mirandacascade
Operating system: Win XP Version of Python: 2.4 I recognize that this question is not about Python...it has only a tangential Python connection. I'm using a Python package to run a process; that process is issuing an error, and I'm hoping that someone on this site can point me to the site that ha

Re: AES256 in PyCrypto

2007-01-07 Thread mirandacascade
Sebastian 'lunar' Wiesner wrote: > Since you are apparently unable to read to docstrings of this module, I > will give you a short hint: yes, pycrypto supports AES with 256 bit > keys. Thank you for the information. The material I consulted was: a) the PyCrypto manual: http://www.amk.ca/python/wr

Re: AES256 in PyCrypto

2007-01-07 Thread mirandacascade
Marc 'BlackJack' Rintsch wrote: > `a` must be of length 32 for AES256. And the length of `plainText` must > be a multiple of 16 because it's a block cypher algorithm. Thank you. I have some follow up questions and 1 tangential question. Follow up question: Would it be correct to infer that:

AES256 in PyCrypto

2007-01-06 Thread mirandacascade
Attempting to determine whether the PyCrypto package has the capability to perform AES256 encryption. I received the following C# snippet: CryptoProvider provider = new CryptoProvider(); Encrypted_Type password = new Encrypted_Type(); password.EncryptedData = new EncryptedDataType(); password.Enc

terminology question - "foreign function library"

2006-12-24 Thread mirandacascade
I am prompted to make these inquiries after seeing the following link to ctypes: http://docs.python.org/lib/module-ctypes.html in which ctypes is described as a foreign function library. What is the definition of "foreign function library"? Is the concept different from a "package"? Is the conce

httplib and socket.getaddrinfo

2006-12-22 Thread mirandacascade
I noticed the following lines from the connect() method of the HTTPConnection class within httplib: for res in socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM): af, socktype, proto, canonname, sa = res This led me to the doc

using methods base64 module in conjunction with Crypto.Hash.SHA256

2006-12-19 Thread mirandacascade
I am attempting to implement a process, and I'm pretty sure that a major roadblock is that I do not understand the nomenclature. The specs indicate that the goal is to calculate a message digest using an SHA-256 algorithm. There are 2 examples included with the specs. The label on the 2 examples

inquiry about installing Python 2.5

2006-12-16 Thread mirandacascade
Apologies in advance for what I'm sure seems like a trivial question. Operating system: Win XP Current version of Python: 2.4 If possible, I would like to have both Python 2.4 and Python 2.5 installed on my workstaiton. I downloaded the .msi for Python 2.5 from the python.org site. If I run the

sha, PyCrypto, SHA-256

2006-12-16 Thread mirandacascade
Operating system: Win XP Vsn of Python: 2.4 Situation is this: Required to calcluate a message digest. The process for calcluating the digest must use an SHA-256 algorithm. Questions: 1) Is it correct that the sha module comes with python 2.4? 2) Is it correct that the sha module that ships with

elementtree terminology + tangential questions

2006-11-04 Thread mirandacascade
Was prompted to ask these questions when reading the following link: http://effbot.org/zone/element-infoset.htm#mixed-content provides a clear explanation of what the tail member is in the elementtree package. Questions: 1) In the xml world, is the text between an element's end tag and the next

ElementSOAP tutorial / HTTPClient

2006-10-22 Thread mirandacascade
Operating system: Windows XP Home Version of Python: 2.4 While looking through the tutorial on ElementSOAP at the following link: http://effbot.org/zone/element-soap.htm I observed sample code that included: from HTTPClient import HTTPClient When I get into Pythonwin and attempt the import sta

Re: win32com.client.Dispatch - understanding error messages

2006-07-18 Thread mirandacascade
Duncan Booth wrote: > Are you really sure that the browser isn't making guesses about what you > meant and correcting the error for you? Does what remains in the address > bar when the page is retrieved really match *exactly* what you copied and > pasted? Thank you for that pointer. The answer i

Re: win32com.client.Dispatch - understanding error messages

2006-07-18 Thread mirandacascade
Duncan Booth wrote: > wrote: > > Does using an absolute URL for the url parameter help any? You've specified > a relative URL (i.e. the folder 12.5.81.49 under the current location). I don't know the answer to that question. I know that when I'm on the same workstation and I copy/paste the string

win32com.client.Dispatch - understanding error messages

2006-07-17 Thread mirandacascade
O/S : Win2K vsn of Python: 2.4 Hoping to find information that provide information about error messages being encountered. Pythonwin session: >>> import win32com.client >>> blah = win32com.client.Dispatch('MSXML2.XMLHTTP') >>> blah.open("POST", "12.5.81.49/crg_cbsil_vtest_52/crg.aspx", 0) Traceb

insert method in ElementTree

2006-07-16 Thread mirandacascade
O/S: Win2K Vsn of Python: 2.4 Example: text for c text for d text for f text for g> text for i text for k text for l text for m Python script reads XML document above into ElementTree. The script outputs an XML document that is ba

request for advice - possible ElementTree nexus

2006-07-04 Thread mirandacascade
Situation is this: 1) I have inherited some python code that accepts a string object, the contents of which is an XML document, and produces a data structure that represents some of the content of the XML document 2) The inherited code is somewhat 'brittle' in that some well-formed XML documents ar

Amara installation

2006-06-19 Thread mirandacascade
O/S WinXP Home Vsn of Python: 2.4 Wish to install Amara. Using amara-allinone-1.0.win32-py2.4.exe (2965KB) Forder structure before installation: c: python24 DLLs Doc Include Lib site-packages [previously installed stuff] libs scripts tcl tools Wh

the tostring and XML methods in ElementTree

2006-05-07 Thread mirandacascade
O/S: Windows XP Home Vsn of Python: 2.4 Copy/paste of interactive window is immediately below; the text/questions toward the bottom of this post will refer to the content of the copy/paste >>> from elementtree import ElementTree >>> beforeRoot = ElementTree.Element('beforeRoot') >>> beforeCtag =

Re: the print statement

2006-05-06 Thread mirandacascade
Thank you. Yes, that post answers most of the questions. I now have a bit of an understanding of the \xhh pattern. It's still unclear to me, however, how one can go from the \x92 pattern and arrive at the apostrophe character. Is \x92 theh apostrophe character in another character set? If so,

the print statement

2006-05-06 Thread mirandacascade
O/S: Win2K Vsn of Python: 2.4 Here is copy/paste from interactive window of pythonwin: >>> x = "Joe's desk" >>> y = 'Joe\x92s desk' >>> type(x) >>> type(y) >>> print x Joe's desk >>> print y Joe's desk >>> if x == y: ... print 'equal' ... else: ... print 'not equal' ... not equal >>> le

Two ElementTree questions

2006-04-27 Thread mirandacascade
1) It appears as if the following logic works for determining whether an element is a parent: # assume elem is an ElementTree element if (elem.getchildren() == None): print 'this element is not a parent' else: print 'this element is a parent' My question is this: are there any other ways

Re: python equivalent of VB code sample

2006-04-21 Thread mirandacascade
Thank you for pointing me in the direction of XMLHTTP. I'm still thinking about this in terms of creating a python script that is functionally equivalent to the VB code in the original post. The information I reviewed about XMLHTTP makes me think that it may be possible to use the win32com.client

python equivalent of VB code sample

2006-04-21 Thread mirandacascade
Situation is this: 1) must write application that does the following: a) creates an xml document, the contents of which, is a request transaction b) send xml document to destination; I am assuming that a process at destination side processes the request and sends back a response c) t

Re: PATH environment variable

2005-11-20 Thread mirandacascade
Fredrik Lundh wrote: > what part of your observations makes you think that the environment isn't > "captured" (i.e. > copied from the process environment) when the os module is > imported ? Answer: the part that was informed by a fundamental misunderstanding on my part of how the os module obtai

Re: PATH environment variable

2005-11-20 Thread mirandacascade
I observed something tangential to this topic, and that is the reason for this reply. I don't understand when os.environ gets updated. The '...captured the first time the os mdule is imported...' verbiage from the following link: http://www.python.org/dev/doc/newstyle/lib/os-procinfo.html provi

PATH environment variable

2005-11-19 Thread mirandacascade
O/S: Win2K Vsn of Python:2.4 Based on a search of other posts in this group, it appears as though os.environ['PATH'] is one way to obtain the PATH environment variable. My questions: 1) is it correct that os.environ['PATH'] contains the PATH environment variable? 2) are there other ways to obtain

import statement / ElementTree

2005-11-04 Thread mirandacascade
O/S: Windows 2K Vsn of Python: 2.4 Currently: 1) Folder structure: \workarea\ <- ElementTree files reside here \xml\ \dom\ \parsers\ \sax\ 2) The folder \workarea\ is in the path. 3) A script (which is working) makes calls to the Element(), SubElement(), tostring() and XML() meth

Understanding the arguments for SubElement factory in ElementTree

2005-10-28 Thread mirandacascade
Can the **extra argument in the SubElement() factory in ElementTree be used to set the text property? Example: Want the text associated with the tag to be xyz. xyz rather than: root = Element('root') subroot = SubElement(root, 'subroot') subroot.text = 'xyz' Was wondering whether this code

Re: handling ExpatError exception raised from ElementTree.XML() method

2005-10-27 Thread mirandacascade
Mr. Boddie's suggestions work as indicated...many thanks. It's not clear how a grep of the site-packages directory revealed the most likely location of the ExpatError class is xml.parsers.expat. Using XP's search utility, I searched for any files within the c:\python24\ folder structure that had

handling ExpatError exception raised from ElementTree.XML() method

2005-10-26 Thread mirandacascade
Verion of Python: 2.4 O/S: Windows XP ElementTree resides in the c:\python24\lib\site-packages\elementtree\ folder When a string that does not contain well-formed XML is passed as an argument to the XML() method in ElementTree.py, an ExpatError exception is raised. I can trap the exception with a

find() method in ElementTree

2005-10-22 Thread mirandacascade
I do not understand how to use the find() method in ElementTree. The file 'sample.xml' is: FindMystery abc >>> from elementtree.ElementTree import ElementTree >>> doc = ElementTree(file='sample.xml') >>> iterList = doc.getiterator() >>> iterList [, , , , ]

Minimizing Connection reset by peer exceptions

2005-10-19 Thread mirandacascade
This may be more of a socket question than a python question; not sure. Using this code to instantiate/connect/set options connectionHandle = socket.socket(socket.AF_INET, socket.SOCK_STREAM) errorStatus = connectionHandle.connect_ex((ipAddress, port)) connectionHandle.setsockopt(socket.SOL_SOCKET

where to find information about errors/exceptions in socket.py

2005-10-06 Thread mirandacascade
Version of python: 2.4 O/S: Win2K I will be writing some python scripts to do some client-side programming that involves socket.py. I expect that I will be making calls to the following methods/functions: connect_ex() setsockopt() sendall() recv() close() Where can one find information about wh

Re: accessor/mutator functions

2005-02-25 Thread mirandacascade
If the class had two attributes--x and y--would the code look like something lik this: class C(object): def __init__(self): self.__x = 0 self.__y = 0 def getx(self): return self.__x def setx(self, x): if x < 0: x = 0

accessor/mutator functions

2005-02-25 Thread mirandacascade
When I look at how classes are set up in other languages (e.g. C++), I often observe the following patterns: 1) for each data member, the class will have an accessor member function (a Get function) 2) for each data member, the class will have a mutator member function (a Set function) 3) data memb

progress bar controls in status.py

2005-02-22 Thread mirandacascade
O/S - Windows XP Home with Service Pack 2 Vsn of Python: 2.4 (from ActiveState) This question is with regard to the progress bar controls that are in the file status.py. On my workstation, status.py is located in the: c:\python24\lib\site-packages\pythonwin\pywin\dialogs\ folder. The only modi

introspection inquiry

2005-02-20 Thread mirandacascade
Where in the language would one find the intropsection capability to answer the question: what class am I in? Example: class ExistentialCrisis: def __init__(self, text): self.spam = text print 'In the constructor of the %s class' % When the constructor method is invoked, wou

newbie question - exception processing

2005-02-19 Thread mirandacascade
O/S: Windows XP Service Pack 2 Python version: 2.4 Unable to understand how to build a class to handle an exception. Contents of sample01.py: import exceptions class SampleMain: try: def __init__(self): print 'in SampleMain constructor' def Allowed(self):

newbie question - iterating through dictionary object

2005-02-17 Thread mirandacascade
I am attempting to understand the difference between two techniques that use a for/in loop to iterate through entries in a dictionary object. Copy/paste of interactive window illustrates. >>> a = {} >>> a.update({1:'a'}) >>> a.update({2:'b'}) >>> a {1: 'a', 2: 'b'} >>> for x in a: ... print x

newbie question - identifying name of method

2005-02-14 Thread mirandacascade
Does Python provide some sort of mechanism for answering the question: what method am I in? Example: assume the file example1.py contains the following code: def driver(): print 'hello world' print __name__ print 'the name of this method is %s' % str(???) The output I'd like to see i

python-2.4.msi installation issue

2005-02-02 Thread mirandacascade
O/S: Windows XP Home (with Service Pack 2) Downloaded python-2.4.msi from python.org (10,632KB). When I double click on the file from Windows Explorer, the installation process presents the window in which I am prompted to either install for all users (the default) or install for just me. I selec