creating a python program to control the cursor and click a location on the screen at specified delay interval?

2010-01-21 Thread John Haggerty
HiSo just testing the feasibility of doing this but I was interested in
creating a primitive way of scripting gui applications w/o using a remote
network client by having the application up and then almost just using the
pointer position to figure out where it is and then click it and any
subsequent dialogs. I would have to assume that someone has done something
like this.

In principle this could be done I don't know if this is possible to
implement in python cross platform but the system I am using is just your
standard Ubuntu Linux 9.10 system.

Would be interesting to see something already in existance however to avoid
duplication of work.
-- 
http://mail.python.org/mailman/listinfo/python-list


Persistent Distributed Objects

2009-10-08 Thread John Haggerty
I am interested in seeing how it would be possible in python to have
persistent objects (basically be able to save objects midway through a
computation, etc) and do so across multiple computers.

Something that would allow for memory, disk space, processing power, etc to
be distributed across the nodes not just for number crunching.

So for example a warehouse program started up on 3 machines one for adding
orders, one for searching for orders, one for organizing the warehouse and
them running on a different machine with a single interface.

I've seen evidence about this being done wrt what looks like insanely
complex stuff on this list but I'm wondering if there is something to do
this with any number of nodes and just farm out random classes/objects to
them?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Persistent Distributed Objects

2009-10-11 Thread John Haggerty
Does pyro work inside of stackless?

On Sat, Oct 10, 2009 at 9:54 AM, Simon Forman  wrote:

> On Fri, Oct 9, 2009 at 1:11 AM, John Haggerty  wrote:
> > I am interested in seeing how it would be possible in python to have
> > persistent objects (basically be able to save objects midway through a
> > computation, etc) and do so across multiple computers.
> >
> > Something that would allow for memory, disk space, processing power, etc
> to
> > be distributed across the nodes not just for number crunching.
> >
> > So for example a warehouse program started up on 3 machines one for
> adding
> > orders, one for searching for orders, one for organizing the warehouse
> and
> > them running on a different machine with a single interface.
> >
> > I've seen evidence about this being done wrt what looks like insanely
> > complex stuff on this list but I'm wondering if there is something to do
> > this with any number of nodes and just farm out random classes/objects to
> > them?
>
>
> Check out Pyro (Python Remote Objects): http://pyro.sourceforge.net/
>
> or perhaps Stackless Python http://www.stackless.com/ (Tasklets can be
> serialized and passed around.)
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: getting a "simple" program to work

2009-08-11 Thread John Haggerty
just checking to see if there is any input that may have been misdirected to
a spam filter.
Would love to see some feedback if I may

On Sun, Aug 9, 2009 at 6:42 PM, John Haggerty  wrote:

> ok so I know this is one of those "weird" requests but here me out.
> So far I have an issue with a package for python called "libgmail" which is
> basically a gmail interface for python to send messages remoetly.
>
> Works ok except that the 'sendMessage' routine is bad.
>
> This is included in the above attachment
>
> it's used in a program called "ogss" which is an sms interface to gmail to
> basically read gmail and then have a command done on a remote machine and
> then spat out on the local machine to a log file that's opened and then
> emailed back
>
> problem is that the sending back routine fails.
>
> Now I've found a program that will more or less do what is requied but it's
> not really exactly what would be used in that it doesn't use the libgmail
> routine.
>
> So far the maintainer of both packages seem to be afk or not having their
> routines fixed and so far debian/Unbuntu claim that the last version of the
> package has been fixed :(
>
> Is there a recommendatin of how to combine/alter so that ogss can transmit?
> My main issue is that python is lesser known to me than Chinese (which I
> also don't know).
>
> My idea of this is to have a remote email timeclock program which could
> then be scripted with any language or just "echo >>blah" if necessary.
>
> Thanks in advance :)
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: getting a "simple" program to work

2009-08-11 Thread John Haggerty
On Tue, Aug 11, 2009 at 10:46 PM, Chris Rebert  wrote:

> On Sun, Aug 9, 2009 at 8:42 PM, John Haggerty wrote:
> > ok so I know this is one of those "weird" requests but here me out.
> > So far I have an issue with a package for python called "libgmail" which
> is
> > basically a gmail interface for python to send messages remoetly.
> > Works ok except that the 'sendMessage' routine is bad.
>
> How is it "bad" precisely? Be specific (e.g. error message(s),
> description of observed incorrect behavior).
>

In regards to bad would be failing to transmit claiming that the submittal
is wrong for the transmit string.

(where username is my gmail username and "password" is my gmail password to
the test account, 666969 is the mobile number in question '00' is my
"carrier id" from the ogss code example which is just an array location from
a preformatted part of the string [probably from wikipedia on mobile carrier
email addresses to cell phones], I actually got desperate and commented out
the first attempt to transmit which I located in the code as just the
"instructions" the code fails on re-transmission, I later on looked at the
file and located that it was a zero byte file of no content. The program
itself looks for a command from the user's cell phone directly from mms sent
to the target gmail account prefaced by "Ogss" and anything else is treated
as a command but since the command failed on the first transmit I don't
think it's the command per se).

ow...@bouncyinc:~/Desktop/OGSS$ python ogss.py username password 666969
00
Starting ogss
Logfile at:/home/owner/ogss.log
Opening log file for reading
Parsing user input
Connecting to Gmail
Logging into Gmail
Opening log file for writing
Listening for commands
Processing Command
ls: unrecognized option `-'
Try `ls --help' for more information.
Seding back results
Traceback (most recent call last):
  File "ogss.py", line 127, in 
main(sys.argv)
  File "ogss.py", line 110, in main
account.sendMessage(tosend)
  File "/usr/lib/python2.5/site-packages/libgmail.py", line 615, in
sendMessage
raise GmailSendError, resultInfo[SM_MSG]
libgmail.GmailSendError: Please try again.

I traced the result to the sendMessage routine and noted that anytime it
tries to send anything it fails this also fails with the standard "docs"
package for libgmail 0.30 docs from the maintainer's site.

Now the part where it *does* fail is where it has an issue with looking at
the trailing info but then it would have logged the info to the file and
emailed me back junk (which it didn't)

I assume this could be done on any system just replace 'ls' with 'dir' or
the equivalent.


>
> > This is included in the above attachment
> > it's used in a program called "ogss" which is an sms interface to gmail
> to
> > basically read gmail and then have a command done on a remote machine and
> > then spat out on the local machine to a log file that's opened and then
> > emailed back
> > problem is that the sending back routine fails.
>
> Which routine is that exactly? Please also specify exactly how it is
> failing (e.g. error message(s), description of observed incorrect
> behavior).
>
> I apologize if these questions are answered in comments in the
> attachments, but to be honest, the fact that you didn't (or couldn't)
> put the specific problematic sections of code (and/or error messages)
> inline in your message makes it less likely that people (such as
> myself) will try to help you due to the volume of code you're making
> people wade through (i.e. people tend not to read large code dumps,
> /especially/ in attachments).
>
> Cheers,
> Chris
> --
> http://blog.rebertia.com
>
That's ok I understand I hope that helps at least in part.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: getting a "simple" program to work

2009-08-12 Thread John Haggerty
Just checking to see if this is more adequate to what you would have wanted
to see I didn't get any feedback so I wasn't quite sure of this at the
present time.

On Tue, Aug 11, 2009 at 11:02 PM, John Haggerty  wrote:

>
>
> On Tue, Aug 11, 2009 at 10:46 PM, Chris Rebert  wrote:
>
>> On Sun, Aug 9, 2009 at 8:42 PM, John Haggerty wrote:
>> > ok so I know this is one of those "weird" requests but here me out.
>> > So far I have an issue with a package for python called "libgmail" which
>> is
>> > basically a gmail interface for python to send messages remoetly.
>> > Works ok except that the 'sendMessage' routine is bad.
>>
>> How is it "bad" precisely? Be specific (e.g. error message(s),
>> description of observed incorrect behavior).
>>
>
> In regards to bad would be failing to transmit claiming that the submittal
> is wrong for the transmit string.
>
> (where username is my gmail username and "password" is my gmail password to
> the test account, 666969 is the mobile number in question '00' is my
> "carrier id" from the ogss code example which is just an array location from
> a preformatted part of the string [probably from wikipedia on mobile carrier
> email addresses to cell phones], I actually got desperate and commented out
> the first attempt to transmit which I located in the code as just the
> "instructions" the code fails on re-transmission, I later on looked at the
> file and located that it was a zero byte file of no content. The program
> itself looks for a command from the user's cell phone directly from mms sent
> to the target gmail account prefaced by "Ogss" and anything else is treated
> as a command but since the command failed on the first transmit I don't
> think it's the command per se).
>
> ow...@bouncyinc:~/Desktop/OGSS$ python ogss.py username password
> 666969 00
> Starting ogss
> Logfile at:/home/owner/ogss.log
> Opening log file for reading
> Parsing user input
> Connecting to Gmail
> Logging into Gmail
> Opening log file for writing
> Listening for commands
> Processing Command
> ls: unrecognized option `-'
> Try `ls --help' for more information.
> Seding back results
> Traceback (most recent call last):
>   File "ogss.py", line 127, in 
> main(sys.argv)
>   File "ogss.py", line 110, in main
> account.sendMessage(tosend)
>   File "/usr/lib/python2.5/site-packages/libgmail.py", line 615, in
> sendMessage
> raise GmailSendError, resultInfo[SM_MSG]
> libgmail.GmailSendError: Please try again.
>
> I traced the result to the sendMessage routine and noted that anytime it
> tries to send anything it fails this also fails with the standard "docs"
> package for libgmail 0.30 docs from the maintainer's site.
>
> Now the part where it *does* fail is where it has an issue with looking at
> the trailing info but then it would have logged the info to the file and
> emailed me back junk (which it didn't)
>
> I assume this could be done on any system just replace 'ls' with 'dir' or
> the equivalent.
>
>
>>
>> > This is included in the above attachment
>> > it's used in a program called "ogss" which is an sms interface to gmail
>> to
>> > basically read gmail and then have a command done on a remote machine
>> and
>> > then spat out on the local machine to a log file that's opened and then
>> > emailed back
>> > problem is that the sending back routine fails.
>>
>> Which routine is that exactly? Please also specify exactly how it is
>> failing (e.g. error message(s), description of observed incorrect
>> behavior).
>>
>> I apologize if these questions are answered in comments in the
>> attachments, but to be honest, the fact that you didn't (or couldn't)
>> put the specific problematic sections of code (and/or error messages)
>> inline in your message makes it less likely that people (such as
>> myself) will try to help you due to the volume of code you're making
>> people wade through (i.e. people tend not to read large code dumps,
>> /especially/ in attachments).
>>
>> Cheers,
>> Chris
>> --
>> http://blog.rebertia.com
>>
> That's ok I understand I hope that helps at least in part.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: getting a "simple" program to work

2009-08-14 Thread John Haggerty
I'm checking back with some new info.

Apparently the maintainer of the ogss package indicated that this is
definately an issue with the libgmail package.

Now I have already submtted help to the maintainer of libgmail to get some
help it making his project work again.

I am also interesetd in how roundabout smtp support could be added to that
program specifically

print "Seding back results"
account.sendMessage(tosend)
print "Logging..."
execd.append(int(maxmessage.id,16))
towrite = str(int(maxmessage.id,16))+"~ "
for arg in command:
towrite += arg+" "
w.write(towrite+"\n")
print "Listening for commands"

in the code sample from ogss.py to take that subroutine and turn it around
to allow the same arguments

basically take the above

and add

-

gmail_user = ""#Username
gmail_pwd  = ""#Password
gmail_alt  = " "#Alias ID
gmail_alias = ""+gmail_alt#nickname
mailing_list = ""
class mailz:
  def __init__(self):
self.files=[""]
self.mail = MIMEMultipart()

  def attach(self,fil):
self.files.append(fil)

  def mailprep(self,to, subject, text):
self.to = to
self.mail['From'] = gmail_alias
self.mail['To'] = to
self.mail['Subject'] = subject
if (mailtoBcc !="") :
  self.mail['BCC'] = mailtoBcc

text+="\n\n\n_\nMail generated By  PyGmS
"+ver+"\n - Made By Djays\nhttp://djsh.net";

self.mail.attach(MIMEText(text))
print self.files

for attach in self.files:
  if (attach != "") :
  part = MIMEBase('application', 'octet-stream')
  part.set_payload(open(attach, 'rb').read())
  Encoders.encode_base64(part)
  part.add_header('Content-Disposition','attachment; filename="%s"'
%
os.path.basename(attach))
  self.mail.attach(part)

  def sendmail(self):
self.mailServer = smtplib.SMTP("smtp.gmail.com", 587)
self.mailServer.ehlo()
self.mailServer.starttls()
self.mailServer.ehlo()
self.mailServer.login(gmail_user, gmail_pwd)
self.mailServer.sendmail(gmail_user, self.to, self.mail.as_string())
self.mailServer.close()


I hate to sound like a newb but the problem is that I'm running into
apathetic maintainers of the software in question which has yet to be
redacted as "working" and at the present time I have to deal with
multi-server conglomerates like "Request Tracker" or "Roundup" both of which
are simply not authenticating into gmail at all.

At first I thought this was an issue of the ssl certificates not working but
hen how come it's possible to have any of the code working when it's just
the sending?

And how is it possible that generic but different code can be working when
it's all broken?

Not to sound in any way belligerent but when this would be my 5th program
language to solve a simple problem I think this is solveable w/o having to
resort to the equivalent to a half semester of CS I in python imho.

On Wed, Aug 12, 2009 at 10:41 PM, John Haggerty  wrote:

> Just checking to see if this is more adequate to what you would have wanted
> to see I didn't get any feedback so I wasn't quite sure of this at the
> present time.
>
>
> On Tue, Aug 11, 2009 at 11:02 PM, John Haggerty wrote:
>
>>
>>
>> On Tue, Aug 11, 2009 at 10:46 PM, Chris Rebert  wrote:
>>
>>> On Sun, Aug 9, 2009 at 8:42 PM, John Haggerty
>>> wrote:
>>> > ok so I know this is one of those "weird" requests but here me out.
>>> > So far I have an issue with a package for python called "libgmail"
>>> which is
>>> > basically a gmail interface for python to send messages remoetly.
>>> > Works ok except that the 'sendMessage' routine is bad.
>>>
>>> How is it "bad" precisely? Be specific (e.g. error message(s),
>>> description of observed incorrect behavior).
>>>
>>
>> In regards to bad would be failing to transmit claiming that the submittal
>> is wrong for the transmit string.
>>
>> (where username is my gmail username and "password" is my gmail password
>> to the test account, 666969 is the mobile number in question '00' is my
>> "carrier id" from the ogss code example which is just an array location from

Re: OT Signature quote [was Re: Unrecognized escape sequences in string literals]

2009-08-15 Thread John Haggerty
I guess the problem is---does it actually matter?

On Fri, Aug 14, 2009 at 10:11 AM, Steven D'Aprano <
st...@remove-this-cybersource.com.au> wrote:

> On Fri, 14 Aug 2009 07:07:31 -0700, Aahz wrote:
>
> > "I saw `cout' being shifted "Hello world" times to the left and stopped
> > right there."  --Steve Gonedes
>
> Assuming that's something real, and not invented for humour, I presume
> that's describing something possible in C++. Am I correct? What the hell
> would it actually do???
>
>
> --
> Steven
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


redoing libgmail interface to "smtplib" blah?

2009-08-15 Thread John Haggerty
The following program is theoretically supposed to use a supported library.
Issues have come up where the library is not working and now another
interface is being requierd to be used.

At this point I'm looking at just changing the send commands but don't feel
confident in doing so. Wondering specifically what would have to be changed
to what.

Thanks for your time :)

#!/usr/bin/env python
#
# ogss -- SMS Shell through Gmail and libgmail
#
# Version 0.2
#
# Author: bto...@mastahyeti.com
#
# License: GPL 2.0
#
# NOTE:
#   You should ensure you are permitted to use this script before using it
#   to access Google's Gmail servers.
#
def main(argv):
print "Starting ogss"

logfile = os.path.join(os.environ["HOME"],"ogss.log")
print "Logfile at:"+logfile
execd = []
#Checking to see if the logfile already exists
#if it doesn't we create it.
if not os.path.exists(logfile):
print "Creating log file"
try:
open(logfile,"w").close()
except:
print "Failed to open create log file. Check permissions"
exit()
#Opening log file for reading and parseing its contents into a list
#Must do this to ensure that we dont execute old commands
print "Opening log file for reading"
try:
r = open(logfile,"r")
for line in r:
eid = line.split("~")
if len(eid)>=2:
execd.append(int(eid[0]))
r.close()
except:
print "Failed to open or read log file. Check permissions"
exit()

clist = [["3 River Wireless","@sms.3rivers.net"],["7-11 Speakout","@
cingularme.com"],["Airtel (Karnataka","India)Alaska Communications
Systems"],["Alltel Wireless","@message.alltel.com"],["AT&T Wireless","@
txt.att.net"],["Bell Mobility (Canada)","@txt.bell.ca"],["Boost Mobile","@
myboostmobile.com"],["Cellular One
(Dobson)","@mobile.celloneusa.com"],["Cingular
(Postpaid)","@cingularme.com"],["Centennial
Wireless","@cwemail.com"],["Cingular
(GoPhone prepaid)","@cingularme.com"],["Claro (Nicaragua)","@
ideasclaro-ca.com"],["Comcel","@comcel.com.co"],["Cricket","@
sms.mycricket.com"],["CTI","@sms.ctimovil.com.ar"],["Emtel (Mauritius)","@
emtelworld.net"],["Fido (Canada)","@fido.ca"],["General Communications
Inc.","@msg.gci.net"],["Globalstar","@msg.globalstarusa.com"],["Helio","@
myhelio.com"],["Illinois Valley Cellular","@ivctext.com"],["i wireless",".
i...@iwspcs.net"],["Meteor (Ireland)","@sms.mymeteor.ie"],["Mero Mobile
(Nepal)","@sms.spicenepal.com"],["MetroPCS","@mymetropcs.com"],["Movicom","@
movimensaje.com.ar"],["Mobitel (Sri Lanka)","@sms.mobitel.lk"],["Movistar
(Colombia)","@movistar.com.co"],["MTN (South Africa)","@sms.co.za"],["MTS
(Canada)","@text.mtsmobility.com"],["Nextel
(Argentina)","@nextel.net.ar"],["Orange
(Poland)","@orange.pl"],["Personal (Argentina)","@personal-net.com.ar"],["Plus
GSM (Poland)","@text.plusgsm.pl"],["President\s Choice (Canada)","@
txt.bell.ca"],["Qwest","@qwestmp.com"],["Rogers
(Canada)","@pcs.rogers.com"],["Sasktel
(Canada)","@sms.sasktel.com"],["Setar Mobile email (Aruba)","@mas.aw"],["Solo
Mobile","@txt.bell.ca"],["Sprint (PCS)","@messaging.sprintpcs.com"],["Sprint
(Nextel)","@page.nextel.com"],["Suncom","@tms.suncom.com"],["T-Mobile","@
tmomail.net"],["T-Mobile (Austria)","@sms.t-mobile.at"],["Telus Mobility
(Canada)","@msg.telus.com"],["Thumb Cellular","@sms.thumbcellular.com"],["Tigo
(Formerly Ola)","@sms.tigo.com.co"],["Unicel","@utext.com"],["US
Cellular","@email.uscc.net"],["Verizon","@vtext.com"],["Virgin Mobile
(Canada)","@vmobile.ca"],["Virgin Mobile (USA)","@vmobl.com"],["YCC","@
sms.ycc.ru"],["Orange (UK)","@orange.net"],["Cincinnati Bell Wireless","@
gocbw.com"],["T-Mobile Germany","@t-mobile-sms.de"],["Vodafone Germany","@
vodafone-sms.de"],["E-Plus","@smsmail.eplus.de"]]

print "Parsing user input"
if len(argv)<4:
if len(argv) == 2:
if argv[1] == "-c":
counter = 0
for car in clist:
print str(counter) + "--" + car[0]
counter += 1
exit()
else:
print
"--Useage---\n\r--Start
Service --- ogss.py USERNAME PASSWORD CELL-NUMBER
CARRIER-NUMBER\n\r--List carriers --- ogss.py -c"
print "--Useage from
phone\n\r--Ogss
COMMAND"
exit()
username   = argv[1]
password   = argv[2]
number = argv[3]
carrier = clist[int(argv[4])]
cell_email = number+carrier[1]

print "Connecting to Gmail"
account = libgmail.GmailAccount(username,password)
print "Logging into Gmail"
account.login()

print "Opening log file for writing"
try:
w = open(logfile,"a")
except:
print "Failed to open log file. Check permissions."
exit()

#If the logfile is empty (if this is the first use) we want to

Re: random.gauss vs. random.normalvariate

2009-08-15 Thread John Haggerty
What does the term "thread safe" mean exactly. I never had to program with
"threads" before

On Sat, Aug 15, 2009 at 2:26 PM, Carl Banks wrote:

> On Aug 15, 12:49 pm, Alan G Isaac  wrote:
> > Quotinghttp://docs.python.org/3.1/library/random.html#random.gauss:
> > Gaussian distribution. mu is the mean, and sigma is the
> > standard deviation. This is slightly faster than the
> > normalvariate() function defined below.
> >
> > So since both are offered and gauss is faster, I assume it
> > must have some offsetting disadvantage.  What is it?
>
> random.gauss is not thread safe.
>
> I'm kind of surprised the html docs don't mention this; the docstring
> does.
>
>
> Carl Banks
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: redoing libgmail interface to "smtplib" blah?

2009-08-15 Thread John Haggerty
On Sat, Aug 15, 2009 at 7:23 PM, Dennis Lee Bieber wrote:

> On Sat, 15 Aug 2009 14:23:26 -0600, John Haggerty 
> declaimed the following in gmane.comp.python.general:
>
> > The following program is theoretically supposed to use a supported
> library.
> > Issues have come up where the library is not working and now another
> > interface is being requierd to be used.
> >
> > At this point I'm looking at just changing the send commands but don't
> feel
> > confident in doing so. Wondering specifically what would have to be
> changed
> > to what.
> >
> > Thanks for your time :)
>
> Ugh... I'm afraid if I attacked this program I'd have to
> restructure
> the entire thing... There are no signs of any functional decomposition
> in that -- if Python had an unstructured GOTO, I'd suspect this would
> have been a spaghetti-code program... As it is, the best I can call it
> is lasagna-code  (interwoven but distinct layers in a linear form
> from one end to the other).
>
>
> > if __name__ == "__main__":
> > import os,time,sys,libgmail
> > from subprocess import Popen,PIPE
> > main(sys.argv)
>
> Given the position of the import statements, this file can NOT be
> used as an importable module for use by other programs, so the whole
> breakdown of a main() is meaningless; might as well remove that if, the
> def main(): line, move the imports to the top, and unindent the rest one
> level.
>
>All those embedded calls to exit() also offend me; I'm from the "one
> in, one out" school (though I'll use break and continue in a loop, I
> still favor just one usage of them in such)
>
>Ideally, all the SMS related stuff would be isolated apart from the
> email stuff. Would make changing email interface a lot more intuitive.
>
>Out of a fit of boredom, though it probably doesn't help your real
> problem, and it has not been tested at all, this is my restructuring of
> the code listing.
>
> -=-=-=-=-=-=-=-
> import os
> import time
> import sys
> import subprocess
>
> import libgmail
>
>
> CARRIERLIST = [   ("3 River Wireless", "@sms.3rivers.net"),
>   ("7-11 Speakout","@cingularme.com"),
>  #("Airtel (Karnataka","India) Alaska
> Communications Systems"),
>  ("Alltel Wireless","@message.alltel.com"),
>  ("AT&T Wireless","@txt.att.net"),
>  ("Bell Mobility (Canada)","@txt.bell.ca"),
>  ("Boost Mobile","@myboostmobile.com"),
>  ("Cellular One (Dobson)","@mobile.celloneusa.com"),
>  ("Cingular (Postpaid)","@cingularme.com"),
>  ("Centennial Wireless","@cwemail.com"),
>  ("Cingular (GoPhone prepaid)","@cingularme.com"),
>  ("Claro (Nicaragua)","@ideasclaro-ca.com"),
>  ("Comcel","@comcel.com.co"),
>  ("Cricket","@sms.mycricket.com"),
>  ("CTI","@sms.ctimovil.com.ar"),
>  ("Emtel (Mauritius)","@emtelworld.net"),
>  ("Fido (Canada)","@fido.ca"),
>  ("General Communications Inc.","@msg.gci.net"),
>  ("Globalstar","@msg.globalstarusa.com"),
>  ("Helio","@myhelio.com"),
>  ("Illinois Valley Cellular","@ivctext.com"),
>  #("i wireless","@iwspcs.net"),
>  ("Meteor (Ireland)","@sms.mymeteor.ie"),
>  ("Mero Mobile (Nepal)","@sms.spicenepal.com"),
>  ("MetroPCS","@mymetropcs.com"),
>  ("Movicom","@movimensaje.com.ar"),
>  ("Mobitel (Sri Lanka)","@sms.mobitel.lk"),
>  ("Movistar (Colombia)","@movistar.com.co"),
>  ("MTN (South Africa)","@sms.co.za"),
>  ("MTS (Canada)","@text.mtsmobility.com"),
>  ("Nextel (Argentina)","@nextel.net.ar"),
>  ("Orange (Poland)","@orange.pl"),
>   

Re: A Exhibition Of Tech Geekers Incompetence: Emacs whitespace-mode

2009-08-15 Thread John Haggerty
I would have to agree with that since I've had to work with Word 2007 issues
with formatting from some...demanding people in the past. Took at least
1hour plus.

On Sat, Aug 15, 2009 at 8:22 PM, Steven D'Aprano <
st...@remove-this-cybersource.com.au> wrote:

> On Sat, 15 Aug 2009 12:24:26 -0700, John Nagle wrote:
>
> > fortunatus wrote:
> >> On Aug 14, 1:01 pm, vippstar  wrote:
> >>> Why would you fill your website with junk?
> >>
> >> The OP made it clear:
> >>
> >>> Just wanted to express some frustration with whitespace-mode.
> >
> > Well, it took until Python 3.0 until Python enforced rules that
> > ensured that the indentation the user sees is the same indentation the
> > compiler sees.  We finally have a solution that allows both tabs and
> > spaces but disallows the situations which are ambiguous.  Until Python
> > 3.0 is fully deployed, there are situations when you need an insane
> > level of tab/space visibility.  Blame Python, not EMACS.
>
> You know, there are situations outside of Python where it is useful to
> see otherwise invisible characters. I was using Microsoft Word's "Show
> Invisibles" functionality years before Python even existed. Being able to
> see a visual glyph in place of whitespace (including line ending
> characters) is not just useful for editing indentation.
>
>
>
> --
> Steven
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: unittest

2009-08-15 Thread John Haggerty
This is an interesting question. I am just wondering: do you really have
that many features that it would be impossible to just have a shell script
run specific types of input or tests?

When I did programming in the past for education they just had lists of
input data and we ran the program against the test data.

I just get slightly confused when "test suites" start to have to apply?

On Fri, Aug 14, 2009 at 9:28 PM, Mag Gam  wrote:

> I am writing an application which has many command line arguments.
> For example: foo.py -args "bar bee"
>
> I would like to create a test suit using unittest so when I add
> features to "foo.py" I don't want to break other things. I just heard
> about unittest and would love to use it for this type of thing.
>
> so my question is, when I do these tests do I have to code them into
> foo.py? I prefer having a footest.py which will run the regression
> tests. Any thoughts about this?
>
> TIA
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ignored test cases in unittest

2009-08-15 Thread John Haggerty
So you are saying you have several hundred tests you have to do on your
program?

On Sat, Aug 15, 2009 at 7:04 PM, Terry  wrote:

> Hi,
>
> I have some 100s unittest cases with my python program. And sometimes,
> I did quick-and-dirty work by ignoring some test cases by adding an
> 'x' (or something else) to the beginning of the case name.
> As time pass by, it's very hard for me to find which test cases are
> ignored.
>
> It seemed the to me that python unittest module does not support the
> counting of ignored test cases directly. Is there any ready solution
> for this?
>
> br, Terry
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python or ActionScript 3.0

2009-08-15 Thread John Haggerty
If it were me I'd go with python at least based on the fact that it's more
supported and more popular, enough so that it has o'reiley soruces on it.

On Sat, Aug 15, 2009 at 3:32 PM, Jaseem  wrote:

> Hi,
>
> Is python similar to actionscript 3.0
> Which is better to create a rich gui internet application?
> Is it AS 3.0 with flex or python with its GUI libs?
>
> Is python in demand?
> Heard that python is similar to lisp. But both python and AS 3.0 is
> almost identical. Which is more similar to lisp are powerful?
>
> Thank You.
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: random.gauss vs. random.normalvariate

2009-08-15 Thread John Haggerty
On Sat, Aug 15, 2009 at 7:23 PM, Dennis Lee Bieber wrote:

> On Sat, 15 Aug 2009 14:34:36 -0600, John Haggerty 
> declaimed the following in gmane.comp.python.general:
>
> > What does the term "thread safe" mean exactly. I never had to program
> with
> > "threads" before
>
> That, part way through the logic of the function, control could be
> switched to a different thread which call the same function... This
> second call would change some of the internal values and may then be
> preempted and control returned to the first thread, which continues the
> rest of the function with different values then it had when first
> preempted.
>
>A very contrived example, untested of course, consider it
> pseudo-code...
>
> startt = None
>
> def atimer():
>global startt
>startt = time.time()
>time.sleep(5)
>print time.time() - startt
>
> t1 = threading.thread(atimer)
> t2 = threading.thread(atimer)
> t1.start()
> t2.start()
>
> Say t1 gets all the way up to the sleep call, and (since sleep is a
> releasing call), t2 then starts. t2 changes the value of startt; and
> sleeps... both sleep and presuming the resolution is fine enough, t1
> resumes, and  prints a delta time that is incorrect -- it is printing
> the time difference from when t2 started to sleep, not from when t1
> started to sleep.
> --
>Wulfraed Dennis Lee Bieber   KD6MOG
>wlfr...@ix.netcom.com   HTTP://wlfraed.home.netcom.com/
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>

Interesting so it seems that the compiler(c/c++)interpreter(perl,
python)/vm(java) doesn't do this?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: random.gauss vs. random.normalvariate

2009-08-15 Thread John Haggerty
Erlang I assume is a computer programming language?

On Sat, Aug 15, 2009 at 10:18 PM, Paul Rubin
wrote:

> Dennis Lee Bieber  writes:
> >   No language can guard against independent access of a shared/global
> > object by multiple threads...
>
> Erlang?
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: redoing libgmail interface to "smtplib" blah?

2009-08-15 Thread John Haggerty
I did detect one problem thus far

 File "test.py", line 152
if len(args) == 1 and args[0] = "-c":


On Sat, Aug 15, 2009 at 7:23 PM, Dennis Lee Bieber wrote:

> On Sat, 15 Aug 2009 14:23:26 -0600, John Haggerty 
> declaimed the following in gmane.comp.python.general:
>
> > The following program is theoretically supposed to use a supported
> library.
> > Issues have come up where the library is not working and now another
> > interface is being requierd to be used.
> >
> > At this point I'm looking at just changing the send commands but don't
> feel
> > confident in doing so. Wondering specifically what would have to be
> changed
> > to what.
> >
> > Thanks for your time :)
>
> Ugh... I'm afraid if I attacked this program I'd have to
> restructure
> the entire thing... There are no signs of any functional decomposition
> in that -- if Python had an unstructured GOTO, I'd suspect this would
> have been a spaghetti-code program... As it is, the best I can call it
> is lasagna-code  (interwoven but distinct layers in a linear form
> from one end to the other).
>
>
> > if __name__ == "__main__":
> > import os,time,sys,libgmail
> > from subprocess import Popen,PIPE
> > main(sys.argv)
>
> Given the position of the import statements, this file can NOT be
> used as an importable module for use by other programs, so the whole
> breakdown of a main() is meaningless; might as well remove that if, the
> def main(): line, move the imports to the top, and unindent the rest one
> level.
>
>All those embedded calls to exit() also offend me; I'm from the "one
> in, one out" school (though I'll use break and continue in a loop, I
> still favor just one usage of them in such)
>
>Ideally, all the SMS related stuff would be isolated apart from the
> email stuff. Would make changing email interface a lot more intuitive.
>
>Out of a fit of boredom, though it probably doesn't help your real
> problem, and it has not been tested at all, this is my restructuring of
> the code listing.
>
> -=-=-=-=-=-=-=-
> import os
> import time
> import sys
> import subprocess
>
> import libgmail
>
>
> CARRIERLIST = [   ("3 River Wireless", "@sms.3rivers.net"),
>   ("7-11 Speakout","@cingularme.com"),
>  #("Airtel (Karnataka","India) Alaska
> Communications Systems"),
>  ("Alltel Wireless","@message.alltel.com"),
>  ("AT&T Wireless","@txt.att.net"),
>  ("Bell Mobility (Canada)","@txt.bell.ca"),
>  ("Boost Mobile","@myboostmobile.com"),
>  ("Cellular One (Dobson)","@mobile.celloneusa.com"),
>  ("Cingular (Postpaid)","@cingularme.com"),
>  ("Centennial Wireless","@cwemail.com"),
>  ("Cingular (GoPhone prepaid)","@cingularme.com"),
>  ("Claro (Nicaragua)","@ideasclaro-ca.com"),
>  ("Comcel","@comcel.com.co"),
>  ("Cricket","@sms.mycricket.com"),
>  ("CTI","@sms.ctimovil.com.ar"),
>  ("Emtel (Mauritius)","@emtelworld.net"),
>  ("Fido (Canada)","@fido.ca"),
>  ("General Communications Inc.","@msg.gci.net"),
>  ("Globalstar","@msg.globalstarusa.com"),
>  ("Helio","@myhelio.com"),
>  ("Illinois Valley Cellular","@ivctext.com"),
>  #("i wireless","@iwspcs.net"),
>  ("Meteor (Ireland)","@sms.mymeteor.ie"),
>  ("Mero Mobile (Nepal)","@sms.spicenepal.com"),
>  ("MetroPCS","@mymetropcs.com"),
>  ("Movicom","@movimensaje.com.ar"),
>  ("Mobitel (Sri Lanka)","@sms.mobitel.lk"),
>  ("Movistar (Colombia)","@movistar.com.co"),
>  ("MTN (South Africa)","@sms.co.za"),
>  ("MTS (Canada)","@text.mtsmobility.com"),
>  ("Nextel (Argentina)&qu

Re: Modules/packages by GvR?

2009-08-28 Thread John Haggerty
How is writing code like a language maintainer going to go towards a
philosophic ideal? And more principally why would this be of a benefit. In
the philosophic world dressing and acting like Socrates isn't necessarily
the same as following his ideals and isn't necessarily being Socratic.

On Fri, Aug 28, 2009 at 8:58 AM, gb345  wrote:

>
>
>
>
> Are there any Python-only modules or packages in the latest releases
> of Python 2.x or Python 3.x that were largely written by Guido van
> Rossum?  What's the best way to find this out?  I know that some
> modules mention the author(s) in the source code, but this does
> not seem to be true most of the time, as far as I can tell.
>
> I'm interested in reading this code as prime examplars of "Pythonicity".
> (I'm sure that many other programmers could serve as models of the
> Pythonic ideal, but I doubt that there would be a *less debatable*
> choice in this category than GvR.)
>
> Many thanks in advance,
>
> Gabe
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What python can NOT do?

2009-08-29 Thread John Haggerty
Theoretically a microkernel could be used to do the stuff python directly
couldn't do and the rest could be done once an interpreter was loaded in
theory.

On Fri, Aug 28, 2009 at 4:37 PM, qwe rty  wrote:

> i know that an interpreted language like python can't be used to make
> an operating system or system drivers.
>
> what else can NOT be done in python? what are the limitations of the
> language?
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Thread Pool

2009-08-30 Thread John Haggerty
twisted? I don't get it

On Sun, Aug 30, 2009 at 1:55 PM, Stephen Hansen wrote:

>
> On Sun, Aug 30, 2009 at 9:56 AM, Vitaly Babiy  wrote:
>
>> Hey,
>> Any one know of a good thread pool library. I have tried a few but they
>> don't seem to clean up after them selfs well.
>>
>> Thanks,
>> Vitaly Babiy
>>
>>
> As obscene as it seems, I actually use twisted's :)
>
> I mean, it's obscene not because it's badly done or anything, but because
> to use twisted to do threads sounds terribly wrong. But I have twisted
> installed anyway for a different purpose, so figured why not. It seems to
> work fine / scale well / clean up fine (assuming my code is correct).
>
> --S
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Sending email

2009-08-30 Thread John Haggerty
I would concur

On Fri, Aug 28, 2009 at 9:49 AM, 7stud  wrote:

> On Aug 28, 8:18 am, Fencer 
> wrote:
> > 7stud wrote:
> >
> > [snip]
> >
> > Thanks for your reply. After consulting the sysadmins here I was able to
> > get it to work.
> >
> > - Fencer
>
>
> Ok, but how about posting your code so that a future searcher will not
> be left screaming, "WHAT THE EFF WAS THE SOLUTION!!"
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Incremental project based programming guide

2009-09-15 Thread John Haggerty
On Tue, Sep 15, 2009 at 2:22 AM, Hendrik van Rooyen  wrote:

> On Tuesday 15 September 2009 04:43:46 bouncy...@gmail.com wrote:
> > I was wondering if anyone had actually designed their programming text
> > around incremental parts of a project and then taken the results of the
> > project at each chapter and created something of value. specifically in
> > referwnce to python however other examples. ALl of education was around
> > pointless and unapplicable theory texts for which I am reaping nothing.
> > Surely someone has seen this in actiom to whit: ch1 design of problem ch2
> > design taken out of ch1 then done in ch2 to take input/ output for a
> > smaller part ch3 take info from chs 1...@2 to craft an answer that is from
> the
> > same problemto a theoretical chapter say 30 with a gui or some such.
> > deitel and associates were unfortunately part of some of my worst
> > exampes--drills applenty with little to no application. much appreciated
> > towards python application and thanks in advance
>
> I cannot parse this.
> I get the idea that you are talking about a teaching text with certain
> characteristics.
> I cannot figure out if you are:
> (i) for the idea.
> (ii) against it.
> (ii) looking for something like it.
>
> Please elucidate.
>
>
Certaintly I am looking for options (i) and (iii) thanks :)

mobile wap browsers don't make the best of composition platforms.


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