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 = LoginRequest passwordthe_password/password

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)

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

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

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:

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:

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();

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 concept

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

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

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

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

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

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

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 is:

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) Traceback (most

insert method in ElementTree

2006-07-16 Thread mirandacascade
O/S: Win2K Vsn of Python: 2.4 Example: a b createAnotherWhenCondition=x ctext for c/c dtext for d/d /b e ftext for f/f gtext for g/g /e h itext for i/i j createAnotherWhenCondition=y ktext for k/k ltext for l/l /j mtext for m/m /h /a

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

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

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 =

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 'str' type(y) type 'str' print x Joe's desk print y Joe's desk if x == y: ... print 'equal' ... else: ... print 'not equal' ... not equal len(x)

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,

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

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)

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

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

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 obtains

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

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()

Understanding the arguments for SubElement factory in ElementTree

2005-10-29 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 subroot tag to be xyz. root subrootxyz/subroot /root rather than: root = Element('root') subroot = SubElement(root, 'subroot') subroot.text = 'xyz'

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

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: ?xml version=1.0? SampleRoot Header ProductFindMystery/Product /Header SpecificInformation SampleDetailabc/SampleDetail /SpecificInformation /SampleRoot from

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))

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

2005-10-07 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

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 Getwhatever function) 2) for each data member, the class will have a mutator member function (a Setwhatver

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

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

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' % whatever When the constructor method is

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 - 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

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