Re: Video: Professor of Physics Phd at Cal Tech says: 911 Inside Job

2007-04-29 Thread Gordon
On Thu, 26 Apr 2007 00:33:19 GMT, "Bill Habr"
<[EMAIL PROTECTED]> wrote:

>
><[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED]
>> Cal Tech is the ELITE of ELITE in physics.
>>
>> If Feynman were alive, he would point his finger straight at the 911
>> criminal operators, the yank bastards themselves ...
>>
>> http://www.911blogger.com/node/8101
>>
>> No self-respecting scientist should keep his mouth shut. Its a
>> fundamental challenge to the method of science, a detective work most
>> demanding of INTELLECTUAL HONESTY.
>>
>
>Isn't this the guy who has more conspiracy theories than Carter has pills?
>
>Whitewater, Vince Foster, moon landing hoax one week - we found a UFO on the 
>moon the
>next, Oklahoma City bombing, a new conspiracy every day ad nauseum?
>
Maybe the thread title is wrong. Should it perhaps read, "Video
Professor took a physic then spewed out some really stinky
stuff."
-- 
http://mail.python.org/mailman/listinfo/python-list


efficient intersection of lists with rounding

2004-12-02 Thread Gordon Williams
Hi,

I have to lists that I need to find the common numbers (2nd rounded to
nearest integral) and I am wondering if there is a more efficient way of
doing it.

>>> a= [(123,1.3),(123,2.4),(123,7.8),(123,10.2)]
>>> b= [(123, 0.9), (123, 1.9), (123, 8.0)]
>>> [ (i,round(j)) for i,j in a for l,m in b if (i,round(j)) ==
(l,round(m))]
[(123, 1.0), (123, 2.0), (123, 8.0)]
>>>
This works but a and b can be in the order of 30K long.

A couple of other bits of info.
- a and b are ordered smallest to largest (could bisect module be used?)
- in the future I will want to round the second number of closest 0.25
rather than whole number.

Would the sets module be more efficient?

I'm using python 2.3.

Thanks for any ideas.

Regards,

Gordon Williams

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


Re: efficient intersection of lists with rounding

2004-12-06 Thread Gordon Williams


> Hi,
>
> I have to lists that I need to find the common numbers (2nd rounded to
> nearest integral) and I am wondering if there is a more efficient way of
> doing it.
>
> >>> a= [(123,1.3),(123,2.4),(123,7.8),(123,10.2)]
> >>> b= [(123, 0.9), (123, 1.9), (123, 8.0)]
> >>> [ (i,round(j)) for i,j in a for l,m in b if (i,round(j)) ==
> (l,round(m))]
> [(123, 1.0), (123, 2.0), (123, 8.0)]

Thanks for all your suggestions.  I've tried each one with lists of 1K, 10K
and 30K long and tabulated the results below.  Run with profile on W2K,
python 2.3.2, 1GHz Athlon.

1K, 10K and 30K long (seconds per call)
t1= 0.009, 0.148, 0.563
t2= 0.015, 0.217, 0.777
t3= 0.008, 0.108, 0.487
t4= 0.016, 0.190, 0.749
t5= 0.015, 0.224, 0.773

The non-set algorithims (t1,t3) came out the winners (maybe due to the
conversion of the set to a sorted list.  I didn't look into it any farther.)

Regards,

Gordon Williams




from sets import Set
import random


size = 1000

a = [(123,i+random.choice([-.2,-.1,.1,.2])) for i in range(size)]
b = [(123, 1+i+random.choice([-.2,-.1,.1,.2])) for i in range(size)]

def t1():
#Diez B. Roggisch <[EMAIL PROTECTED]>
ra =  [ (i,round(j)) for i,j in a]
rb =  [ (i,round(j)) for i,j in b]


res = []
pos_b = 0

try:
for i, pivot in ra:
while rb[pos_b][1] < pivot:
pos_b += 1
while rb[pos_b][1] == pivot:
res.append(rb[pos_b])
pos_b += 1
except IndexError:
# If b gets exhausted somewhere
pass
return res


def t2():
#Steven Bethard <[EMAIL PROTECTED]>
def roundedj(pairs_iterable):
return [(i, round(j)) for i, j in pairs_iterable]

l=list(Set(roundedj(a)).intersection(Set(roundedj(b
l.sort()
return l


def t3():
#Greg Ewing <[EMAIL PROTECTED]>
d = {}
for (l, m) in b:
   d[l, round(m)] = 1

result = []
for (i, j) in a:
   t = (i, round(j))
   if t in d:
 result.append(t)
return result


def t4():
#Adam DePrince <[EMAIL PROTECTED]>
set_a = Set( [(i,round(j)) for i,j in a] )
set_b = Set( [(i,round(j)) for i,j in b] )
l= list(set_a.intersection( set_b ))
l.sort()
return l

def t5():
#Raymond Hettinger <[EMAIL PROTECTED]>
l= list(Set([(x,round(y)) for x,y in a]) & Set([(x,round(y)) for x,y in
b]))
l.sort()
return l

def test():
r1= t1()
r2= t2()
r3= t3()
r4= t4()
r5= t5()


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


Re: Jargons of Info Tech industry

2005-10-04 Thread Gordon Burditt
>>I think e-mail should be text only. 
>
>I disagree.  Your problem  is spam, not HTML. Spam is associated with
>HTML and people have in Pavlovian fashion come to hate HTML.
>
>But HTML is not the problem!

HTML enables a heck of a lot of problems:  "web bugs" in email,
links to fake sites that appear as real ones in what shows up
on the screen, Javascript viruses, denial-of-service attacks
(pages that open two windows when you close one), etc.

>That is like hating all choirs because televangelists use them.

I liken it more to hating all viruses because some of them 
install keyloggers.

    Gordon L. Burditt
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Jargons of Info Tech industry

2005-10-08 Thread Gordon Burditt
>>HTML enables a heck of a lot of problems:  "web bugs" in email,
>>links to fake sites that appear as real ones in what shows up
>>on the screen, Javascript viruses, denial-of-service attacks
>>(pages that open two windows when you close one), etc.
>>
>>>That is like hating all choirs because televangelists use them.
>>
>>I liken it more to hating all viruses because some of them 
>>install keyloggers.
>
> I take it then you avoid browsers or use Lynx?  

Last time I checked, it was impossible to send me an unsolicited
web site.  It is trivial, however, to send unsolicited email or
post unsolicited articles on USENET.  

No, I don't trust Lynx to read email or USENET articles.

>No you FIX the
>problems 

And how do you fix the problem of unsolicited USENET articles?
(*ALL* of them are unsolicited to someone).  Or unsolicited
email?  

>rather than wear a hair shirt. Same for email. Why should
>rich expressions only be permitted to those with websites.  

Web sites can't send you stuff unsolicited, and most of them have
enough stake in their reputation to keep the obnoxious stuff off
of them, since if they have viruses chances are you can't trust
buying anything from them.  "web bugs" aren't a problem with web
sites since the server logs log *all* the hits, and they don't have
to use hidden ones.  And I don't visit web sites without a good
reason to do so (that excludes seeing the URL in some SPAM).  Oh,
yes, and Javascript is turned off.

>Some people use email PRIMARILY for sharing photos.

And what does sharing photos (attachments) have to do with HTML?
USENET text groups are not the appropriate place for photos.

Gordon L. Burditt
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Jargons of Info Tech industry

2005-10-09 Thread Gordon Burditt
>>And how do you fix the problem of unsolicited USENET articles?
>>(*ALL* of them are unsolicited to someone).  Or unsolicited
>>email?  
>
>Read my essay.
>http://mindprod.com/projects.html/mailreadernewsreader.html
>
>I talk around those problems.
>
>It requires a fresh start.

This URL does not work.  However, from some of the other replies,
it seems that your suggestion involved identification of the sender
with digital signatures.

I think one necessary function of email and USENET is that it should
allow you to SAFELY communicate with strangers or, worse, people
you know but do not trust at all, and who are known to be malicious,
if you wish to do so, especially since meeting in person might
invoke the use of weapons of mass destruction (like, for example,
me and my hypothetical ex-wife).  

For example, George W. Bush ought to be able to exchange email with
Osama Bin Laden without risking revealing nuclear launch codes.
Hitler and Winston Churchill should have been able to exchange email
(had it been available during World War II) without revealing state
secrets accidentally.  I ought to be able to exchange email with
my boss without his being able to track if/when I read it.  I ought
to be able to communicate with the Direct Marketing Association to
get them to take my name off a mailing list without risking spyware
installation or revealing my credit card numbers.  Union leaders and
management should be able to negotiate by email without unwittingly
leaking information.

HTML is *mostly* dangerous.  (links.  Javascript.  references to
other files on the user's computer.  Forms.)  It's a lot more than
text formatting.  I suggest that if you want a text formatting
language, start with *TROFF* and take out the parts that refer to
other files.  As far as I know, troff doesn't have any networking
references in it.  Lots of people probably hate troff, but it's a
better start than HTML.

Gordon L. Burditt
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Jargons of Info Tech industry

2005-10-12 Thread Gordon Burditt
>However, formatted text is not code. 

HTML is much more than formatted text.

>Pictures are not code.  It is
>unfair to tar them with the brush of JavaScript or the goofy things
>Outlook does with enclosures.

If you take all the dangerous stuff out of HTML, like:
Links
Javascript
Forms
References to other files

you'd have very little left.  I suggest that for formatted text,
TROFF would be a better start.

        Gordon L. Burditt
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Jargons of Info Tech industry

2005-10-12 Thread Flash Gordon
Roedy Green wrote:



Can all of you please take comp.lang.c out of this thread (and all its 
sub-threads, since it is totaly off topic and NONE of the people on this 
thread are posting to anything else on comp.lang.c so I doubt any of you 
are reading it here.
-- 
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Jargons of Info Tech industry

2005-10-12 Thread Gordon Burditt
>>  Links
>>  Javascript
>>  Forms
>>  References to other files
>
>the only piece of that particularly dangerous is JavaScript.  So long
>as you have a scheme to unmask where links are really going links are
>no more dangerous than they are in browser.

Browsers don't read unsolicited web sites.  Email readers do, however,
read unsolicited email, and email from downright hostile correspondents.  
And I consider "web bugs" and similar tracking methods to be a danger
for something that's supposed to be ONLY "formatted text".

>Even a form is not dangerous.  You have to fill it in and hit submit.

So where does the submitted data GO?  And there's all kind of information
in there about what software I'm running.

Gordon L. Burditt
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Jargons of Info Tech industry

2005-10-12 Thread Gordon Burditt
>I would say by extrapolating the problem of spam and snooping that the
>next level of email software needs to concentrate on the following:
>
>1. routine and transparent encryption.

OK, but the Feds are really going to hate that.

>2. making spam no longer economic.  Blocking all spam is, even in
>theory, impossible.  I sometimes read a message and am ambivalent
>myself about whether I wanted to read or receive it.  The key is to
>provide efficient, transparent spam solutions.  They can be layered to
>filter higher and higher percentages of mail depending on how big your
>spam problem is.

One way of making spam non-economic would be making it difficult to
use throw-away identities.  If I block by someone's identity, it
stays blocked.

>3. prevent phishing.  When PayPal sends you an email, you want to know
>for sure it really is from PayPal.  This means corporate users at
>least will all have digital ids, and all emails will be digitally
>signed.

I'm assuming that email is supposed to be useful and usable for
*SAFELY* conducting a conversation (or negotiations) with someone
out to kill you or steal from you.  (Consider union vs. management,
any husband vs.  his ex-wife, the IRS vs. everyone, whistleblower
vs. employer, etc.)

>4. status tracking. Unless blocked by the receiver, the sender knows
>if his message has been receiveived/read.

I consider this an unacceptable risk to the receiver, unless the
acknowledgement is manually initiated.  It also risks a lot of
confusion regarding what constitutes "read", especially if the user
saved it into a file without displaying it.

I'm assuming here that there are some people (e.g. George W. Bush) who
will attempt to try to turn an IP address into a geographic location
and launch missiles at it when he finds out Osama Bin Laden read his
email.  At least when Osama *sends* email, he can click the send
button and run like hell.

>5. making it impossible for any incoming email to mount any sort of
>attack. the only parts the email software processes are the data
>parts. Any enclosed programs must be explicitly installed. The email
>software would warn if any code were not digitally signed with proper
>certificate to identify the author.

In HTML, that means NO links, NO Javascript, NO forms, and NO references
to other files.  Reading your email should not generate hits on
anything specified by the sender.

Gordon L. Burditt
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Jargons of Info Tech industry

2005-10-13 Thread Gordon Burditt
>Hello? I don't think that should make any difference. I should be able
>to visit absolutely any website on the Internet without any danger to my
>computer or the data stored on it. Any browser which allows otherwise
>has a bug. 

Then Javascript *as a language* is a bug.

>Javascript is not inherently a virus vector. Flawed

A virus vector is not the only security problem.  Leaking
information to the web site is also a problem.

>implementations might be; the language itself is not. 

Does the language allow Javascript to open a new window?  Does the
language allow Javascript to trigger a function when a window is
closed?  I believe the answer to both questions is YES.  Then it
is possible to have a page that pops up two windows whenever you
close one.  This isn't theoretical:  I've seen someone demonstrate
this with certain nasty porn sites.  The only way to recover was
to kill off the browser and restart it.  (Clicking HOME apparently
fired off a cascade of closed windows which then opened more, running
the browser out of virtual memory.) Because of this, he lost work
in progress with another web site.  (Apparently he accidentally
clicked on a banner ad which lead to this booby-trapped site.)

>Similarly for
>anything else. In reality, with a properly-configured, good quality
>operating system (probably a UNIX-type system), one ought to be able to
>run full native code without any danger to one's computer or data
>(think: under the NOBODY account on Linux).

If it can reveal my email address to any web site, it's a bug.  If
it can access or alter my personal files or address book, it's a
bug.  If it can generate hits on web sites other than that specified
in the HTML, it's a bug.  If it can open sockets, it's a bug.
If it can look at or set cookies stored on my system, it's a bug.
If it can look at or alter the list of previously visited URLs, it's
a bug.

>> Browsers don't read unsolicited web sites.  Email readers do, however,
>> read unsolicited email, and email from downright hostile correspondents.  
>> And I consider "web bugs" and similar tracking methods to be a danger
>> for something that's supposed to be ONLY "formatted text".

Gordon L. Burditt
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Jargons of Info Tech industry

2005-10-13 Thread Gordon Burditt
>> Does the language allow Javascript to open a new window?  Does the
>> language allow Javascript to trigger a function when a window is
>> closed?  I believe the answer to both questions is YES.  Then it
>> is possible to have a page that pops up two windows whenever you
>> close one.
>
>This was a problem, but modern browsers implement Javascript in such a 
>way that it requires permission from the user before it will open a new 
>window.

An infinite loop of asking permission is *ALSO* a denial-of-service
attack.  And I don't believe that the limitation applies in all
circumstances.  This seems to be a feature of the *language*, not
only the implementation.

>> If it can reveal my email address to any web site, it's a bug.  If
>> it can access or alter my personal files or address book, it's a
>> bug.  If it can generate hits on web sites other than that specified
>> in the HTML, it's a bug.  If it can open sockets, it's a bug.
>> If it can look at or set cookies stored on my system, it's a bug.
>> If it can look at or alter the list of previously visited URLs, it's
>> a bug.
>
>All of those things seem like major problems except the bit about 
>cookies. What possible harm can reading and setting cookies do? I had 

Javascript may be able to set cookies even if they are turned off
by the normal mechanism of setting cookies.  Even if that isn't the
case, cookies are supposed to be domain-specific and a cookie from
site A (which might have a session ID for an active login session, or
login credentials for site A) should not be sent to site B.  Javascript
can apparently make its own URLs and send anything it gets its hands
on to any site it wants to.

The existence of a cookie from site A shouldn't be revealed at all
to site B (or to Javascript from site B), regardless of what it
contains.

>always thought they were carefully and successfully designed to be 
>harmless. That's not personal information in your cookies. That 

Some websites *DO* put personal information in cookies.  They don't
all just use randomized session identifiers.  Some of them store
login credentials for a site (not just a currently active session,
but permanent login credentials.  That might not be "personal" the
same way a SSN or credit card number is, but you could still do
damage with it).  A lot of the popularity of Javascript comes from
the ability to steal information from the client computer that
normal HTML does not give access to (e.g.  screen/window size, email
address, IP address as seen by the client (because of NAT and
proxies, might not be the same IP as seen by the server), MAC
address, browsing history, Windows serial number, Pentium CPU serial
number, etc.)

>information is set by websites for the sole purpose of being read by 
>websites. 

*BY THE WEBSITES THAT SET THEM*, not by all websites.  The "domain"
parameter for setting cookies has been in there since the beginning
of the standard for cookies.

If a marketer wants a piece of information, then I don't want him
to have it, even if it's something like "I visited  and
then went to " even if there's no identification of who "I"
is.

>Plus, I'm pretty sure that browsers have always allowed us to 
>disable cookies.

I'm not sure that you can disable Javascript from reading cookies
from other sites while allowing Javascript to read cookies from the
site it came from on all browsers.

Gordon L. Burditt
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Jargons of Info Tech industry

2005-10-15 Thread Gordon Burditt
>>>But HTML is not the problem!
>> Right, it's what the HTML-interpreting engines might do that is
>> the problem.
>
>You mean the same problem as for example using a very long header in 
>your email to cause a buffer overflow? That is possible with plain 
>ASCII, and has been done.

Before worrying about the possible bugs in the implementations,
worry about security issues present in the *DESIGN*.  Email ought
to be usable to carry out a conversation *SAFELY* with some person out
to get you.  Thus features like this are dangerous (in the *design*,
not because they *might* hide a buffer-overflow exploit):

- Hyperlinks to anything *outside* the email in which the link
  resides ("web bugs").
- Javascript.
- Any ability to automatically generate hits on sender-specified
  servers when the email is read.
- Any kind of return-receipt mechanism that doesn't require initiation
  by the recipient.
- Any kind of return-receipt mechanism that indicates that the
  message got past the spam filter.

>>>That is like hating all choirs because televangelists use them.
>>>  
>>>HTML allows properly aligned table, diagrams, images, use of
>>>colour/fonts to encode speakers. emphasis, hyperlinks.

The trouble is, it allows way too much dangerous stuff.

>> All good stuff, but I don't like worrying about side effects when I
>> read email.
>
>Then you should ask people to print it out, and use snail mail. Exploits 
>in email programs are not happening since HTML was added to them.

Yes, they are.  Why do you think people put "web bugs" in email?
Because they work.

>>>I try to explain Java each day both on my website on the plaintext
>>>only newsgroups. It is so much easier to get my point across in HTML.
>
Gordon L. Burditt
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Microsoft Hatred FAQ

2005-10-27 Thread John Gordon
In <[EMAIL PROTECTED]> "David Schwartz" <[EMAIL PROTECTED]> writes:

> What is an "illegal monopoly"?

A monopoly that acts in certain ways, abusing its monopoly power.  There's
nothing inherently illegal about having a monopoly; it only becomes illegal
when you abuse the power.

-- 
John Gordon"It's certainly uncontaminated by cheese."
[EMAIL PROTECTED]

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


Re: Microsoft Hatred FAQ

2005-10-27 Thread John Gordon
In <[EMAIL PROTECTED]> "David Schwartz" <[EMAIL PROTECTED]> writes:

> When you say "it only become illegal", you are just being vague. Nothing 
> becomes illegal. The abuse is illegal, but it never was legal.

You're splitting hairs.  But hey, what's usenet for?

-- 
John Gordon"It's certainly uncontaminated by cheese."
[EMAIL PROTECTED]

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


Generic utility class for passing data

2005-10-28 Thread Gordon Airporte
I'm wondering if this is might be bad practice. Sometimes when I need to 
pass around several pieces of datum I will put them in a tuple, then 
when I need to use them in a receiving function I get them out with 
subscripts. The problem is that the subscript number is completely 
meaningless and I have to remember the order I used.
As an alternative I was considering using a dummy class like this:

class Dummy:
pass

Then when I need to pass some related data, Python lets me do this:

prefill = Dummy()
prefill.foreground = 'blue'  #"foreground" is made up on the fly
prefill.background = 'red'
prefill.pattern = mypattern
return prefill

Now I can access the data later using meaningful names.
Is this going to cause problems somehow? Should I rather go to the 
trouble of creating more substantial individual classes for every 
grouping of data I might need to pass (with __init__'s and default 
values and so on)? Should I just stick with subscripted groupings 
because of the overhead?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: O_DIRECT on stdin?

2005-11-07 Thread Gordon Burditt
>Is there a way of setting O_DIRECT on a preexisting file like sys.stdin?
>
>Does C allow this sort of thing?

There is no O_DIRECT or fcntl() in Standard C.

fcntl() operates on an open file descriptor, and the file descriptor
for stdin is 0.  Two calls to fcntl(), one with F_GETFL and one
with F_SETFL, would do what you want.

I'm not sure why you want to do that, though.  It's not going to
get you character-at-a-time I/O, if that's what you want.

    Gordon L. Burditt
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: O_DIRECT on stdin?

2005-11-07 Thread Gordon Burditt
>I want to be able to read a HUGE file without having such a negative
>impact on the system's buffer cache.
>
>I'm trying:
>
>   if hasattr(os, 'O_DIRECT'):
>   try:
>   flags = fcntl.fcntl(sys.stdin.fileno(), fcntl.F_GETFL)  
> 
>   flags |= os.O_DIRECT
>   fcntl.fcntl(sys.stdin.fileno(), fcntl.F_SETFL, flags)
>   except:
>   sys.stderr.write('Setting O_DIRECT on stdin attempted 
> but failed\n')
>   else:
>   sys.stderr.write('Setting O_DIRECT on stdin succeeded 
> :)\n')
>
>...but while this code doesn't error out, I get:
>
>seki-root> reblock -e $[1024*1024*80] $[1024*1024] 300 < /dev/sda1 > /dev/null
>stdin seems seekable, but file length is 0 - no exact percentages
>Estimated filetransfer size is 85899345920 bytes
>Estimated percentages will only be as accurate as your size estimate
>Setting O_DIRECT on stdin succeeded :)
>Traceback (most recent call last):
>  File "/Dcs/seki/strombrg/bin/reblock", line 276, in ?
>main()
>  File "/Dcs/seki/strombrg/bin/reblock", line 222, in main
>block = os.read(0,blocksize)
>OSError: [Errno 22] Invalid argument
>Mon Nov 07 12:25:53
>
>...but if I comment out the fcntl/O_DIRECT code, then the same thing works
>well.
>
>Any other ideas folks?

Does O_DIRECT perhaps invoke some of the restrictions of "raw"
device files, where the current offset and transfer size must be a
multiple of some block size?  (I don't see any mention of that in
FreeBSD's documentation.) What is the value of blocksize at the
time of the traceback above?  I suggest keeping it well under 2G.

Gordon L. Burditt
-- 
http://mail.python.org/mailman/listinfo/python-list


Returning a value from a Tk dialog

2005-11-07 Thread Gordon Airporte
The dialogs in tkColorChooser, tkFileDialog, etc. return useful values 
from their creation somehow, so I can do stuff like this:

filename = tkFileDialog.askopenfilename( master=self )

I would like to make a Yes/No/Cancel dialog that can be used the same 
way (returning 1/0/-1), but I just cannot figure out how to do it. At 
best I've been able to get some kind of instance id from the object. How 
does this work?
-- 
http://mail.python.org/mailman/listinfo/python-list


Type-checking unpickled objects

2005-11-18 Thread Gordon Airporte
I have this class, and I've been pickling it's objects as a file format 
for my program, which works great. The problems are a.) how to handle 
things when the user tries to load a non-pickled file, and b.) when they 
load a pickled file of the wrong class.

a. I can handle with a general exception I guess. I just tried to 
pickle.load() a .pyc and it failed with a 'KeyError' exception - however 
that works. It might do that every time, it might not.

Regarding b., if I type check I simply get the 'instance' type, which 
doesn't get me all of the way there because I might have an instance of 
the wrong class. I can't find any sort of __type__ attribute to set in 
the objects. Perhaps I should use __str__?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Type-checking unpickled objects

2005-11-20 Thread Gordon Airporte
isinstance! Now why didn't I know about that? Thanks you. I guess I'll 
need a throwaway instance of the class to run type() on to get a usable 
type object for comparison, but I'll work something out.
As to the security considerations...this is a small enough program with 
a limited enough release that I'm not going to sweat it, although I will 
keep this in mind.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Type-checking unpickled objects

2005-11-20 Thread Gordon Airporte
> I guess I'll 
> need a throwaway instance of the class to run type() on to get a usable 
> type object for comparison, but I'll work something out.

Never mind - I can just pass the name of the class, as it should be.
-- 
http://mail.python.org/mailman/listinfo/python-list


Using MSMQ on Windows (and Navision)

2005-06-26 Thread Andrew Gordon
I'm investigating getting Microsoft Navision to do stuff from a Python 
script.  The recommended way seems to be to use message queues (MSMQ). 
I can get Navision to send a message to itself fine.  I found a couple 
of code example in an ancient message in this newsgroup.  The send.py 
one I changed to the following:

from win32com.client import gencache
msmq = gencache.EnsureModule('{D7D6E071-DCCD-11D0-AA4B-0060970DEBAE}', 
0, 1, 0)
qi = msmq.MSMQQueueInfo()
qi.PathName = ".\\testqueue"
try:
 myq = qi.Open(msmq.constants.MQ_SEND_ACCESS,0)
except:
 qi.Create()
 myq = qi.Open(msmq.constants.MQ_SEND_ACCESS,0)

if myq.IsOpen:
 msg = msmq.MSMQMessage()
 msg.Priority = 3
 msg.Body = "Hello World!"
 msg.Label = "Navision MSMQ-BA"
 print len(msg.Body)
 print msg.BodyLength

 msg.Send(myq)
myq.Close()



And the read one all I changed was the queue name.

# read.py - reads from the queue

# following bit generated via "makepy -i" ...
# Use these commands in Python code to auto generate .py support
from win32com.client import gencache
msmq = gencache.EnsureModule('{D7D6E071-DCCD-11D0-AA4B-0060970DEBAE}', 
0, 1, 0)

qi = msmq.MSMQQueueInfo()
qi.PathName = ".\PyQueueX"
myq = qi.Open(msmq.constants.MQ_RECEIVE_ACCESS,0)
if myq.IsOpen:
 msg = myq.Receive()
 print " body: %s" % msg.Body
 print "label: %s" % msg.Label
myq.Close()

-

They can send messages to each other fine.

The read.py can receive messages from Navision fine.

But messages sent to Navision (after changing the msg.Label to "Navision 
MSMQ-BA") show up as empty messages (nothing in the body).

I can only see two differences between messages generated from Navision 
and messages generated send.py.

1) Messages from Navision have something in the "Administration" bit 
when you look at the message's properties in computer management (Format 
name: PUBLIC=2bc802b2-7778-42c1-bc30-28caca20d974, Name: 
it2-new\nsadminreceivequeue).  Where as ones from send.py don't.

2) Every character in the body of messages sent from send.py has a 0 
value character after them (ie in hex 48 00 65 00 6C 00 6C 00 6F 00 20 
00 57 00 00 6F 00 72 00 6C 00 64 00 21 00)

Adding a print msg.BodyLength just before the msg.Send(myq) yields 24 
for a 12 character message.

I'm assuming it is 2), coz it's just weird (unicode?).

Any ideas?
-- 
http://mail.python.org/mailman/listinfo/python-list


Tkinter - Resizing a canvas with a window

2005-07-26 Thread Gordon Airporte
I'm trying to get my canvas to resize to fill its frame within a window, 
but I can't figure out how to handle the callback data from the window's 
 properly. It has very strange behavior - resizing randomly 
or growing by itself, shrinking to 0. The following works passably but 
jumps around at random if you move the window and goes nuts if you add 
the button (watch any wrapping):


from Tkinter import *

class testApp2:
 def __init__( self, master ):

 self.ma = master
 self.f = Frame( self.ma )
 self.f.pack()
 self.cv = Canvas(self.f, width=25, height=25, bg='red')
 self.cv.pack()
 #self.b1 = Button( self.f, text='hello', command=None )
 #self.b1.pack(side='bottom')

 self.ma.bind('', self.resize )


 def resize( self, event ):
 #print '(%d, %d)' % (event.width, event.height)
 self.cv.configure( width = event.width-4, height = event.height-4 )


root = Tk()
app = testApp2(root)
root.mainloop()

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


Re: Tkinter - Resizing a canvas with a window

2005-07-27 Thread Gordon Airporte
Thanks you very much. I found something interesting though, the canvas's 
width and height properties are not updated when it is resized by its 
packing. Looks like an oversight to me, but I've just demonstrated that 
I don't have a complete grasp of Tk, so... I can use a Configure 
callback to keep track of the values, however.


from Tkinter import *

class testApp3:
 def __init__( self, master ):
 self.ma = master
 self.f = Frame( self.ma )
 self.f.pack(fill=BOTH, expand=YES)
 self.cv = Canvas(self.f, width=125, height=125, bg='red')
 self.cv.pack(fill=BOTH, expand=YES)
 self.b1 = Button( self.f, text='Hello', height=1, width=10, 
padx=0, pady=1, \
   command = self.howbig )
 self.b1.pack(side=BOTTOM, anchor=S, padx=4, pady=4)
 self.cv.bind('', self.resize )

 def howbig( self ):
 print self.cv['width'], self.cv['height']
 print self.cvw, self.cvh

 def resize( self, event ):
 print '(%d, %d)' % (event.width, event.height)
 self.cvw, self.cvh = event.width-4, event.height-4

root = Tk()
app = testApp3(root)
root.mainloop()
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Jargons of Info Tech industry

2005-08-25 Thread Gordon Burditt
>HTML is designed to degrade gracefully (never mind that most web
>authors and many browser developers don't seem to comprehend this), so
>you don't really need a "subset" html to get the safety features you
>want. All you need to do is disable the appropriate features in the
>HTML renderer in your news and mail readers. JavaScript, Java, and any
>form of object embedding. Oh yeah, and frames.

And links.  And cookies.  And any kind of external site or local
file access.  And browser history.  

    Gordon L. Burditt
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Jargons of Info Tech industry

2005-08-25 Thread Gordon Burditt
>>> HTML is designed to degrade gracefully (never mind that most web
>>> authors and many browser developers don't seem to comprehend this),
>>> so you don't really need a "subset" html to get the safety features
>>> you want. All you need to do is disable the appropriate features in
>>> the HTML renderer in your news and mail readers. JavaScript, Java,
>>> and any form of object embedding. Oh yeah, and frames.
>> 
>> And links.  And cookies.  And any kind of external site or local
>> file access.  And browser history.
>
>What is the risk with browser history?

spyware and viruses (which can come from places other than email)
sending it somewhere.  Actually, there's not much point in keeping
a browser history if all it can contain is mail in YOUR mailbox
that may or may not have been already deleted.

Gordon L. Burditt
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Jargons of Info Tech industry

2005-08-26 Thread Gordon Burditt
>The only thing I hate is when I am directed to some website that needs 
>cookies, but doesn't tell me.  A couple times I did a survey, wasting 
>maybe 10 minutes of my life for a good cause, and then there was an 
>error. Great!  I guess that page needed cookies, but didn't bother to 
>tell me.  Back button didn't work, either, so I just left that website.

Some sites do much worse than that.  If you have cookies off, they
cause an infinite redirect loop.  Sometimes my browser manages to
detect this after a few minutes and shut it off, and sometimes it
doesn't (usually on different sites).  I think I can manually get
out of this with the STOP button, but until I do, it likely causes
a lot of useless load on the web site.

    Gordon L. Burditt
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: FarPy GUIE v0.1

2005-09-28 Thread Gordon Hennesy
Walter Purvis  gmail.com> writes:

> 
> Is there a URL?

http://farpy.holev.com/




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


Re: recognize a drive as removable media (e.g. compact flash, sd card or usb drive)

2006-05-02 Thread Gordon Rainsford
Tim Golden <[EMAIL PROTECTED]> wrote:

> Mike Joyce wrote:
> > I am trying to write a portable script that will find removable media,
> > such as compact flash, sd card, usb, etc. drive and then upload files
> > from the media. I want this to be portable so that I can write and
> > maintain one program for both Linux and Windows. Each platform uses
> > different functions so even if I could find two platform dependent
> > functions that would be fine. Basically, I would like to avoid checking
> > fixed disks if possible.
> > If anyone know of a good way to do this please let me know. Thanks in
> > advance for any help.
> 
> Under Windows, you can probably use WMI for this, depending on
> exactly what it is you're trying to do. If I read you right, you want
> to
> scan all devices, determine the removable ones, and then read stuff
> off them.

Any suggestions as to doing this on a Mac?


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


Re: Watching a file another app is writing

2007-03-12 Thread Gordon Airporte
Gabriel Genellina wrote:
  > This article explains it in detail:
> http://tgolden.sc.sabren.com/python/win32_how_do_i/watch_directory_for_changes.html
>  
> 
> BTW, it's the top result on Google for "python notify file change windows"
> 
> --Gabriel Genellina

Ah, excelent. Thank you. I'd started with the pywin32 documentation, 
where I did manage to find FindFirstChangeNotification(). I had to go to 
bed before I could get to Google to figure out how to use it.
Having just tested it, it seems that my problem is now caching. These 
only trigger when the file is written to disk, and for the small amounts 
of data I'm dealing with that's not with every transaction.
This is probably why tail wasn't working for me either, with the added 
complication of it locking the file.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Watching a file another app is writing

2007-03-12 Thread Gordon Airporte
Vishal Bhargava wrote:
> What kind of file is it? CSV?

It's a hand history file generated by an online poker client, thus it 
probably keeps it's data pretty much to itself otherwise, and in any 
case I'm not a Windows programmer so I probably don't have the stomach 
to get very deep into its process communication mechanisms.


> 
> It occurs to me under Unix you could perhaps get your first program to write
> to a "named pipe", which you 2nd program could read from. See
> 
> http://en.wikipedia.org/wiki/Named_pipe
-- 
http://mail.python.org/mailman/listinfo/python-list


thread safe SMTP module

2007-03-02 Thread Gordon Messmer
I believe that I've seen this discussed previously, so maybe there's 
some interest in it.  I wrote a threaded mail filtering framework a 
while ago, and one of the modules does address verification via SMTP.  
Since smtplib.SMTP uses blocking IO, it can block the whole 
interpreter.  Sometimes the whole thing would stop working indefinitely.


I'm now aware that Twisted offers a non-blocking SMTP class, but I 
didn't really want to make that a dependency of the address 
verification.  I ended up subclassing the smtplib.SMTP class and 
rewriting the functions that do I/O.  Perhaps someone who doesn't want 
to install Twisted will find this class useful, someday.  It doesn't 
support TLS, but it is otherwise a thread-safe SMTP class.



class ThreadSMTP(smtplib.SMTP):
"""SMTP class safe for use in threaded applications.

This class reimplements the SMTP class with non-blocking IO,
so that threaded applications don't lock up.

This class won't make starttls support thread-safe.
"""
def connect(self, host='localhost', port=0):
"""Connect to a host on a given port.

If the hostname ends with a colon (`:') followed by a number, and
there is no port specified, that suffix will be stripped off and the
number interpreted as the port number to use.

Note: This method is automatically invoked by __init__, if a host is
specified during instantiation.

"""
if not port and (host.find(':') == host.rfind(':')):
i = host.rfind(':')
if i >= 0:
host, port = host[:i], host[i+1:]
try: port = int(port)
except ValueError:
raise socket.error, "nonnumeric port"
if not port: port = smtplib.SMTP_PORT
if self.debuglevel > 0: print>>sys.stderr, 'connect:', (host, port)
msg = "getaddrinfo returns an empty list"
self.sock = None
for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
af, socktype, proto, canonname, sa = res
try:
self.sock = socket.socket(af, socktype, proto)
self.sock.setblocking(0)
if self.debuglevel > 0: print>>sys.stderr, 'connect:', (host, port)
# Try to connect to the non-blocking socket.  We expect connect()
# to throw an error, indicating that the connection is in progress.
# Use select to wait for the connection to complete, and then check
# for errors with getsockopt.
try:
self.sock.connect(sa)
except socket.error:
readySocks = select.select([self.sock], [], [], _smtpTimeout)
if self.sock in readySocks[0]:
soError = self.sock.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
if soError:
raise socket.error, 'connection failed, error: %d' % soError
else:
# The connection timed out.
raise socket.error, 'connection timed out'
except socket.error, msg:
if self.debuglevel > 0: print>>sys.stderr, 'connect fail:', (host, port)
if self.sock:
self.sock.close()
self.sock = None
continue
break
if not self.sock:
raise socket.error, msg
(code, msg) = self.getreply()
if self.debuglevel > 0: print>>sys.stderr, "connect:", msg
return (code, msg)


def send(self, str):
"""Send `str' to the server."""
if self.debuglevel > 0: print>>sys.stderr, 'send:', repr(str)
if self.sock:
try:
# Loop: Wait for select() to indicate that the socket is ready
# for data, and call send().  If send returns a value smaller
# than the total length of str, save the remaining data, and
# continue to attempt to send it.  If select() times out, raise
# an exception and let the handler close the connection.
while str:
readySocks = select.select([], [self.sock], [], _smtpTimeout)
if not readySocks[1]:
raise socket.error, 'Write timed out.'
sent = self.sock.send(str)
if sent < len(str):
str = str[sent:]
else:
# All the data was written, break the loop.
break
except socket.error:
self.close()
raise smtplib.SMTPServerDisconnected('Server not connected')
else:
raise smtplib.SMTPServerDisconnected('please run connect() first')


def getreply(self):
"""Get a reply from the server.

Returns a tuple consisting 

Re: thread safe SMTP module

2007-03-04 Thread Gordon Messmer
Aahz wrote:
> 
> That doesn't make any sense.  Blocking I/O generally releases the GIL,
> which is the whole reason Python doesn't totally suck for threading.

Nevertheless, among the caveats listed at 
http://docs.python.org/lib/module-thread.html is:

"Not all built-in functions that may block waiting for I/O allow other 
threads to run. (The most popular ones (time.sleep(), file.read(), 
select.select()) work as expected.)"

> There may be other thread problems, but I doubt that you have correctly
> analyzed their source.

I subclassed smtplib.SMTP and replaced only the lines of code that had 
to do with blocking IO (connect, send and receive operations). 
Beforehand, python would occasionally lock up. Having made those 
changes, python stopped locking up.  I think the problem was pretty well 
apparent.  I can't pin it down to which one of those three operations 
was at fault, and it may be that only one was.  However, when I use 
non-blocking IO, the application works.  When I used smtplib.SMTP, it 
didn't.

I'm open to other explanations.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: thread safe SMTP module

2007-03-04 Thread Gordon Messmer
Aahz wrote:
> 
> Assuming you have correctly tracked down the problem area, I would call
> that a thread bug in Python.  But my experience is that you simply have
> run into a problem with the socket.  I would suggest that using
> socket.setdefaulttimeout() would work just as well.

I believe that solution, also would not work.  This note is included in 
the socket documentation, regarding "timeout mode":

http://docs.python.org/lib/socket-objects.html
"A consequence of this is that file objects returned by the makefile() 
method must only be used when the socket is in blocking mode; in timeout 
or non-blocking mode file operations that cannot be completed 
immediately will fail."

smtplib.SMTP uses file objects when reading SMTP responses.  If I used 
setdefaulttimeout(), then the socket would be in timeout mode and the 
above note would be applicable.

I am not at all above calling python's behavior a bug, except that it 
seemed like a known behavior given the note in the thread documentation 
regarding built-in functions that block on I/O.
-- 
http://mail.python.org/mailman/listinfo/python-list


Watching a file another app is writing

2007-03-11 Thread Gordon Airporte
I'm trying to find a way to take a file that another program has opened 
and writes to periodically, open it simultaneously in Python, and 
automatically update some of my objects in Python when the file is 
written to.
I can open the file and manually readlines() from it to keep up to date, 
it's the automatic part I'm having trouble with. This is on Windows.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Watching a file another app is writing

2007-03-11 Thread Gordon Airporte
Nick Vatamaniuc wrote:
  > You might need to look at pywin32 for Windows specific ways to listen
> to "file changed" event.
> 
> On Unix a quick shortcut would be to simply read the output of 'tail -
> f ' command...

Ah, I forgot I have Cygwin installed, so I do have tail. Unfortunately 
Windows will not let most programs save to the file while tail is 
watching it, and when I force it with vim :w! the output from tail -f 
does not update. Maybe I'm using it wrong.
Well, off to dig through windows documentation. Then I have to figure 
out how to write and event loop for the shell.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: searching algorithm

2007-05-10 Thread Gordon Airporte

> For the above (abrideged) dictionary, you would generate (use a
> fixed-width "programmers" font so the tree looks good):
> 
>  a
>  |
>  b
>  |
>  s
> / \
>i   o
>   /   / \
>  n   l   r
> /   / \   \
>t   u   v   b->(absorbirati, crpisti)
>   /|   |
> (pelin)<-h t   e->(odrije?iti, osloboditi)
>  | |
> (pelin)<-e e->(apsolutan, apsolutni kod)
> 
> As the user enter letters, you just march down the tree, printing
> all the words held in leaf nodes held in the current node.
> 

Call me dense, but how does one do this in Python - which doesn't have 
pointers? Dictionaries with dictionaries within dictionaries... (with 
each letter as the key and the its children as values) is going to be 
extremely space inefficient, right?
-- 
http://mail.python.org/mailman/listinfo/python-list


py2exe LoadLibrary question

2007-05-11 Thread gordon . chapman
Yep, it's the old LoadLibrary failed problem.

I understand that python24.dll is required for the executable to run,
but I'm going to be building a few of these executables and I don't
want to have to bundle python24 along with each one.

We have python24.dll installed in c:/windows/system32, why is
loadlibrary not finding it?

Is there an option I can specify to add c:/windows/system32 to the
loadlibrary search path?

Thanks.

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


ClientForm .click() oddity

2007-05-14 Thread Gordon Airporte
I've written a script using ClientForm to automate opening and closing 
ports on my Linksys router. It works, but I wonder if there isn't a 
better way to do it.
The problem is that the list of arguments in the request generated by 
.click()ing the form is incomplete and I have to edit it manually. The 
Submit button on the form is created with the following code:

document.write("");

Which calls this function in the form source:

function to_submit(F)
{
 F.submit_button.value = "Forward";
 F.action.value = "Apply";
 F.submit();
}

Simply .click()ing on the form does not properly fill in 
submit_button=Forward&action=apply, however. The arguments are there but 
with no values.
Is this because ClientForm doesn't run javascript, or is there a way to 
determine and fix these values without manually editing the .data string 
of the Request with values I have to find on my own?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: itertools.groupby

2007-05-28 Thread Gordon Airporte
7stud wrote:
> Bejeezus.  The description of groupby in the docs is a poster child
> for why the docs need user comments.  Can someone explain to me in
> what sense the name 'uniquekeys' is used this example:
> 

This is my first exposure to this function, and I see that it does have 
some uses in my code. I agree that it is confusing, however.
IMO the confusion could be lessened if the function with the current 
behavior were renamed 'telescope' or 'compact' or 'collapse' or 
something (since it collapses the iterable linearly over homogeneous 
sequences.)
A function named groupby could then have what I think is the clearly 
implied behavior of creating just one iterator for each unique type of 
thing in the input list, as categorized by the key function.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: itertools.groupby

2007-05-28 Thread Gordon Airporte
Paul Rubin wrote:

> It chops up the iterable into a bunch of smaller ones, but the total
> size ends up the same.  "Telescope", "compact", "collapse" etc. make
> it sound like the output is going to end up smaller than the input.

Good point... I guess I was thinking in terms of the number of iterators 
being returned being smaller than the length of the input, and ordered 
relative to the input - not about the fact that the iterators contain 
all of the objects.


> There is also a dirty secret involved , which is that the
> itertools functions (including groupby) are mostly patterned after
> similarly named functions in the Haskell Prelude, which do about the
> same thing.  They are aimed at helping a similar style of programming,
> so staying with similar names IMO is a good thing.

Ah - those horrible, intolerant Functionalists. I dig ;-).

> But that is what groupby does, except its notion of uniqueness is
> limited to contiguous runs of elements having the same key.

"itertools.groupby_except_the_notion_of_uniqueness_is_limited_to-
_contiguous_runs_of_elements_having_the_same_key()" doesn't have much of 
a ring to it. I guess this gets back to documentation problems, because 
the help string says nothing about this limitation:

'''
class groupby(__builtin__.object)
  |  groupby(iterable[, keyfunc]) -> create an iterator which returns
  |  (key, sub-iterator) grouped by each value of key(value).
  |
'''

"Each" seems to imply uniqueness here.
-- 
http://mail.python.org/mailman/listinfo/python-list


com_error 'Exception occurred'

2007-06-02 Thread Richard Gordon
I've got a fatal bug using Parente's pyTTS with Python 2.3 on Windoze 32 using 
MS SAPI 5.1 and Hammond's win32 module. The test program is
  import pyTTS
  tts = pyTTS.Create()
  tts.Speak('Hello world.')

The resulting debug trace is:

  PythonWin 2.3.5 (#62, Feb  8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)] on 
win32.
  Portions Copyright 1994-2006 Mark Hammond - see 'Help/About PythonWin' for 
further copyright information.
  Traceback (most recent call last):
File 
"C:\PROGRA~1\Python23\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
 line 307, in RunScript
  debugger.run(codeObject, __main__.__dict__, start_stepping=0)
File 
"C:\PROGRA~1\Python23\Lib\site-packages\pythonwin\pywin\debugger\__init__.py", 
line 60, in run
  _GetCurrentDebugger().run(cmd, globals,locals, start_stepping)
File 
"C:\PROGRA~1\Python23\Lib\site-packages\pythonwin\pywin\debugger\debugger.py", 
line 631, in run
  exec cmd in globals, locals
File "C:\yakitome\test\examples\ex1.py", line 4, in ?
  tts.Speak('Hello world.')
File "C:\PROGRA~1\Python23\Lib\site-packages\pyTTS\sapi.py", line 213, in 
Speak
  self.speech.Speak(text, flagsum)
File "C:\Program 
Files\Python23\lib\site-packages\win32com\gen_py\C866CA3A-32F7-11D2-9602-00C04F8EE628x0x5x0.py",
 line 2637, in Speak
  , Flags)
  com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0, 
-2147201015), None)
  >>> 

The system does not have a sound card --- could that be an issue?

My head is about to explode trying to solve this problem, so your help and 
suggestions will be much appreciated.-- 
http://mail.python.org/mailman/listinfo/python-list

Please help! win32 com_error 'Exception occurred'

2007-06-02 Thread Richard Gordon
I've got a fatal bug using Parente's pyTTS with Python 2.3 on Windoze 32 using 
MS SAPI 5.1 and Hammond's win32 module. The test program is
  import pyTTS
  tts = pyTTS.Create()
  tts.Speak('Hello world.')

The resulting debug trace is:

  PythonWin 2.3.5 (#62, Feb  8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)] on 
win32.
  Portions Copyright 1994-2006 Mark Hammond - see 'Help/About PythonWin' for 
further copyright information.
  Traceback (most recent call last):
File 
"C:\PROGRA~1\Python23\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
 line 307, in RunScript
  debugger.run(codeObject, __main__.__dict__, start_stepping=0)
File 
"C:\PROGRA~1\Python23\Lib\site-packages\pythonwin\pywin\debugger\__init__.py", 
line 60, in run
  _GetCurrentDebugger().run(cmd, globals,locals, start_stepping)
File 
"C:\PROGRA~1\Python23\Lib\site-packages\pythonwin\pywin\debugger\debugger.py", 
line 631, in run
  exec cmd in globals, locals
File "C:\yakitome\test\examples\ex1.py", line 4, in ?
  tts.Speak('Hello world.')
File "C:\PROGRA~1\Python23\Lib\site-packages\pyTTS\sapi.py", line 213, in 
Speak
  self.speech.Speak(text, flagsum)
File "C:\Program 
Files\Python23\lib\site-packages\win32com\gen_py\C866CA3A-32F7-11D2-9602-00C04F8EE628x0x5x0.py",
 line 2637, in Speak
  , Flags)
  com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0, 
-2147201015), None)
  >>> 

The system does not have a sound card --- could that be an issue?

My head is about to explode trying to solve this problem, so your help and 
suggestions will be much appreciated.-- 
http://mail.python.org/mailman/listinfo/python-list

Need help! win32 com_error 'Exception occurred'

2007-06-02 Thread Richard Gordon
I've got a fatal bug using Parente's pyTTS with Python 2.3 on Windoze 32 
using MS SAPI 5.1 and Hammond's win32 module. The test program is
  import pyTTS
  tts = pyTTS.Create()
  tts.Speak('Hello world.')

The resulting debug trace is:

  PythonWin 2.3.5 (#62, Feb  8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)] 
on win32.
  Portions Copyright 1994-2006 Mark Hammond - see 'Help/About PythonWin' for 
further copyright information.
  Traceback (most recent call last):
File 
"C:\PROGRA~1\Python23\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
 
line 307, in RunScript
  debugger.run(codeObject, __main__.__dict__, start_stepping=0)
File 
"C:\PROGRA~1\Python23\Lib\site-packages\pythonwin\pywin\debugger\__init__.py", 
line 60, in run
  _GetCurrentDebugger().run(cmd, globals,locals, start_stepping)
File 
"C:\PROGRA~1\Python23\Lib\site-packages\pythonwin\pywin\debugger\debugger.py", 
line 631, in run
  exec cmd in globals, locals
File "C:\yakitome\test\examples\ex1.py", line 4, in ?
  tts.Speak('Hello world.')
File "C:\PROGRA~1\Python23\Lib\site-packages\pyTTS\sapi.py", line 213, 
in Speak
  self.speech.Speak(text, flagsum)
File "C:\Program 
Files\Python23\lib\site-packages\win32com\gen_py\C866CA3A-32F7-11D2-9602-00C04F8EE628x0x5x0.py",
 
line 2637, in Speak
  , Flags)
  com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 
0, -2147201015), None)
  >>>

The system does not have a sound card --- could that be an issue?

My head is about to explode trying to solve this problem, so your help and 
suggestions will be much appreciated. 


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


Help with win32 com_error exception

2007-06-02 Thread Richard Gordon
Sorry if this is sent twice, but I didn't see it get posted the first time.

I've got a fatal bug using Parente's pyTTS with Python 2.3 on Windoze 32
using MS SAPI 5.1 and Hammond's win32 module. The test program is
  import pyTTS
  tts = pyTTS.Create()
  tts.Speak('Hello world.')

The resulting debug trace is:

  PythonWin 2.3.5 (#62, Feb  8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]
on win32.
  Portions Copyright 1994-2006 Mark Hammond - see 'Help/About PythonWin' for
further copyright information.
  Traceback (most recent call last):
File
"C:\PROGRA~1\Python23\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
line 307, in RunScript
  debugger.run(codeObject, __main__.__dict__, start_stepping=0)
File
"C:\PROGRA~1\Python23\Lib\site-packages\pythonwin\pywin\debugger\__init__.py",
line 60, in run
  _GetCurrentDebugger().run(cmd, globals,locals, start_stepping)
File
"C:\PROGRA~1\Python23\Lib\site-packages\pythonwin\pywin\debugger\debugger.py",
line 631, in run
  exec cmd in globals, locals
File "C:\yakitome\test\examples\ex1.py", line 4, in ?
  tts.Speak('Hello world.')
File "C:\PROGRA~1\Python23\Lib\site-packages\pyTTS\sapi.py", line 213,
in Speak
  self.speech.Speak(text, flagsum)
File "C:\Program
Files\Python23\lib\site-packages\win32com\gen_py\C866CA3A-32F7-11D2-9602-00C04F8EE628x0x5x0.py",
line 2637, in Speak
  , Flags)
  com_error: (-2147352567, 'Exception occurred.', (0, None, None, None,
0, -2147201015), None)
  >>>

The system does not have a sound card --- could that be an issue?

My head is about to explode trying to solve this problem, so your help and
suggestions will be much appreciated.



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


python-list@python.org Removed

2006-06-14 Thread Gary M. Gordon
We are sorry to see you leaving Gary M. Gordon, LLC!

You will not receive news and information about Gary M. Gordon, LLC anymore.

--
If you ever want to join Gary M. Gordon, LLC again, simply visit:
http://www.garymgordon.com/easylist/easylist.cgi?action=subscribe&[EMAIL 
PROTECTED]
and you will be automatically subscribed again.

Thanks,

Gary M. Gordon, LLC Staff

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


python-list@python.org Removed

2006-06-15 Thread Gary M. Gordon
We are sorry to see you leaving Gary M. Gordon, LLC!

You will not receive news and information about Gary M. Gordon, LLC anymore.

--
If you ever want to join Gary M. Gordon, LLC again, simply visit:
http://www.garymgordon.com/easylist/easylist.cgi?action=subscribe&[EMAIL 
PROTECTED]
and you will be automatically subscribed again.

Thanks,

Gary M. Gordon, LLC Staff

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