Re: Searching Python-list

2011-01-06 Thread Garland

Amazing you are a genius, I use google chrome and I chose Google Reader
as my solution for the e-mail clutter and response.
RSS from here.

http://permalink.gmane.org/gmane.comp.python.general/681862
All i have to do is click on a response and i'm brought the the search
thank you.

Sent to you by Garland via Google Reader: Re: Searching Python-list via
gmane.comp.python.general by Alice Bevan–McGregor on 1/6/11

On 2011-01-05 17:31:13 -0800, Slie said: Grab a Usenet news reader
(such as Thunderbird or Unison), point it at:
nntps://news.gmane.org/gmane.comp.python.general I can rather quickly
search through articles using this interface (let alone keep my e-mail
clear of mailing lists) and even post. :) - Alice.

Things you can do from here:
- Subscribe to gmane.comp.python.general using Google Reader
- Get started using Google Reader to easily keep up with all your
favorite sites
-- 
http://mail.python.org/mailman/listinfo/python-list


SOAP - Beginner Desperately looking for Help

2005-11-26 Thread Rodney Garland
Hi All,

I am a relative beginner to Python and am looking for help with sending and 
XML message and getting back a return file.  The server is:

https://node.deq.state.or.us/node/node.asmx

I have have successfully sent and recieved using the PING, AUTHENTICATE 
(send in username and password and return a secuirity token), SOLICIT(send 
in information for a query and get a number indicating the query), 
GETSTATUS(status of query) using SOAPpy.  I am using Python 2.4 on a Window 
XP machine.

What I want to do now is download the result of my query using the DOWNLOAD 
method.  However, I cann't figure out how to do this.  I have tried SOAPpy 
and httplib and I cann't send the correct XML outgoing message.  Any help 
with this would be greatly appreciated.  Following is the needed outgoing 
XML file and my successful SOAPpy code.

Thank you,

Rodney ([EMAIL PROTECTED])

POST /node/node.asmx HTTP/1.1
Host: node.deq.state.or.us
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: ""


http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; 
xmlns:tns="http://www.ExchangeNetwork.net/schema/v1.0/node.wsdl"; 
xmlns:types="http://www.ExchangeNetwork.net/schema/v1.0/node.wsdl/encodedTypes"; 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
  http://schemas.xmlsoap.org/soap/encoding/";>
http://www.ExchangeNetwork.net/schema/v1.0/node.xsd";>
  string
  string
  string
  

http://www.ExchangeNetwork.net/schema/v1.0/node.xsd"; 
soapenc:arrayType="q1:NodeDocument[2]">
  
  

http://www.ExchangeNetwork.net/schema/v1.0/node.xsd";>
  string
  string

http://www.ExchangeNetwork.net/schema/v1.0/node.xsd";>
  string
  string

  

Below is an example of the code that does work.

urlNode = 'https://node.deq.state.or.us/node/node.asmx?op=NodePing'
namespace = 'http://www.ExchangeNetwork.net/schema/v1.0/node.xsd'
server = SOAPProxy(urlNode, namespace)
PING = server.NodePing('Ping')

urlAuth = 'https://node.deq.state.or.us/node/node.asmx?op=Authenticate'
# AUTHENTICATE - Returns a variable with the token
server = SOAPProxy(urlAuth, namespace)
token = server.Authenticate(userId='MYUSERNAME', credential='MYPASSWORD', 
authenticationMethod='Invoke')
print token

urlSolicit = 'https://node.deq.state.or.us/node/node.asmx?op=Solicit'
server = SOAPProxy(urlSolicit, namespace)
rowID='0'
maxRows='1000'
service='GetAirMeasurements'
fieldEventStartDate='2005-01-01'
fieldEventEndDate='2005-02-01'
analyteName='PM10'
parameters=[rowID,maxRows,'','','','','','','','','','','','','','','',fieldEventStartDate,fieldEventEndDate,'',analyteName]
transID = server.Solicit(securityToken = token, returnURL = '', request = 
'GetAirMeasurements', parameters = parameters)
print transID





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


Re: SOAP - Beginner Desperately looking for Help

2005-11-26 Thread Rodney Garland
Thanks  :-)


"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>> I wanted to attach these - however, taht didn't work for NNTP, so I mail 
>> them to you.
>
> Didn't work - my mail server won't let me send these to you. So you're on 
> your own here. Shouldn't be too hard :)
>
> Diez 


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


Unpacking problem

2007-03-01 Thread Chris Garland
What's wrong here?

>>> from struct import unpack

I can unpack an unsigned char
>>> unpack('B','\x90')
(144,)

I can unpack a short
>>> unpack('h','\x06\x00')
(6,)

But an unsigned char & a short give me this
>>> unpack('Bh','\x90\x06\x00')
Traceback (most recent call last):
  File "", line 1, in ?
struct.error: unpack str size does not match format
>>>

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


Arrays

2010-11-23 Thread Garland Fulton
Is there a way I can define an Array of and unknown size so I can add and
remove to or from it?

Are arrays immutable?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Arrays

2010-11-29 Thread Garland Fulton
At the top of the last post I didn't understand how I was supposed to have
my e mail headers or my quotes formatted.

I also would like to change the header to my e mail thread. To 

I appolpgize and thank you for clearing up my thinking. I just got  done
with a java class and I should have paid more attention.

Now that I went back and reviewed.

array[]// in java
Is not the same as
list[]   // in python.

I will go back and try my way again.

I have a list of objects built to form numbers given to me already. I would
like to take the list apart iterate over each component and replace it with
the corresponding number, and put it back together again everytime I call
that number(str object) to be printed from my list.

To clear my goals up I don't want to be a bad to this e mail list.

Thank you,

Slie
On Nov 25, 2010 8:43 PM, "Dennis Lee Bieber"  wrote:
> On Thu, 25 Nov 2010 14:32:57 -0900, Slie  declaimed
> the following in gmane.comp.python.general:
>
>> I have an exercise im working on.
>> I have an array of strings, and I would like to take each peace of the
array and assign it to a new array so I can iterate over each of those
pieces and replace the sting I want then put it back together.
>>
>> I hope that is not too confusing. This is how im trying to solve the
problem.
>>
>> I have a program that takes in integers and it prints out the integers in
bigger ones made up of asterisks. Im supposed to alter the program so so
that instead of asterisks it prints them in bigger ones made up of the
number itself.
>>
>> I am given arrays built to look like the numbers, already.
>
> {Note: this newsgroup/list prefers the "trim and follow" method of
> quoting; persist ant "top-posting" will earn the ire of the readers}
>
> We still have the problem that you are referring to "arrays" which
> are NOT native data types in Python... There is an importable module for
> "arrays", and most of the numerics packages (a la numpy) define arrays,
> but Python itself has dynamically sized "lists" (and "lists of lists..."
> to add additional dimensions).
>
> Off-hand, it sounds like you are just substituting a list-of-lists
> (of strings) of asterisks with a list-of-lists containing characters of
> each digit...
>
> Now which part are you having problems with? Extracting the digits
> from the input "number", indexing into the list of digit data, indexing
> into the row of digit data, collecting the data into one output
> structure?
>
> I'm probably giving away too much here but using just 0/1 and input
> as a string...
>
> -=-=-=-=-=-
>
> digits = [ [ " 000 ",
> "0 0",
> "0 0",
> "0 0",
> "0 0",
> " 000 " ],
> [ " 1 ",
> " 11 ",
> " 1 ",
> " 1 ",
> " 1 ",
> " 111 " ] ]
>
> output = []
>
> DATA = "01101"
>
> for row in range(6):
> rowparts = []
> for d in DATA:
> dint = int(d, 10)
> rowparts.append(digits[dint][row])
> output.append(" ".join(rowparts))
>
> print output
> print
>
> for rout in output:
> print rout
> -=-=-=-=-=-=- (use fixed width font to view)
> [' 000 1 1 000 1 ', '0 0 11 11 0 0 11
> ', '0 0 1 1 0 0 1 ', '0 0 1 1 0 0 1
> ', '0 0 1 1 0 0 1 ', ' 000 111 111 000 111
> ']
>
> 000 1 1 000 1
> 0 0 11 11 0 0 11
> 0 0 1 1 0 0 1
> 0 0 1 1 0 0 1
> 0 0 1 1 0 0 1
> 000 111 111 000 111
>
> --
> Wulfraed Dennis Lee Bieber AF6VN
> [email protected] HTTP://wlfraed.home.netcom.com/
>
> --
> http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Google Chart API, HTTP POST request format.

2011-01-05 Thread Garland Fulton
I tried to use "pygooglechart.py" and I have been trying to get it set up
all day actually along with several other graphing API's.

I just found out that there is a problem with numpy and python 3.1 that is
why I moved from the API's. Should I change version just for
these library's?

Should I be learning Python on 3.1?

Awesome!


On Wed, Jan 5, 2011 at 7:52 PM, Chris Rebert  wrote:

> On Wed, Jan 5, 2011 at 7:36 PM, Slie  wrote:
> >
> > http://code.google.com/apis/chart/docs/post_requests.html
> >
> > Google will return a chart in your browser from a URL that you have
> built. If your URL is bigger then 2K characters it will allow you to submit
> POST requests.
> >
> > They gives examples of HTML, JavaScript, and PHP POST requests. Is there
> a way I can submit a request with Python? Or possibly submit the HTML,
> JavaScript or PHP using python?(That was a long shot thought). If I do that
> I would need to find out what to do with the .PNG it gives me.
> >
> > Am I headed in the right direction, is the above paragraph about
> submitting an HTML form from my program even logical?
>
> You should probably first try one of the existing Python wrappers for
> Google's chart API and see if that meets your needs:
> http://code.google.com/p/google-chartwrapper/
> http://pygooglechart.slowchop.com/
>
> Cheers,
> Chris
> --
> http://blog.rebertia.com
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Google Chart API, HTTP POST request format.

2011-01-05 Thread Garland Fulton
Thank you for showing me the POST request, I will defiantly learn a lot from
that.

On Wed, Jan 5, 2011 at 7:26 PM, Tim Harig  wrote:

> On 2011-01-06, Slie  wrote:
> [reformated to <80 columns per RFC 1855 guidelines]
> > I have read several examples on python post requests but I'm not sure
> > mine needs to be that complicated.
>
> >From the HTML example on the page you posted:
>
>
>
>
>
>
>
>
>
>
> you can retreive the same chart from Python:
>
>Python 3.1.2 (r312:79147, Oct  9 2010, 00:16:06)
>[GCC 4.4.4] on linux2
>Type "help", "copyright", "credits" or "license" for more information.
>>>> import urllib.request, urllib.parse
>>>> params = urllib.parse.urlencode({'cht':'lc', 'chtt':'This is | my
>>>> chart',
>... 'chs':'600x200', 'chxt':'x,y', 'chd':'t:40,20,50,20,100'})
>>>> chart = urllib.request.urlopen('https://chart.googleapis.com/chart
> ',
>... data = params).read()
>>>> chartFile = open("chart.png", 'wb')
>>>> chartFile.write(chart)
>10782
>>>> chartFile.close()
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Google Chart API, HTTP POST request format.

2011-01-05 Thread Garland Fulton
On Wed, Jan 5, 2011 at 7:52 PM, Chris Rebert  wrote:

> On Wed, Jan 5, 2011 at 7:36 PM, Slie  wrote:
> >
> > http://code.google.com/apis/chart/docs/post_requests.html
> >
> > Google will return a chart in your browser from a URL that you have
> built. If your URL is bigger then 2K characters it will allow you to submit
> POST requests.
> >
> > They gives examples of HTML, JavaScript, and PHP POST requests. Is there
> a way I can submit a request with Python? Or possibly submit the HTML,
> JavaScript or PHP using python?(That was a long shot thought). If I do that
> I would need to find out what to do with the .PNG it gives me.
> >
> > Am I headed in the right direction, is the above paragraph about
> submitting an HTML form from my program even logical?
>
> You should probably first try one of the existing Python wrappers for
> Google's chart API and see if that meets your needs:
> http://code.google.com/p/google-chartwrapper/
> http://pygooglechart.slowchop.com/
>
> Cheers,
> Chris
> --
> http://blog.rebertia.com
>
Google Chart Wrapper is compatible with 3.1 and i have been looking all day
for something like this. Thank you.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Google Chart API, HTTP POST request format.

2011-01-05 Thread Garland Fulton
On Wed, Jan 5, 2011 at 7:26 PM, Tim Harig  wrote:

> On 2011-01-06, Slie  wrote:
> [reformated to <80 columns per RFC 1855 guidelines]
> > I have read several examples on python post requests but I'm not sure
> > mine needs to be that complicated.
>
> >From the HTML example on the page you posted:
>
>
>
>
>
>
>
>
>
>
> you can retreive the same chart from Python:
>
>Python 3.1.2 (r312:79147, Oct  9 2010, 00:16:06)
>[GCC 4.4.4] on linux2
>Type "help", "copyright", "credits" or "license" for more information.
>>>> import urllib.request, urllib.parse
>>>> params = urllib.parse.urlencode({'cht':'lc', 'chtt':'This is | my
>>>> chart',
>... 'chs':'600x200', 'chxt':'x,y', 'chd':'t:40,20,50,20,100'})
>>>> chart = urllib.request.urlopen('https://chart.googleapis.com/chart
> ',
>... data = params).read()
>>>> chartFile = open("chart.png", 'wb')
>>>> chartFile.write(chart)
>10782
>>>> chartFile.close()
> --
> http://mail.python.org/mailman/listinfo/python-list
>

Hope this isn't to stupid,

For the
chart = urllib.request.urlopen('https://chart.googleapis.com/chart', data =
params).read()

Where would I find information on why and what the ).read() part does.

Thank you,
-- 
http://mail.python.org/mailman/listinfo/python-list


Error invalid syntax while statement

2011-01-07 Thread Garland Fulton
I don't understand what I'm doing wrong i've tried several different cases
for what i am doing here. Will someone please point my error out.

Thank you.


  1 #!/bin/bash/python
  2 import math
  3 try:
  4 x = int(input("Enter your number: "))
  5 if( 0 > x | x > 2147483647):
  6 raise Exception()
  7 else:
  8 end = 0
  9 count = 0
 10 count1 = x
 11 counter = 0
 12 print("end: ", end)
 13 print("count: ", count)
 14 print("count1: ", count1)
 15 print("counter: ", counter
 16
 17   while (end == 0):  #
<---returns syntax error on this while statement
 18   if(count < x):
 19
 20   sol = math.pow(count, 2) + math.pow(count1, 2)
 21   count += 1
 22   count1 -= 1
 23   print("end: ", end)
 24   print("count: ", count)
 25   print("count1: ", count1)
 26   print("counter: ", counter
 27   if( sol == x):
 28   counter += x
 29   else:
 30   end = 1
 31 except Exception as ran:
 32print("Value not within range", ran)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Error invalid syntax while statement

2011-01-07 Thread Garland Fulton
On Fri, Jan 7, 2011 at 8:28 PM, Ned Deily  wrote:

> In article
> ,
>  Garland Fulton  wrote:
> > I don't understand what I'm doing wrong i've tried several different
> cases
> > for what i am doing here. Will someone please point my error out.
>
> >  15 print("counter: ", counter
>
> Missing ")" on line 15.
>
> --
>  Ned Deily,
>  [email protected]
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>


  1 #!/bin/bash/python
  2 import math
  3 try:
  4 x = int(input("Enter your number: "))
  5 if 0 >  x > 2147483647:
  6 raise Exception()
  7 else:
  8 end = 0
  9 count = 0
 10 count1 = x
 11 counter = 0
 12 print("end: ", end)
 13 print("count: ", count)
 14 print("count1: ", count1)
 15 print("counter: ", counter)
 16
 17   while end == 0:  #
<---returns syntax error on this while statement
 18   if(count < x):
 19
 20   sol = math.pow(count, 2) + math.pow(count1, 2)
 21   count += 1
 22   count1 -= 1
 23   print("end: ", end)
 24   print("count: ", count)
 25   print("count1: ", count1)
 26   print("counter: ", counter)
 27   if sol == x:
 28   counter += x
 29   else:
 30   end = 1
 31 except Exception as ran:
 32print("Value not within range", ran)


  File "blah.py", line 17
while (end == 0):  #
<---returns syntax error on this while statement
^
IndentationError: unexpected indent

Thank you and I'm sorry for the very blind question, it was because of the
missing par-ends  I have spent a while on this won't happen again. What is
wrong with my shebang line?
Thank you for the syntax tips!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Error invalid syntax while statement

2011-01-07 Thread Garland Fulton
On Fri, Jan 7, 2011 at 8:55 PM, Chris Rebert  wrote:

> On Fri, Jan 7, 2011 at 9:46 PM, Garland Fulton 
> wrote:
> 
> >   1 #!/bin/bash/python
> 
> > What is
> > wrong with my shebang line?
>
> Its path is invalid (unless you're using a *very* weird system).
> /bin/bash is the bash shell executable; bash is completely unrelated
> to Python. Further, /bin/bash is a file, not a directory.
>
> The shebang for Python is normally one of the following:
> #!/usr/bin/env python
> #!/usr/bin/python
>
> Cheers,
> Chris
> --
> http://blog.rebertia.com
>


Great I have learned a ton and these questions will not arise again.
-- 
http://mail.python.org/mailman/listinfo/python-list


Useing the processor clock, or get time in Femptoseconds

2011-01-30 Thread Garland Fulton
Does anyone have any suggestions?
-- 
http://mail.python.org/mailman/listinfo/python-list