Re: How to install local module other than in "site-packages"?

2010-01-18 Thread Jive Dadson
Thankee.  I had just figgered that out.  I wrote everything up in a 
message titled "The answer," but I accidentally created a new thread 
with it. I'll post it in this thread.

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


Re: More version woes

2010-01-18 Thread Jive Dadson

Steven D'Aprano wrote:

On Sun, 17 Jan 2010 23:15:28 -0800, Jive Dadson wrote:


Sorry.  That deprecation warning has nothing to do with the slowness. It
does torque my jaw, however.  Komodo costs money, and Python 2.6 broke
it. @#^&!!! (Again.)

So, the new question is, does anyone know how to make Komodo 3.5 run at
speed with Python 2.6?  Or perhaps better yet, can someone suggest a
good IDE that doesn't cost much?


Perhaps you should be asking the Komodo forums?

Or since you paid for it, perhaps you should be asking customer support?

I suspect that they'll probably tell you that since the latest version of 
Komodo is 5.2, and you're using 3.5, you should stop using a version that 
is over four years old and almost certainly not supported.





Yep.  They want $295, and I cannot justify that for personal use.  I'll 
be looking for a cheaper one.

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


Re: More version woes

2010-01-17 Thread Jive Dadson
Sorry.  That deprecation warning has nothing to do with the slowness. 
It does torque my jaw, however.  Komodo costs money, and Python 2.6 
broke it. @#^&!!! (Again.)


So, the new question is, does anyone know how to make Komodo 3.5 run at 
speed with Python 2.6?  Or perhaps better yet, can someone suggest a 
good IDE that doesn't cost much?

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


Re: Arrrrgh! Another module broken

2010-01-17 Thread Jive Dadson

Jive Dadson wrote:

Matt Newville wrote:

On Jan 17, 7:25 pm, Jive Dadson  wrote:
I just found another module that broke when I went to 2.6. > 
Gnuplot.  Apparently one of its routines has a parameter

named "with."  That used to be okay, and now it's not.


This was fixed in version 1.8 of Gnuplot.py


Once I get everything to work under 2.6, I am using it
forever or until new releases no longer break working
code, whichever comes first.


Hey, good luck with that forever plan.

--Matt


I have source code that uses the "with" kwarg. What do I replace it with?



I found the answer.  The new kwarg in Gnuplot is "with_".
--
http://mail.python.org/mailman/listinfo/python-list


More version woes

2010-01-17 Thread Jive Dadson
This has to do with Komodo.  I cannot use Python 2.4, because numpy is 
broken on my machine for that release for reasons unknown.  I want to 
use 2.6 anyway.  But when I use Python 2.6 and Komodo 3.5, it runs slow 
as death.  I think it might have something to do with the warning I'm 
getting.  Does anyone know what this is about, and what to do about it? 
 Or can anyone tell me why Komodo 3.5 is slow horribly slow with Python 
2.6?



C:\Program Files\ActiveState Komodo 
3.5\lib\support\dbgp\pythonlib\dbgp\client.py:813: DeprecationWarning: 
BaseException.message has been deprecated as of Python 2.6

  self.message = message
C:\Program Files\ActiveState Komodo 
3.5\lib\support\dbgp\pythonlib\dbgp\client.py:815: DeprecationWarning: 
BaseException.message has been deprecated as of Python 2.6

  return self._cmd_error % (self.name,self.tid,self.errid,self.message)


The offending bit of source...

class CommandError(Exception):
"""Breakpoint class

a simple exception that knows how to serialize itself to xml.
"""
_cmd_error = 'transaction_id="%s">code="%d">'


def __init__(self, name, tid, errid, message):
self.name = name
self.tid = tid
self.errid = errid
self.message = message  # THIS IS WHAT IT DOESN'T LIKE
def __str__(self):
return self._cmd_error % 
(self.name,self.tid,self.errid,self.message)

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


Re: Arrrrgh! Another module broken

2010-01-17 Thread Jive Dadson

Matt Newville wrote:

On Jan 17, 7:25 pm, Jive Dadson  wrote:

I just found another module that broke when I went to 2.6. > Gnuplot.  
Apparently one of its routines has a parameter
named "with."  That used to be okay, and now it's not.


This was fixed in version 1.8 of Gnuplot.py


Once I get everything to work under 2.6, I am using it
forever or until new releases no longer break working
code, whichever comes first.


Hey, good luck with that forever plan.

--Matt


I have source code that uses the "with" kwarg. What do I replace it with?
--
http://mail.python.org/mailman/listinfo/python-list


Re: The answer

2010-01-17 Thread Jive Dadson

alex23 wrote:
>
> Actually, if you're using Python 2.6+/3.x, you can effectively skip
> steps 1-5, as these versions now support user site-packages.
>
> Rather than create a Module folder and modify your PYTHONPATH, add (if
> it doesn't exist already) the following folder:
> %APPDATA%/Python/Python26/site-packages
>
> Modules can sit directly in the folder, or within packages.
>
> For more details: http://www.python.org/dev/peps/pep-0370/

That requires a directory whose name embeds the Python version number, 
which is the evil from which I flee, or rather sought to flee.  Imagine 
if all your C++ code had to go into directories that were named for some 
specific C++ compiler.  It's just WRONG.  It's a maintenance nightmare 
to have a bunch of different source files that all have to be updated 
whenever you fix a bug or add a feature.

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


Re: Arrrrgh! Another module broken

2010-01-17 Thread Jive Dadson

Matt Newville wrote:

On Jan 17, 7:25 pm, Jive Dadson  wrote:

I just found another module that broke when I went to 2.6. > Gnuplot.  
Apparently one of its routines has a parameter
named "with."  That used to be okay, and now it's not.


This was fixed in version 1.8 of Gnuplot.py


Once I get everything to work under 2.6, I am using it
forever or until new releases no longer break working
code, whichever comes first.


Hey, good luck with that forever plan.

--Matt



Thanks. I also had to install a new version of numpy.  Have I kvetched 
enough about have to track down new versions of all my third party stuff 
every time I up-rev Python?  I guess so.  :-)


2.6 FOREVER!
--
http://mail.python.org/mailman/listinfo/python-list


The answer

2010-01-17 Thread Jive Dadson
Okay, with your help I've figured it out.  Instructions are below, but 
read the caveat by Ben Fenny in this thread.  All this stuff is good for 
one default version of Python only.  The PYTHONPATH described below, for 
example, cannot specify a version number.  Yes, that's a pain in the 
butt, but there's no way around it.  If you switch versions, you may 
have to delete all the .pyc files that will show up in the module 
folders.  Python ought to check them to see if they are valid, but I do 
not know if it does so.


These instructions are for MS Windows.

1) Create your modules folder. Let's say it's named "Modules."  The 
documentation calls it a "package."


2) In an explorer window or on the desktop, right click on My Computer, 
and select Properties.


3) Select the Advanced tab, and click on Environment Variables near the 
bottom.


4) Look for an environment variable named PYTHONPATH.

   a) If you do not find one, create one using the New button(s). I 
don't know if it has to be in User Variables or System Variables.  To 
save time experimenting, I just put one in both. For the value, put the 
full path of the folder Modules.


   b) If there's already a PYTHONPATH,  Edit it, adding a semi-colon 
and the full path of folder Module to the end.


5) Put your module folders into the folder Module.

6) (Here's a really arcane bit.) Into each module folder, put a file 
named __init__.py.  It will be executed when you load the module.  It 
can be empty, but it has to be there or else the module folder will be 
ignored.

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


Re: Arrrrgh! Another module broken

2010-01-17 Thread Jive Dadson

Matt Newville wrote:

Hey, good luck with that forever plan.

--Matt


Yeah, I know.  I'm just glad I don't have to get new executables and 
dll's from all my software vendors every Tuesday when the MS Window XP 
updates come out.


2.6 FOREVER!
--
http://mail.python.org/mailman/listinfo/python-list


The answer

2010-01-17 Thread Jive Dadson
Okay, with your help I've figured it out.  Instructions are below, but 
read the caveat by Ben Fenny in this thread.  All this stuff is good for 
one default version of Python only.  The PYTHONPATH described below, for 
example, cannot specify a version number.  Yes, that's a pain in the 
butt, but there's no way around it.  If you switch versions, you may 
have to delete all the .pyc files that will show up in the module 
folders.  Python ought to check them to see if they are valid, but I do 
not know if it does so.


These instructions are for MS Windows.

1) Create your modules folder. Let's say it's named "Modules."  The 
documentation calls it a "package."


2) In an explorer window or on the desktop, right click on My Computer, 
and select Properties.


3) Select the Advanced tab, and click on Environment Variables near the 
bottom.


4) Look for an environment variable named PYTHONPATH.

   a) If you do not find one, create one using the New button(s). I 
don't know if it has to be in User Variables or System Variables.  To 
save time experimenting, I just put one in both. For the value, put the 
full path of the folder Modules.


   b) If there's already a PYTHONPATH,  Edit it, adding a semi-colon 
and the full path of folder Module to the end.


5) Put your module folders into the folder Module.

6) (Here's a really arcane bit.) Into each module folder, put a file 
named __init__.py.  It will be executed when you load the module.  It 
can be empty, but it has to be there or else the module folder will be 
ignored.

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


Arrrrgh! Another module broken

2010-01-17 Thread Jive Dadson
I just found another module that broke when I went to 2.6.  Gnuplot. 
Apparently one of its routines has a parameter named "with."  That used 
to be okay, and now it's not.


Once I get everything to work under 2.6, I am using it forever or until 
new releases no longer break working code, whichever comes first.

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


Re: How to install local module other than in "site-packages"?

2010-01-17 Thread Jive Dadson

Okay, I might go this route anyway.  It's almost working.

I created a directory (folder in MS-speak) named Modules, and put its 
path in the PYTHONPATH env variable.


I can now put a file foo.py into the directory Modules, and it will load 
foo.py when I say "import foo."


Now I put a folder into Modules called myModule and in that I put 
bar.py.  It does not find bar.py when I say either import bar or import 
myModule.bar.  I tried the myModule.pth trick but it didn't help.  Maybe 
I did it wrong.

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


Re: How to install local module other than in "site-packages"?

2010-01-17 Thread Jive Dadson

Diez B. Roggisch wrote:


Did "echo %PYTHONPATH%" yield anything? Or is it part of

 >>> import sys
 >>> sys.path


?

Diez


Update: It's working now.  I guess I hadn't reloaded something that I 
need to.  Thanks for your help.


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


Re: How to install local module other than in "site-packages"?

2010-01-17 Thread Jive Dadson

Diez B. Roggisch wrote:


Did "echo %PYTHONPATH%" yield anything? Or is it part of

 >>> import sys
 >>> sys.path


?

Diez


Yes and no in that order.  Never mind.  Ben Fenny talked me out of it 
anyway.  Gr.

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


Re: How to install local module other than in "site-packages"?

2010-01-17 Thread Jive Dadson

Ben Finney wrote:

Jive Dadson  writes:


   How do I install a module that I wrote, without putting it in the
site-packages directory for a specific release?  I have stuff that, to
the best of my knowledge and belief, ought to work under any release.


Nevertheless, the compiled byte-code version will be specific to the
Python version that compiled it. You need to install the module to a
version-specific directory for that reason at least.


I do not want to have multiple copies of it.  When I edit one of the
modules, I want it to "take" for every release.  Is that clear?  Hope
so.


You'll need (I'd love to be corrected on this) to come up with a
deployment discipline: a build process that deploys the module from its
(single, canonical) source location to the appropriate locations when
you decide to deploy it.



Thanks for your help.

Well that majorly sucks.  I was hoping the "foo.pth" thing would save 
me. There ought to be a way.  But even if they did invent one, it 
wouldn't help  me, because I am stuck at version 2.6.  Don't even get me 
started on that.  I really like Python, but the way every release breaks 
everything is a royal pain. The biggest problem is C-extensions of stuff 
that does not come with the Python release. I've complained about it 
before, but it didn't help.  I guess I got myself started on that. :-)


Since I cannot imagine facing the challenge of going to 3.0, I guess it 
doesn't matter if I have my stuff in a folder that's specific to 2.6.

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


Re: How to install local module other than in "site-packages"?

2010-01-17 Thread Jive Dadson

Diez B. Roggisch wrote:

Am 18.01.10 01:07, schrieb Jive Dadson:

  (My apologies if this question shows up twice.  I posted it quite a
while ago, and it's yet to show up.)

This is no doubt a beginner's question, but I've searched for the answer
for quite a while, to no avail. I'm running Python 2.6 under Windows XP.

How do I install a module that I wrote, without putting it in the
site-packages directory for a specific release? I have stuff that, to
the best of my knowledge and belief, ought to work under any release. I
do not want to have multiple copies of it. When I edit one of the
modules, I want it to "take" for every release. Is that clear? Hope so.


Setting the PYTHONPATH environment variable should work.

Diez


I was trying that just now.  So far, no joy.  Can you type up a DUMMIES 
version?


There was no environment variable PYTHONPATH.  I added one to my "User 
Variables."  It's still not finding anything.  And yes, I closed and 
re-opened my Python shell before I tested it.

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


How to install local module other than in "site-packages"?

2010-01-17 Thread Jive Dadson
   (My apologies if this question shows up twice.  I posted it quite a 
while ago, and it's yet to show up.)


   This is no doubt a beginner's question, but I've searched for the 
answer for quite a while, to no avail.  I'm running Python 2.6 under 
Windows XP.


   How do I install a module that I wrote, without putting it in the 
site-packages directory for a specific release?  I have stuff that, to 
the best of my knowledge and belief, ought to work under any release.  I 
do not want to have multiple copies of it.  When I edit one of the 
modules, I want it to "take" for every release.  Is that clear?  Hope so.

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


Re: weekdays in range

2009-10-19 Thread Jive Dadson
I'm using weekdays as a proxy for days when the US stock market is open. 
 (I'll miss holidays.)  The application is pricing CALL and PUT 
options.  Speed is not a problem.  The number of days will typically be 
between 1 and 254.

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


weekdays in range

2009-10-19 Thread Jive Dadson

(Sorry if this shows up twice.)

Can someone think of an easy way to calculate the number of weekdays 
between two calendar dates (in Python)?


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


Re: weekdays in range

2009-10-18 Thread Jive Dadson

Wow.  It's a danged tutorial.  Thanks again.  Take a break.
--
http://mail.python.org/mailman/listinfo/python-list


Re: weekdays in range

2009-10-18 Thread Jive Dadson

Ben Finney wrote:

Jive Dadson  writes:


Can someone think of an easy way to calculate the number of weekdays
between two calendar dates (in Python)?


That depends on what you mean by “weekdays”.

>>> import datetime
>>> begin_date = datetime.date(2009, 10, 9)
>>> end_date = datetime.date(2009, 10, 22)
>>> import calendar
>>> print calendar.month(2009, 10)
October 2009
Mo Tu We Th Fr Sa Su
  1  2  3  4
 5  6  7  8  9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
>>> end_date - begin_date
datetime.timedelta(13)

If you're expecting to exclude Saturday and Sunday (i.e. if you expect
the above result to be 9 days instead of 13), you can use other
functions of the ‘calendar’ module; try starting with:

>>> friday_weekday = 4
>>> len([
... date for date in (
... begin_date + datetime.timedelta(days)
... for days in range((end_date - begin_date).days))
... if calendar.weekday(date.year, date.month, date.day) <= 
friday_weekday])
9



Thanks for your help. For a non-expert at Python, that last compound 
statement is pretty inscrutable.  I am trying to scrute it.  Wish me luck.

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


Re: Once again, comparison wxpython with PyQt

2009-06-18 Thread Jive Dadson
Qt has far better documentation, and it has Qt Designer.  The 
documentation is a big deal.  I wrote a little project in wxPython, and 
I spent 90% of my time just trying to find the names of member functions 
and then to figure out what they do.


Why not use Qt C++?  I like Python a lot.  Heck, I even embedded it in a
robot controller that might have wrangled some of the wafers that went 
into your computer chips.  But I think I would go with C++ for a medium 
size GUI project.


Hans Müller wrote:

Here we have to select between wxPython and PyQt for a medium size project.
In this project several hundred dialogs are to be created. This work 
will be done by a

program generator which has to re-written.

The question now is which framework should we use.
As far as I could found is PyQt with the Qt Framework the superior choice.
Most articles I found (not all) results to PyQt.
But Qt is expensive ~ 3400€ per Developer and OS.
Since these articles are more or less old, it would be nice to hear your 
current opinions.


Condensed, I found this pros / cons:

Pros for Qt:
- best framwork, well designed
- nice GUI builders
- faster execution
Cons:
- epensive

Pros for wxPython:
- cheap
- big community
Cons:
- more layers on top of OS
- more bugs (still valid ?)
- slower




Can someone tell me about his experiences with one or both frameworks ?

Thanks a lot,

Greetings
Hans

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


Re: AT&T Usenet Netnews Service Shutting Down

2009-06-18 Thread Jive Dadson

newsmas...@bellsouth.net wrote:

Please note that on or around July 15, 2009, AT&T will no longer be
offering access to the Usenet Netnews service.  If you wish to continue
reading Usenet newsgroups, access is available through third-party vendors.

http://support.att.net/usenet


Distribution: AT&T SouthEast Newsgroups Servers



Ah ha.  I think I may have figured out how to work around it.  I need to 
use my EasyNews server to post the message, (with "SSL"), rather than 
the  ATT server.  I think.  Maybe.  Does anyone know if it's possible to 
have Thunderbird use different outgoing servers for different accounts?


I know this is not a Python question.  Please forgive me.  The main 
reason I'm sending these messages is just to see if they go through.

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


wxPython gurus, please help

2009-05-23 Thread Jive Dadson
   I have an application that opens an image file of the user's choice. 
  I have an exception handler for the case that the user selected a bad 
or unsupported image file.  My code is catching the exception, but 
unfortunately for me, after I exit the except-clause, wxPython is 
popping up its own message dialog from somewhere in deepest, darkest 
__core__.


   How do I make it not do that?

   Thankee much,
   Jive
--
http://mail.python.org/mailman/listinfo/python-list


Re: Cursor movement question

2009-05-23 Thread Jive Dadson

Aahz wrote:

In article ,
Jive Dadson   wrote:

Gosh, you guys are slow. :-) I figured it out.


Perhaps you could post the solution for posterity's sake?


The double secret magic encantation is "WarpPointer."  Unfortunately, it 
does not work in a plain vanilla ScrolledWindow. ScrolledWindow captures 
the event and scrolls by the default scroll amount of 20 pixels. I think 
I can figure out a work-around, but I have not yet done so.


self.bmp.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)

def OnKeyDown(self, event):
# Use direction keys to move cursor one pixel

x,y = event.GetPosition()
keycode = event.GetKeyCode()
X = 0
Y = 0
if keycode == wx.WXK_LEFT:
X = -1
elif keycode == wx.WXK_RIGHT:
X = 1
elif keycode == wx.WXK_UP:
Y = -1
elif keycode == wx.WXK_DOWN:
Y = 1
else:
return

x = max(0,min(self.size[0]-1,x+X))
y = max(0,min(self.size[1]-1,y+Y))
self.bmp.WarpPointer(x, y)
self.bmp.SetFocus()
--
http://mail.python.org/mailman/listinfo/python-list


Cursor movement question

2009-05-22 Thread Jive Dadson
Howdy, folks.  I am using wxPython 2.8 on Windoze XP Pro.  I want my 
application to move the cursor and the mouse-point (the coordinates in 
the mouse-click events) to the left when the user presses the left-arrow 
key, up when they press the up-arrow key, etc..  I think I can figure 
out how to grab the arrow key events, but I can't find how to move the 
cursor.  I tried calling wx.SetCursorEvent(x,y), but no joy.


Can you help?

Thankee,
Jive
--
http://mail.python.org/mailman/listinfo/python-list


Re: Cursor movement question

2009-05-21 Thread Jive Dadson

Gosh, you guys are slow. :-) I figured it out.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Which C compiler?

2009-05-18 Thread Jive Dadson

Martin v. Löwis wrote:

Jive Dadson wrote:

I am using Python 2.4.  I need to make a native Python extension for
Windows XP.  I have both VC++ 6.0 and Visual C++ 2005 Express Edition.
Will VC++ 6.0 do the trick?  That would be easier for me, because the
project is written for that one.  If not, will the 2005 compiler do it?


In general, to build extension modules, you need to use the same VC
version as the one that was used to build Python. For 2.4, that would
be Visual Studio 2003. So if you use VC 6, VS 2005, or VS 2008, you
may run into problems.

Depending on what exactly the extension module does, it might work
fine also.

Regards,
Martin


Thanks.  I think I might just use some variety of Popen instead.  I 
don't need much communication between the C++ application and Python, 
and it's not time-critical.  I cannot get flush() to work on the Python 
side of the pipe however I try.  That seems to be a common complaint. 
But I can work around it.


I love Python, but the update regimen is very frustrating.  It's a 
misery to me why every major release requires new versions of so much 
application stuff.  No other software that I use is like that.  When I 
upgrade Windoze, I do not have to get new matching versions of all my 
editors, browsers, and whatnot.  But Python makes me do that, and that's 
why I am stuck on release 2.4.  Even the pure Python stuff needs to be 
copied from one "site-packages" to another.  Then I have to figure out 
why it won't work.  I have fought my way through the upgrade path twice, 
and I just can't face it again.


Thus endeth the rant.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Which C compiler?

2009-05-18 Thread Jive Dadson
P.s. I just found out that there's a new Express edition, 2008. (New to 
me, that is.)  I'm installing it.

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


Which C compiler?

2009-05-17 Thread Jive Dadson
I am using Python 2.4.  I need to make a native Python extension for 
Windows XP.  I have both VC++ 6.0 and Visual C++ 2005 Express Edition. 
Will VC++ 6.0 do the trick?  That would be easier for me, because the 
project is written for that one.  If not, will the 2005 compiler do it?


Thanks much,
"Jive"
--
http://mail.python.org/mailman/listinfo/python-list


Re: urllib and login with passwords

2008-07-26 Thread Jive Dadson
Thanks, Rob!  Some of that is beyond my maturity level, but I'll try to 
figure it out.  If anyone has specific info on about how YouTube does 
it, I would appreciate the info.

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


urllib and login with passwords

2008-07-26 Thread Jive Dadson

Hey folks!

There are various web pages that I would like to read using urllib, but 
they require login with passwords. Can anyone tell me how to find out 
how to do that, both in general and specifically for YouTube.com.


Thankee.

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


Re: web client in Python Q

2008-05-08 Thread Jive Dadson

Jerry Hill wrote:

On Wed, May 7, 2008 at 11:22 PM, Jive Dadson <[EMAIL PROTECTED]> wrote:

I wonder why it does not work with

 http://stockcharts.com/webcgi/wb.exe?Data.web+SLW


It looks like that is a subscription site.  That makes things more
complicated, because it means you'll need to figure out how to log in,
then probably store cookies related to your session and offer them
back up to the web server on subsequent requests.  Python has modules
that help with these things (mostly in the urllib2 module if i recall
correctly), but it's not quite as straightforward as just fetching a
URL.

I don't have time to dig up an example at the moment, but if you're
still having trouble with it, I can try to pull something together
this weekend.



Thanks for the help, Jerry.  I do subscribe to that service, but tapping 
the data via Python may be more trouble than it's worth.  I can get all 
the info for stocks and ETF's from finance.google.  All I am missing is 
indexes.  I can probably live without those.  But if you want a 
challenge, have at it.  It would be appreciated.


Jive

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


Re: web client in Python Q

2008-05-07 Thread Jive Dadson
Thanks, Jerry!  That's so cool.  I actually managed to blunder through 
with sockets and so forth, but this is much cleaner.


I wonder why it does not work with

 http://stockcharts.com/webcgi/wb.exe?Data.web+SLW

I get a connection reset by peer error.
--
http://mail.python.org/mailman/listinfo/python-list


web client in Python Q

2008-05-07 Thread Jive Dadson
Hey folks.  I know approximately zero about web clients.  There's a 
simple task I want to do. (I think it's probably simple.) And I figure a 
Python script ought to be just the ticket.


Various web services for daily stock ticker info.  For example,

http://finance.google.com/finance/historical?q=NYSE:APC&output=csv

and

http://download.finance.yahoo.com/d/quotes.csv?s=APC&f=sl1d1t1c1ohgv&e=.csv

Those will serve up data for the stock APC.  But the problem is, a 
file-selection dialog pops up.  I would like to have a program that 
would supply a file name and download the data automatically, without 
human or mouse intervention.  Is that clear?


Can someone point me in the right direction?

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


Re: wxPython help please

2006-12-16 Thread Jive Dadson
Sandra-24 wrote:
> Try the wxPython mailing list, which you can find on their site. And
> the best wxPython reference is the book (also available as an e-book)
> by Robin Dunn, who created wxPython. Seeing wxPython from his
> perspective is well worth the money. If I recall correctly he devoted
> an entire chapter to drawing with a canvas widget.
> 
> -Sandra
> 


I bought the ebook.  Searching for "pixel", all I came up with was a 
method called GetPixel in a "device context."  I know there must be a 
device context buried in there somewhere, so now I need to winkle it out.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: wxPython help please

2006-12-16 Thread Jive Dadson
Sandra-24 wrote:
> Try the wxPython mailing list, which you can find on their site. And
> the best wxPython reference is the book (also available as an e-book)
> by Robin Dunn, who created wxPython. Seeing wxPython from his
> perspective is well worth the money. If I recall correctly he devoted
> an entire chapter to drawing with a canvas widget.
> 
> -Sandra
> 

Thanks. I'll give it a look see.

You understand that what I want to do is get the pixel that's under the 
cursor when I click, right?  I don't really need to draw things, only 
load an image from a file.  But since this program already did so much 
of what I wanted, I decided to try it.  It is frustrating that after a 
couple of hours I still can't figure out how to read a danged pixel.

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


wxPython help please

2006-12-16 Thread Jive Dadson
I hope someone can help me with a couple of wxPython questions, or point 
me to the right newsgroup for the questions.

I am trying to modify the floatcanvas demo program.  I want to load an 
image from a file (jpg or whatever), then do a kind of color-picker 
action on it.

I haven't tried yet to figure out how to load the file.  Just for 
starters, when I click on the canvas, I want to get the rgb pixel value 
for the point under the cursor.  I can't for the life of me figure out 
how to do it.  I suppose it begins with event.GetPosition(), but after 
that I am at a loss.

The larger question is how to use wxPython.  It's got such fabulous 
stuff, but every time I try to do anything with it, I eventually give up 
  because I can't find adequate documentation.  I know very little about 
graphics programming.

Please respond here.  Because of spammers, the email address is fake.

Thanks,
"Jive"
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Drawing a grid on a picture

2006-08-14 Thread Jive Dadson
Sybren Stuvel wrote:
> Jive Dadson enlightened us with:
>> I also found a reference to something called PIL.  Maybe that's the
>> ticket.  If so, where can I find it (with documentation)?  Thanks.
> 
> Just google for PIL and Python.
> 
> Sybren

Thanks Brian and Sybren.  PIL did the trick.  Real easy.


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


Re: Drawing a grid on a picture

2006-08-13 Thread Jive Dadson
I also found a reference to something called PIL.  Maybe that's the 
ticket.  If so, where can I find it (with documentation)?  Thanks.
-- 
http://mail.python.org/mailman/listinfo/python-list


Drawing a grid on a picture

2006-08-13 Thread Jive Dadson
Hello folks.  I know precisely zero about image processing.  I want to 
draw a grid of lines one or two pixels wide on a picture (.jpg, .png, or 
whatever). [I want to transfer a sketch of the picture to a canvas (for 
oil painting), using the "grid method."]

I figure this is probably a very easy thing to do, but I can't seem to 
find the documentation I need.  It all seems to assume you already know 
something.  I have wxPython installed.  I also have the wxPython demo. 
The section "Using Images/Image" looked promising.  It just shows how to 
  read a picture and display it as a bitmap.

Can someone show me how, or point me in the right direction?

Thanks a lot.
-- 
http://mail.python.org/mailman/listinfo/python-list


new division in Pythonwin

2005-07-12 Thread Jive Dadson
I like to use Pythonwin as my desktop calculator.  It's bothersome
to have to type in "from __future__ import division" into the
interactive window every time I open it.  I've tried various ways to
attempt to get it to import new division at startup, but no luck.  I
can get it to execute a file, but apparently it does so in an
environment that gets discarded, rather than in the environment of
the interactive window.  So the "from __future__" statement has no
effect.

Any suggestions?

Thankee.


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


Re: negative integer division

2005-02-09 Thread Jive Dadson
intentionally
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: negative integer division

2005-02-09 Thread Jive Dadson


Grant Edwards wrote:
> 
> On 2005-02-09, Jive Dadson <[EMAIL PROTECTED]> wrote:
> 
> >> [C] isn't - it's a portable assembler.
> >
> > I've heard that many times, but it makes no sense to me.
> 
> I think the point is that C is a low-level, hardware twiddling
> language to be used by people writing things like kernel code --

And Python interpreters?

> 
> The fact that C ended up in the rather inappropriate role of
> a user-land application language is different problem.

In the early 80's, either C was the "appropriate language" or there was
none ... and that's coming from someone who wrote a commercial
Pascal compiler, runtime support, and debugger. I did it all in C.
Pascal, as we all know, was ill-conceived.  C++ was a momentous
advance, but it intensionally inherited many of C's warts.

I've forgotten what we are arguing about, but I'm sure I'm right.

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


Re: negative integer division

2005-02-09 Thread Jive Dadson


Mike Meyer wrote:
> 
> Jive Dadson <[EMAIL PROTECTED]> writes:
> 
> > Python does it right.  C is allowed to do it anyway it likes, which was
> > a stupifyingly horrible decision, IMHO.
> 
> C only does it wrong if you think that C is a high level language. 

I didn't say it does it wrong.  I said it does it anyway it likes --
maybe right, maybe wrong.  There *is* a right way, IMHO.  Python does it
that way.

> [C] isn't - it's a portable assembler.

I've heard that many times, but it makes no sense to me.  By definition,
the syntax of an assembly language closely resembles the format of
individual hardware instructions for a particular processor.  An
assembler assembles individual hardware instructions.  Back in the day,
Unix (written largely in C) and Steve Johnson's pcc (the *portable* C
compiler) together constituted a big leap forward.  Implementing Unix on
new processors was infinitely easier than porting OS's written in
assembly language.  So I disagree on two counts: C code is not entirely
portable, (for example, division and mod may not work the same on two
different machines), and a C compiler is most certainly not an
assembler.


> Now, I'll agree with you if you want to argue that some machines do
> negative integer division in stupifyingly horrible ways.

That's why I think it was a stupifyingly horrible decision. 
Understandable, but in the end an s.h.d. nonetheless.  It would have
been okay to define / and % correctly, in the mathematical sense, but
also provide functions quick_div() and quick_mod() that were guaranteed
to work correctly only when both arguments were positive.  The way they
did it is just too error prone, akin to early optimization.  It's bitten
me before, when I was called on to port code (which I did not write)
from one machine to another.  Having standard operators with
under-defined behavior is just inviting trouble: long debugging
sessions, or worse, unexplained failures in the field.  Of course you
and I would avoid all the pitfalls at the start. :-)

... and now back to your regularly scheduled Python newsgroup.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Name of type of object

2005-02-09 Thread Jive Dadson

I don't think I've quite got it.

The application I'm writing has some similarities to an interactive
shell.  Like an interactive shell, it executes arbitrary code that it
receives from an input stream.  When it gets an exception, it should
create an informative message, regardless of the type of exception.  The
traceback routine does that, somehow, some way, but I've tried to read
that code and figure out how and I don't get it.

The best I have so far is,

class Exec_thread(BG_thread):
""" Execute a line of code in the global namespace. """
def _process(s):
""" Process one instruction """
try:
exec s.product in globals()
except (Exception), e:
handle_error( typename(e)+ ": " + str(e) )


But that works only if the exception happens to be derived from
Exception.  How do I handle the
general case?
-- 
http://mail.python.org/mailman/listinfo/python-list


Name of type of object

2005-02-08 Thread Jive Dadson
The traceback routine prints out stuff like,

NameError: global name 'foo' is not defined

NameError is a standard exception type.

What if I want to print out something like that?
I've determined that "global name 'foo' is not defined" comes 
from the __str__ member of the exception object.
Where does it find the string "NameError"?  In general, if I have 
an object, is there a way to obtain the name of the type of the object?

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


Re: interactive execution

2005-02-08 Thread Jive Dadson
Yeah.  I got it.

exec "foo = 555" in globals(), locals() does the trick.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: interactive execution

2005-02-08 Thread Jive Dadson


Jeff Shannon wrote:
> 
> Jive Dadson wrote:
> 
> > How does one execute arbitrary text as code within a module's context?
> >
> > I've got some code that compiles some text and then executes it.  When
> > the string is "print 'Hello'", it prints "Hello".  I get no exception
> > when I compile and execute "foo = 555".  If I then compile and exec
> > "print foo", I get a name error. The variable foo is undefined. My
> > assumption is that the "exec" command created a new namespace, put "foo"
> > in that namespace, and then threw the namespace away.  Or something.
> 
> You can do
> 
> exec codestring in globaldict, localdict
> 
> (Or something like that, this is from unused memory and is untested.)
>   The net effect is that exec uses the subsequent dictionaries as its
> globals and locals, reading from and writing to them as necessary.
> 
> (Note that this doesn't get you any real security, because malicious
> code can still get to __builtins__ from almost any object...)
> 
> Jeff Shannon
> Technician/Programmer
> Credit International

Promising, but,

Traceback (most recent call last):
  File "F:/C++ Projects/zardude/temp.py", line 9, in -toplevel-
exec "foo = 555" in globaldict, localdict
NameError: name 'globaldict' is not defined
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: negative integer division

2005-02-08 Thread Jive Dadson
Python does it right.  C is allowed to do it anyway it likes, which was
a stupifyingly horrible decision, IMHO.

Way back when, there was a language named Pascal.  I lobbied the Pascal
standards committee to define the modulus operator correctly, which they
eventually did.  To my astonishment, they proceded to define the
division operator backwards to the modulus operator, so that division
and mod did not play together correctly.  Duh.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What's wrong with `is not None`?

2005-02-08 Thread Jive Dadson


Frans Englich wrote:
> 
> That's what PyChecker tells me, at least.
> 
> A line of:
> 
> if testReport is not None:
> 
> results in:
> 
> runner.py:587: Using is not None, may not always work
> 
> In what circumstances can `is not None` fail? How and why does it fail?
> 
> What is the equivalent expression which is more secure; `!= None`?

Yeah, that'll do it.

Incredibly, Microsoft has patented the "isnot" operator.  I kid you not.
They are amassing an incredible number of patents, many with no more
merit than the "isnot" one.  I'll leave it to your imagination as to
why.
-- 
http://mail.python.org/mailman/listinfo/python-list


interactive execution

2005-02-08 Thread Jive Dadson
How does one execute arbitrary text as code within a module's context?

I've got some code that compiles some text and then executes it.  When
the string is "print 'Hello'", it prints "Hello".  I get no exception
when I compile and execute "foo = 555".  If I then compile and exec
"print foo", I get a name error. The variable foo is undefined. My
assumption is that the "exec" command created a new namespace, put "foo"
in that namespace, and then threw the namespace away.  Or something.

I know it must be possible to do this, because it's exactly what
programs like IDLE do.

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


Re: Cool object trick

2004-12-16 Thread Jive
Kinda cool.

It's occured to me that just about everything Pythonic can be done with
dicts and functions.  Your Obj is just a dict with an alternate syntax.  You
don't have to put quotes around the keys.  But that's cool.


class struct(object):
def __init__(self, **kwargs):
self.__dict__.update(kwargs)

# Indented this way, it looks like a struct:
obj = struct(  saying = "Nee"
   , something = "different"
   , spam = "eggs"
  )

print obj.spam

# Is that really much different from this?

obj2 = { "saying" : "Nee"
, "something" : "different"
, "spam" : "eggs"
   }

print obj2["spam"]


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


wxPython question

2004-12-16 Thread Jive
How the heck do you set the icon on a frame using a .ico file, or a .bmp
file, or whatever?  How do you find out how to do something like that?
Apparently there is no documentation to speak of.  I tried looking the in
the demo program, but I didn't find the secret..



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


NO REALLY

2004-12-15 Thread Jive
Isn't there a comp.lang.flame or something?


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


Re: New versions breaking extensions, etc.

2004-12-14 Thread Jive

"Robin Becker" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Cameron Laird wrote:
> There was no rational reason
> for me to upgrade to VC 7.x, but now I'm forced to by my preferred
language.
> -- 
> Robin Becker

That's the way I feel about it too.  Actually, I'm getting pushed toward
Microsoft from other directions, also for no good reason -- and for a whole
lot of computers, not just for the one on my desk.

Open letter to Bill Gates:

Dear Bill,

Okay. You win again.  It was silly of me to think Python would help me
escape your clutches.  Look at how good I am being now.  I am typing this
into an Outlook Express window, using a Microsoft operating system that you
will no doubt find a way to make me replace very soon.  You beat me fair and
square.  Well, square, anyway.  Congratulations.  I give up.

Jive




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


I DECLARE THIS THREAD FINISHED

2004-12-14 Thread Jive
Everyone keep moving.  There is nothing to see here.  Move along.



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


Re: lies about OOP

2004-12-14 Thread Jive

"Paul McGuire" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I was just reacting mostly to the OP's statement that "by '86 the Joy of
OOP
> was widely known".

I (Jive Dadson) said that.  I guess I figured that if I knew about it, it
was widely known.  But in retrospect, I had an information edge.  I was in
Silicon Valley, working on the Next Big Thing, and I was wired into USENET.
My earliest dejagoogle hit is from '86.  (It's not under "Jive Dadson", a
more recent nom du net.)

He didn't say "OOP all began when..." or "OOP was widely
> known," which I think still would have been a stretch - he implied that by
> '86 OOP was widely recognized as Goodness, to which I disagree.

Well, it was widely known by everyone who read the motos I stuck up on my
cubicle walls. :-)

Jive


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


Re: New versions breaking extensions, etc.

2004-12-14 Thread Jive

"Martin v. Löwis" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> It's not hard-coded in the linker, but hard-coded in the import library.
> So if you link with msvcrt.lib (which might not be the precise name
> of the import library - I cannot look up the precise name right now),
> msvcrt.lib will in turn refer to msvcr71.dll.

But it makes no difference, no?  The problem is that both Python.exe and the
extensions are *compiled* to link with a *particular* crt.  (How "dyanamic"
is that?)  We could probably kluge around the problem if it were not for the
fact that one crt might perversely define some struct, (FILE, for example),
with difference layouts in different crt DLL's. Right?  The header files
contain the poison.

So it would seem that as far as the crt goes, we are at the mercy of the
micro soft ones.  They could introduce an incompatible crt at any time.

By the way, I've googled around and found others outside the Python
community who have run into the same problem.  In some cases, they have
opted just to stay with VC 6.0.  One said, "At least the 6.0 compiler is 2.5
times as fast."  Groan.




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


Re: lies about OOP

2004-12-14 Thread Jive

"projecktzero" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I know this might not be the correct group to post this, but I thought
> I'd start here.
>
> A co-worker considers himself "old school" in that he hasn't seen the
> light of OOP.

Just how old *is* his school?  I saw the light in the 70's.  For those of
you too young to remember, those were menacing and sinister days, when pant
legs were too wide at the bottom, and the grotesque evil of "top down
programming" was on the land.  But by '86, the Joy of OOP was widely known.
Flowers bloomed and birds chirped.  Pant legs narrowed.  I believe that was
the year I attended the first C++ conference in Santa Fe.





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


Re: New versions breaking extensions, etc.

2004-12-13 Thread Jive

"Cameron Laird" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Tcl went through this epiphany a few years, and has largely,
> though not exclusively, committed to use of the once-more-
> redirected API called Stubs http://wiki.tcl.tk/stubs >.
> Some Tcl-ers are orgasmic about the wonders of Stubs, some
> ignore it, a few don't like it, and most, perhaps, aren't
> even aware of its existence.  Performance doesn't appear to
> be much of an issue, though.

It uses function pointer tables (like COM), but in the "other direction"
apparently.

Bit by bit, I am remembering now just how stupifyingly brain-dead the MS DLL
scheme is.
Back in '87 or so, I wrote a better dynamic linker (for a Unix) in a couple
of days.





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


Re: Python mascot proposal

2004-12-13 Thread Jive
P.s.  I never could stand Beanie and Cecil.


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


Re: Python mascot proposal

2004-12-13 Thread Jive
I've yet to see a Python logo that I thought was really good.  The cartoon
green snake icon is okay, I guess, if a bit cutesy for my taste.

Random thoughts:  It is unreasonable to use the name "Python" and not expect
people to associate it with a snake.  I say that although I'm a big Python
(Monte) fan from the beginning.  I think it would be a bad idea to market
the etymological connection between Python the language and the comedy
group.  Always remember that most people are pig-ignorant philistines.
Besides, Monte Python stuff is trademarked and copyrighted..  And what have
you got against snakes, huh?  Huh?

Jive


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


Re: lies about OOP

2004-12-13 Thread Jive

"Mike Thompson"  wrote in message
news:[EMAIL PROTECTED]
>

> Then came Brad Cox's book.

I read it.

>
> Then there was Glockenspiel's C++ for PC in about '87 or '88.

I didn't PC in those days.  I Unixed.

> And, of  course, cfont on unix from about, what, '85?

That's about when I got it.  I used to chat with B.S. on the phone,
discussing and proposing features.  Now he's rich and famous.  Me?  Would
you believe rich?  How about not destitute?

>
> Across the late '80s there was, of course, Eiffel which seemed a
> remarkable piece of work for the time. And was backed by a terrific book
> by Myer.
>

I puzzled long over whether to adopt C++ or Eiffel at the company I was with
at the time.  I went with C++, dispite the fact that cfront was slow as
death and buggy.  C++ made it bigtime and the company went public.  Lucky
guesses?  Hah!

Ah, nostalgia isn't what it used to be.

Jive


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


Re: New versions breaking extensions, etc.

2004-12-12 Thread Jive

"Martin v. Löwis" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Jive wrote:
> >>Either VS.NET 2003 or VC++ .NET 2003 should do (although I don't know
> >>anybody who owns the latter to be sure). The core issue is that it needs
> >>a "native" C++ compiler (ie. not just managed C++), and that it needs
> >>mscvcr71.dll.
> >>
> >
> >
> > Sorry if I'm being dense.   If I had that DLL, why couldn't I use VC++
6.0?
>
> Sorry for being imprecise. You don't need just msvcr71.dll, you need an
> import library for it, and you need to cause link.exe to use that import
> library. VC6 will continue to link your extension modules with
> msvcrt40.dll - regardless of what other DLLs you have on your system.
>
> It might be that you also need the header files for msvcr71.dll,
> although I believe you could get away with using the "wrong" (i.e.
> VC6) header files.
>
> Regards,
> Martin

Well, ain't that enough to gag a maggot?  I was aware that DLL's don't
really link dynamically.  I was not aware that the crt dll file name was
hard-coded into the linker.  But I looked on the link line and, sure enough,
that particular dll was not listed among the others.

Malice or incompetence? You be the judge.


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


Re: New versions breaking extensions, etc.

2004-12-12 Thread Jive

"Martin v. Löwis" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Either VS.NET 2003 or VC++ .NET 2003 should do (although I don't know
> anybody who owns the latter to be sure). The core issue is that it needs
> a "native" C++ compiler (ie. not just managed C++), and that it needs
> mscvcr71.dll.
>

Sorry if I'm being dense.   If I had that DLL, why couldn't I use VC++ 6.0?

It's still not clear to me exactly what's in each package.  One would think
there would be a more technical description on the MS web pages.


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


Re: Named pipes in threads

2004-12-12 Thread Jive

"Philippe C. Martin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> HI,
>
> I currently have a "working" script that uses sockets to handle threads
> communications - the problem is that it gives me obvious problems in
handling
> free ports (launching the script more than once ).
>
> Is thread named pipes communication allowed ?
>
> Regards,
>

Replace the sockets with a queue of strings.
http://docs.python.org/lib/module-Queue.html

Write your Send and Recv functions in terms of Queue.get() and Queue.put();
> Philippe


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


Upgrade woes: Numeric, gnuplot, and Python 2.4

2004-12-11 Thread Jive
Here's my sitch:

I use gnuplot.py at work, platform Win32.  I want to upgrade to Python 2.4.
Gnuplot.py uses extension module Numeric.  Numeric is now "unsupported."
The documentation says "If you are new to Numerical Python, please use
Numarray.".  It's not that easy, dangit.  The download page for numpy does
not contain a 2.4 version of Numeric, and I suspect they do not intend to
release one, because there IS a 2.4 version of Numarray.

So here are my choices:

1) Switch from gnuplot.py to some other plotting package.
2) Convince, bribe, or cajole someone to implement gnuplot.py using
Numarray.
3) Hack on gnuplot.py myself.  (Learning curve alert!)
4) Buy a copy of the VC++ 7.1 and port Numeric myself. (I still don't know
what to buy from Mr. Gates -- VC++ .net Standard?)
5) Do something else I haven't thought of.

Any suggestions would be welcome.

Jive "I speet on backwards incompatibility" Dadson


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


Re: Upgrade woes: Numeric, gnuplot, and Python 2.4

2004-12-11 Thread Jive

"John Machin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Why do you want to "upgrade to 2.4"? What do you mean by "upgrade to 2.4"?

Well, for one thing, when I previously installed and then uninstalled 2.4,
pythonwin broke, and neither I nor the win32 gurus can figure out what the
heck happened.


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


Re: New versions breaking extensions, etc.

2004-12-11 Thread Jive

"Martin v. Löwis" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> OTOH, people who only have VC6 just need to buy VS.NET 2003,
> which is still available.

I don't even know how to do that! :-)  What's the difference between VC++
.net Standard and Visual Studio .net Pro?  (Besides $370?)  Is the former
C++ only, but with the IDE, and the later the whole shebang with SourceSafe,
VBASIC, and all that?

OH NO!  I've gone seriously off-topic.  Please don't call the Spanish
Inquisiton.  Allow me to re-phrase the question:  What do I need to build
(on-topic) Python extensions?



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


Re: New versions breaking extensions, etc.

2004-12-10 Thread Jive
P.s.  Does anyone know how to make Outlook Express leave my damned line-ends
alone?  If I want line-ends. I know where to find the ENTER key.



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


Re: New versions breaking extensions, etc.

2004-12-10 Thread Jive

"Nick Coghlan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Jive wrote:
> > Can someone explain to me why Python 2.4 on MS Windows has these
backward
> > compatibility problems?  What am I missing?
>
> The problem is the Python C/API. At the moment, it exposes things directly
(like
> data structures) that may change size between major version releases.

Okay.  That could be fixed.

> The other
> issue is that the interpreter and the extensions may be linked to
different
> versions of the Microsoft runtime.

Doesn't Microsoft have an answer for that?  There are (at last count) nine
skillion ActiveX
components in the wild.  Surely Microsoft didn't blast them into oblivion
with dot-net -- did it?

>
> This is a solvable problem, but it would require:
>1. Major additions to the C/API - a "Python Major Version Agnostic" API
that
> hides all data structures behind opaque pointers, never passes file
descriptors
> between the interpreter and the extension and never gets Python to delete
memory
> allocated by the extension (or vice-versa)

I remember having trouble with that last bit once.  But I seem to recall
there was an easy
answer.  Something to do with the main ap and the DLL using the same heap or
some
such thing.

>2. Rewriting extensions to use the new API functions instead of the
current
> major version specific ones.

That's a one-time thing, for those who choose to do it.  Certainly the old
API
would still be available.

>
> Such an API is likely to be both harder to work with and slower, simply
due to
> the limitations of C.
>
> To this date, no-one has cared enough about the problem to put in the
effort
> required to make the C API version agnostic. Given that the API almost
always
> remains *source* compatible, within a month or two of a new Python
release, the
> extension developers have generally tweaked their build environments to
also
> produce binaries for the new release.

It would be a Good Thing to put a stop to that requirement, no?

>
> In the current case (Python 2.4), the transition from msvcrt to msvcrt71,
and
> the poor quality of the free development tools offered by Microsoft has
> exacerbated the problem on Windows.

No doubt.  I don't understand what the deal is with msvcr71 and all that,
but I have
figured out that it's a dirty rotten shame.  If you google for msvcr71, you
will
get pages and pages of links to plaintive cries for help.  We are not alone.

> The Python developers are looking at
> improving the documentation and support for building extensions with
Windows
> compilers other than Visual Studio .Net 2003 (mainly MinGW and the free MS
tools).
>

That would be good.   But is using VC++ 6.0 right out?  As it stands, I can
no longer
build extensions that will run with a standard dot-net Python 2.4 release.
Or at least I don't
know how.  And if I build 2.4 under VC++ 6.0 and distribute that around the
company, it's not
clear to me if  we can then use new third party extensions.  Some
documentation
clearing it all up would be very helpful.  Maybe it exists somewhere
already.  This is
a Microsoft problem, not a Python problem.

Like I said, dirty rotten shame.

Thinking it over, I'm wondering why the Python crowd went with dot-NET in
the first place.
Surely the world would be a better, happier place without MS jerking
everyone around.
We work our fingerprints to the bone writing code to make their stinking
little OS do something
useful, and what have they ever given us in return? -- Besides the
aquaducts?

Jive



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


New versions breaking extensions, etc.

2004-12-10 Thread Jive
Can someone explain to me why Python 2.4 on MS Windows has these backward
compatibility problems?  What am I missing?  Why won't extensions compiled
to run with 2.3 also work with 2.4?  Why does it matter whether a component
was compiled with VC++ 6.0 or 7.1?  I've been using MS stuff for 6 years.
Before I started using Python, I don't remember ever having a program tell
me I had to use an OLDER version of something to make the program work.
Newer, maybe, but older, never.   I had to revert to Python 2.3 because I
have applications that will not run under Python 2.4.

Although I have been a full-time software developer since the late 70's, I
don't know much about Microsoft stuff.  (Amazing trick that, eh?) But I've
been reading some things on the MS web pages that say dot-NET and all that
should NOT break existing stuff.
http://msdn.microsoft.com/library/en-us/vclib/html/_crt_c_run.2d.time_libraries.asp
 I
don't pretend to understand it all, but certainly one would not expect MS to
screw things up too badly on purpose.  The value of MS Windows lies in the
applications that it can run.  That's part of the genius of the Evil Genius.
He understood when others didn't that when Joe Blow in his basement develops
a program to run under MS Windows, Joe Blow is making money for the E.G.,
and it doesn't cost the E.G. a penny.

In my own small domain,  I cannot even consider coming out with new releases
that are not drop-in replacements for what went before.  Customers won't go
for it.   It's an absolute deal-breaker.

What puzzles me is that, apparently, the incompatibility of Python 2.4 and
extensions built for 2.3 did not come as a nasty surprise.  I get the
impression that it was expected.  Can someone explain that to me?

I hope this doesn't sound like I'm complaining.  I think Python is great.
And the price can't be beat!


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


VC++ 6.0 and 2.4

2004-12-09 Thread Jive
Theoretically, if I messed around with the 2.4 project until I got it to
build under MS VC++ 6.0, would the python.exe play correctly with version
2.4 .pyd extensions?



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


wxPython bug

2004-12-08 Thread Jive
Anyone know what's up with this, and how to fix it?

(I'm running MS Windows 2000 Pro, SP 4)

In wxPython 2.5, run the demo, samples/wxProject/wxProject.py

Create a new project and add a file to it.  In the console window you will
probably
see something like this:

^^
Traceback (most recent call last):
  File "C:\Python23\Lib\site-packages\wxPython2.5 Docs and
Demos\samples\wxProje
ct\wxProject.py", line 224, in OnFileAdd
self.project_save()
  File "C:\Python23\Lib\site-packages\wxPython2.5 Docs and
Demos\samples\wxProje
ct\wxProject.py", line 137, in project_save
(child,iter) = self.tree.GetFirstChild(self.root,iter)
  File "C:\PYTHON23\Lib\site-packages\wx-2.5.3-msw-ansi\wx\_controls.py",
line 5
235, in GetFirstChild
return _controls_.TreeCtrl_GetFirstChild(*args, **kwargs)
TypeError: TreeCtrl_GetFirstChild() takes exactly 2 arguments (3 given)
^

In the source code _controls.py, the comments say the file was created by
SWIG.

What to do?





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


Re: Upgrading Python Article

2004-12-07 Thread Jive
I had to back out of 2.4.  In time I'll upgrade.

It's not really fair to blame windoze for the incompatibility.  It is
possible to make software backward compatible with shared libraries.  But
you need a plan.  The windoze plan is based on  COM in its various guises.
Of course, it's not standard outside of the windoze world.

D.

"Michael Foord" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> http://www.voidspace.org.uk/python/articles/upgrading_python.html
>
> I've been looking at whether to upgrade immediately from Python 2.3 to
> Python 2.4 or postpone it. This is my first `major version change`, so
> I've come up against the usual windoze (tm) problem - upgrading python
> breaks all my extension modules.
>
> I've been looking into the issues, what modules do I use, can I
> compile them myself ? etc... and the result is a brief article on the
> issues round upgrading.
>
> I thought I would share (awww aint that nice).
>
> Flames welcomed.
>
> Regards,
>
>
> Fuzzy
>
> http://www.voidspace.org.uk/atlantibots/pythonutils.html


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


Same-O with ActiveState 2.3.4

2004-12-03 Thread Jive
I installed ActivePython2.3.  It does the same thing.

I am wondering if I have a corrupted MS Windows DLL somewhere.  If so, is
there any chance I can figure out which one it is?

Jive


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


Re: pythonwin broke

2004-12-03 Thread Jive
Do an experiment for me.  Open Pythonwin from the start menu.  Use the FILE
menu to open a .py file.  Now try to close the window you just opened using
the X button in the upper right.  Did it close?  Try closing Pythonwin using
its X button.



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


Re: pythonwin broke

2004-12-03 Thread Jive

"Jean Brouwers" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> We just went through a similar install-uninstall-reinstall cycle with
> Python 2.4 and 2.3 on Windows XP SP2.  Just uninstalling 2.4 and
> reinstalling 2.3 was not sufficient.
>
> It took several attempts to get things back to the original 2.3
> configuration.  After unininstalling both, we deleted all Python
> related entries in the Registry and in the StartUp folder.  Only after
> that did the reinstalled 2.3 plus extensions work fine again.

I've done that, but without success.  Which versions of 2.3 and Pythonwin
did you use?

Jive


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


Re: pythonwin broke

2004-12-03 Thread Jive

"Steve Holden" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>. You might consider
> asking on the python-win32 list, which is more specifically directed at
> Mark Hammond's stuff.

Okay.  How do I find the python-win32 list?  It's not a newsgroup,
apparently.



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


pythonwin still broke

2004-12-03 Thread Jive
I uninstalled Python and Pythonwin.  I verified that there was nothing left
in the registry or the startup folder.  I reinstalled Python using
Python-2.3.4.exe and Pythonwin using win32all-163.exe.

It's still broke.

The shortcut in the startup folder says

Target: C:\Python23\Pythonwin.exe
Start in: C:\Python23\lib\site-packages

When I open Pythonwin that way, once I open a file from the File menu, the
menu buttons on the new window and on the main Pythonwin frame become
inoperable.

I can keep that from happening by changing the Target to
C:\Python23\lib\site-packages\pythonwin\start_pythonwin.pyw.  (Just a wild
guess on my part.)  But then there's a different problem.  When I try to run
a module, I get the message,


Traceback (most recent call last):
  File
"C:\PYTHON23\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py",
line 307, in RunScript
debugger.run(codeObject, __main__.__dict__, start_stepping=0)
  File "C:\PYTHON23\lib\site-packages\Pythonwin\pywin\debugger\__init__.py",
line 60, in run
_GetCurrentDebugger().run(cmd, globals,locals, start_stepping)
  File "C:\PYTHON23\lib\site-packages\Pythonwin\pywin\debugger\__init__.py",
line 35, in _GetCurrentDebugger
_CheckNeedGUI()
  File "C:\PYTHON23\lib\site-packages\Pythonwin\pywin\debugger\__init__.py",
line 21, in _CheckNeedGUI
pywin.framework.app.CreateDefaultGUI(dbgpyapp.DebuggerPythonApp)
  File "C:\PYTHON23\lib\site-packages\Pythonwin\pywin\framework\app.py",
line 392, in CreateDefaultGUI
appClass().InitInstance()
  File "C:\PYTHON23\lib\site-packages\Pythonwin\pywin\debugger\dbgpyapp.py",
line 33, in InitInstance
win32ui.LoadStdProfileSettings(numMRU)
win32ui: The profile settings have already been loaded.


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


Re: installing 2.4

2004-12-02 Thread Jive

"Jeff Shannon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Jive wrote:
>
> >As for checking the "application path",  I don't know what that means.
> >
> >
>
> Go to a command prompt, and type 'echo %path%'.  You'll see a list of
> all the directories that Windows looks in to find an executable -- i.e.,
> if you type 'python', Windows will work through this list of directories
> looking for a program named 'python', and will execute the first one it
> finds.  If you want 2.3 to be your default Python version, then you
> should have 'C:\Python23\.' somewhere near the front of this list.  If
> 'C:\Python24\.' is first in the list, then you may be running the wrong
> version of Python.

It now has Python22 in the path!  How do I change that?  I just now
re-installed 2.3 BTW.


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


Re: installing 2.4

2004-12-02 Thread Jive

"David Bolen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> "Jive" <[EMAIL PROTECTED]> writes:
>
> > It's only getting worse.  I went to Add/remove programs and removed 2.4.
> > Now Python 2.4 numarray and Python 2.4 pywin extensions are still listed
as
> > installed, but I cannot remove them.
>
> You mentioned in your first post about "copying your site package"
> ... did you actually make a copy or did you perhaps "move" your
> site-packages directory from beneath 2.3 to under 2.4.  If so, then
> the uninstall entry in the registry is not going to find the files to
> be able to uninstall them.

I copied, not moved;

>
> Worst case you should be able to reinstall Python 2.3, and your
> extension packages from their installer images.  Don't worry about the
> uninstall list in Add/Remove programs as reinstalling the packages
> will just update their entries.  That will refresh the files in your
> Python 2.3 tree, and providing you don't disable the option, should
> re-establish file associations and what not back to a 2.3
> installation.
>

I've re-installed it, but things are all screwed up still.


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


pythonwin broke

2004-12-02 Thread Jive
I've un-installed Python 2.4, re-installed Python 2.3 and PythonWin for 2.3,
but it's still broke.

When I start PythonWin, sometimes it looks like it is going to be okay.  But
as soon as I open a .py file, the interactive window grabs the focus and
will not let go.  I am stumped.

Is there something PythonWin uses that I could try re-installing?  WxPython
maybe?


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


Re: installing 2.4

2004-12-02 Thread Jive
It's only getting worse.  I went to Add/remove programs and removed 2.4.
Now Python 2.4 numarray and Python 2.4 pywin extensions are still listed as
installed, but I cannot remove them.


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


Re: installing 2.4

2004-12-02 Thread Jive
I am befuddled.  I've re-installed everything I can think of, but I still
get this behavior:  I start up Pythonwin.  Sometimes the interactive window
shows the copyright stuff; sometimes it doesn't;  In any case, I can't close
it by clicking on the X button at the top right of the main window.  The
interactive window seems to have the focus monopolized.  I have to go to the
task manager to kill it.

As for checking the "application path",  I don't know what that means.

I am rather disappointed with this turn of events.


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


Re: installing 2.4

2004-12-02 Thread Jive
Well ain't that a kick in the pants?

Version 2.3 is broke now, so I'm kind of stuck.  I haven't found a 2.4
version of Numeric.  Do you know where to find one?


"Peter Hansen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Jive wrote:
> > I just now installed 2.4.  I naively copied my site-package from 2.3.
The
> > first program I tried to run, which uses the gnuplot package, got this
> > error, complaining about module Numeric:
> >
> > ImportError: Module use of python23.dll conflicts with this version of
> > Python.
> >
> > Grumble: Why does Numeric reference a module by release number?
> >
> > My real question is, what all do I have to do in order to get the
programs I
> > ran under 2.3 to work with 2.4?
>
> Install all new versions (compatible with 2.4) of any *extension
> modules* that you are using, such as Numeric.  Only pure Python
> code can run without change on a newer interpreter.  Anything
> that has a .pyd or .so file (i.e. dynamic libraries, containing
> C code that follows the Python extension API conventions) must
> be recompiled for the new version.
>
> -Peter


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


Re: installing 2.4

2004-12-02 Thread Jive
Correction.  It still runs under 2.3.  However, Pythonwin now doesn't work
right under 2.3.  The interactive window grabs the cursor and won't let it
go.  I have to go to the task manager to kill Pythonwin.


"Jive" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I just now installed 2.4.  I naively copied my site-package from 2.3.  The
> first program I tried to run, which uses the gnuplot package, got this
> error, complaining about module Numeric:
>
> ImportError: Module use of python23.dll conflicts with this version of
> Python.
>
> Grumble: Why does Numeric reference a module by release number?
>
> My real question is, what all do I have to do in order to get the programs
I
> ran under 2.3 to work with 2.4?
>
>


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


Re: installing 2.4

2004-12-02 Thread Jive
Gack!  I can't run it under 2.3 anymore either!  Dag nab it!


"Jive" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I just now installed 2.4.  I naively copied my site-package from 2.3.  The
> first program I tried to run, which uses the gnuplot package, got this
> error, complaining about module Numeric:
>
> ImportError: Module use of python23.dll conflicts with this version of
> Python.
>
> Grumble: Why does Numeric reference a module by release number?
>
> My real question is, what all do I have to do in order to get the programs
I
> ran under 2.3 to work with 2.4?
>
>


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


installing 2.4

2004-12-02 Thread Jive
I just now installed 2.4.  I naively copied my site-package from 2.3.  The
first program I tried to run, which uses the gnuplot package, got this
error, complaining about module Numeric:

ImportError: Module use of python23.dll conflicts with this version of
Python.

Grumble: Why does Numeric reference a module by release number?

My real question is, what all do I have to do in order to get the programs I
ran under 2.3 to work with 2.4?


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


Re: A lock that times out but doesn't poll

2004-11-29 Thread Jive

"Peter Hansen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Jive wrote:
> > Oh, there will be no bugs.
>
> ??  What kind of a statement is that?

Humorous?  Imagine Carl Spackler in Caddy Shack saying, "Oh, there will be
no money."

> Seriously, why are you so confident about that?  Even if
> the code were trivial, we're talking *threads* here...
>

Two reasons:

1) I just know I can do it.  Argue with *that* logic!

B) Writing bug-free code is quite possible when the job is well-defined and
"from scratch."
It's when you have to modify a mess that it gets tricky.

I think a lot of programmers would be capable of writing bug-free code if
they just knew
it was possible and believed they could do it.  My programmers submit very
few bugs.

I've made some bugs in my day, but the odds are with me on this one.

But enough about me...  Read any good books lately?




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


Re: A lock that times out but doesn't poll

2004-11-28 Thread Jive
Dang.  I forgot the line-wrap again.  Sorry about that.



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


Re: A lock that times out but doesn't poll

2004-11-28 Thread Jive

"Peter Hansen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Python, of course, is unsuitable for many hard realtime systems,
> and if you're using Windows you are probably on the wrong platform
> in the first place.

Well, there is that.  The platform I'm using is a realtime operating system,
but it has a Windoze lookalike
API for OS functions like threads, semaphores, critical sections, events,
and whatnot.

[OT]
 I don't draw any distinction between "soft" and "hard" realtime. I've never
seen definitions for
those terms that I thought  were useful.  If some operations must be
performed within a certain time
window, to me that's realtime, neither hard, soft, smooth, lumpy, or just
right.  A realtime operating
system has guaranteed latency. Depending on the application, it does not
necessarily have
to be fast.  I have an application that runs fine on a realtime OS, but
fails eventually under MS Windows
running on a processor that's 3x as fast.
[/OT]

> The bar for putting things in the main distribution should be
> very, very high.

Agreed.  IMHO the bar was not set high enough for the current threading
module.

> One of the conditions for doing that should
> probably be that the code is fairly widely used and widely
> required.

Why?  If the existing code could be better, why not improve it?

>
> Why not post it to an appropriate "recipe" page in the fledgling
> Agile Control Forum site instead?  (http://www.engcorp.com/acf)
> That way others who *do* work in the machine control field will
> have an early chance to try out your code, experiment, maybe
> even improve it, fix bugs,

Oh, there will be no bugs.

> and basically do some of the work that
> *should* be done before anything gets into the main Python distro...
>

I will give it a look.  I had some spare time last year when I volunteered
the first
time.  I don't have spare time now, and probably will not have before May at
the earliest..
If someone would like to take over the code, I would be happy to contribute
it and give
as much help as I can.

Jive



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