Re: [python-win32] Possible future direction for PyGUI on Win32

2011-03-01 Thread Michael Foord
On 1 March 2011 07:44, Octavian Rasnita orasn...@gmail.com wrote:

 From: Greg Ewing greg.ew...@canterbury.ac.nz

 Octavian Rasnita wrote:

 From: Greg Ewing greg.ew...@canterbury.ac.nz

  No, if I go this way, I would probably stop maintaining
 the current implementation.


 Oh, in that case imho I think this is a very bad idea.


 Can you elaborate on exactly what is bad about it, and
 suggest an alternative?


 Windows Forms - based apps have a few disadvantages:
 - First, the most important, and with no solution is that Win32 GUI widgets
 are much fast responsive than Windows Forms,



I've written (quite large) desktop Windows Forms applications with .NET and
just not found this to be the case - even when written with IronPython which
isn't the fastest .NET language there is.



 and it is annoying to use Windows Forms - based apps with the keyboard;


This need not be the case. You just need to set tab order and provide
shortcuts.


 - Second, it is harder to create executables that include the support for
 DotNet, because it is not sure that DotNet is available.


.NET is pretty ubiquitous these days - see other emails on the topic.



 The package should be either very big and include DotNet,


Definitely not.


 or it should detect if it is not present and offer the possibility of
 downloading it from the web, but some computers are not connected to the
 internet...;


Installers can detect this and provide a link.


 - Windows Forms offer very many accessibility features for screen readers,
 however this GUI is *always* less accessible than the standard Win32 widgets
 for those who need to use a screen reader.


Evidence for this?



 - I think there are solutions for making Windows Forms - based apps
 already, and they can be used if somebody prefers to use this GUI, so it
 wouldn't be a good idea to dupplicate it and offer the same interface.


The point is for writing *cross platform* applications that just happen to
use Windows Forms on Windows.

All the best,

Michael Foord





 The standard Windows GUI API is severely crippled compared
 to what is available natively in Cocoa and Gtk. The only
 alternatives I see at the moment are:

 * Allow Windows to hold back the development of PyGUI on
 all the other platforms.

 * Implement the missing functionality on Windows in pure
 Python -- a lot of work, and probably not practical for
 something complex such as a rich text or HTML widget.

 * Rely on a third party library to supply the missing
 functionality on Windows.

 --
 Greg




 I don't know which of these ways would be the most simple to implement, but
 it is true that it will be more difficult, because I've seen how these
 problems were solved in other GUIs like wxWIDGETS and SWT.

 wxWIDGETS offers custom widgets for those which are not offered by the
 standard Win32 API, but most of them are badly made with no corresponding
 accessibility features, and if those widgets are used in an application,
 they could steal the focus or make other problems that make the whole
 application not accessible for those who use a screen reader.
 So a better solution than the one offered by wxWIDGETS would mean much more
 work.

 In SWT, as far as I know, those widgets which are not offered by the Win32
 API are not offered at all, but I am not sure, so others who may know more
 can comment. But if this is true, this is not an extraordinary solution
 either.

 However, I don't know if the focus should be to offer all the possible
 widget types under all platforms, because now there are more and more
 platforms considered, like different kind of PDAs and mobile phones, and it
 would probably be very hard or impossible to offer a GUI that can do
 everything everywhere.

 Octavian






 ___
 python-win32 mailing list
 python-win32@python.org
 http://mail.python.org/mailman/listinfo/python-win32




-- 

http://www.voidspace.org.uk/

May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
-- the sqlite blessing http://www.sqlite.org/different.html
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Possible future direction for PyGUI on Win32

2011-02-28 Thread Michael Foord
On 28 February 2011 05:01, Vernon Cole vernondc...@gmail.com wrote:

 Hmmm... projects get abandoned for many reasons.

 Michael:
   In your professional opinion would it be worthwhile to
 clone/fork/resurrect the pythonnet project, or is it a bad idea better left
 dead?



Python.NET is a great project.

Michael



 --
 Vernon


 On Sun, Feb 27, 2011 at 1:38 PM, Michael Foord fuzzy...@gmail.com wrote:



 On 26 February 2011 20:31, Greg Ewing greg.ew...@canterbury.ac.nzwrote:

 Until recently I didn't think it was possible to use .NET
 libraries from CPython, but then I came across this:

 http://pythonnet.sourceforge.net/

 Using this, it looks like it should be possible to create
 a PyGUI implementation based on Windows Forms. This has the
 potential to solve a number of headaches, as it appears
 to be a considerably more capable library than base win32.

 The downside is that 2k and XP users may need to install
 a .NET runtime. How would people feel about that?


 Python.NET is currently not maintained.

 Michael Foord


  --
 Greg
 ___
 python-win32 mailing list
 python-win32@python.org
 http://mail.python.org/mailman/listinfo/python-win32




 --

 http://www.voidspace.org.uk/

 May you do good and not evil
 May you find forgiveness for yourself and forgive others



 May you share freely, never taking more than you give.
 -- the sqlite blessing http://www.sqlite.org/different.html



 ___
 python-win32 mailing list
 python-win32@python.org
 http://mail.python.org/mailman/listinfo/python-win32





-- 

http://www.voidspace.org.uk/

May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
-- the sqlite blessing http://www.sqlite.org/different.html
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Possible future direction for PyGUI on Win32

2011-02-27 Thread Michael Foord
On 26 February 2011 20:31, Greg Ewing greg.ew...@canterbury.ac.nz wrote:

 Until recently I didn't think it was possible to use .NET
 libraries from CPython, but then I came across this:

 http://pythonnet.sourceforge.net/

 Using this, it looks like it should be possible to create
 a PyGUI implementation based on Windows Forms. This has the
 potential to solve a number of headaches, as it appears
 to be a considerably more capable library than base win32.

 The downside is that 2k and XP users may need to install
 a .NET runtime. How would people feel about that?


Python.NET is currently not maintained.

Michael Foord


 --
 Greg
 ___
 python-win32 mailing list
 python-win32@python.org
 http://mail.python.org/mailman/listinfo/python-win32




-- 

http://www.voidspace.org.uk/

May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
-- the sqlite blessing http://www.sqlite.org/different.html
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] EuroPython 2010 - Open for registration and reminder of participation

2010-03-16 Thread Michael Foord
EuroPython 2010 - 17th to 24th July 2010

EuroPython is a conference for the Python programming language
community, including the Django, Zope and Plone communities. It is
aimed at everyone in the Python community, of all skill levels, both
users and programmers.

Last year's conference was the largest open source conference in the
UK and one of the largest community organised software conferences in
Europe.

This year EuroPython will be held from the 17th to 24th July in
Birmingham, UK. It will include over 100 talks, tutorials, sprints and
social events.

Registration

Registration is open now at: http://www.europython.eu/registration/

For the best registration rates, book as soon as you can! Extra Early
Bird closes soon, after which normal Early Bird rate will apply until
10th May

 Talks, Activities and Events

Do you have something you wish to present at EuroPython? You want to
give a talk, run a tutorial or sprint?
Go to http://www.europython.eu/talks/cfp/ for information and advice!
Go to http://wiki.europython.eu/Sprints to plan a sprint!

Help Us Out
---
EuroPython is run by volunteers, like you! We could use a hand, and
any contribution is welcome.
Go to http://wiki.europython.eu/Helping to join us!
Go to http://www.europython.eu/contact/ to contact us directly!

Sponsors

Sponsoring EuroPython is a unique opportunity to affiliate with this
prestigious conference and to reach a large number of Python users
from computing professionals to academics, from entrepreneurs to
motivated and well-educated job seekers.
http://www.europython.eu/sponsors/

Spread the Word
---
We are a community-run not-for-profit conference. Please help to
spread the word by distributing this announcement to colleagues,
project mailing lists, friends, your blog, Web site, and through your
social networking connections. Take a look at our publicity resources:
http://wiki.europython.eu/Publicity

 General Information
---
For more information about the conference, please visit the official
site: http://www.europython.eu/

Looking forward to see you!
The EuroPython Team

-- 
http://www.ironpythoninaction.com/
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Distutils changes broke pywin32 build

2009-05-19 Thread Michael Foord
Distutils is undergoing heavy changes in the hands of Tarek Ziade. One of
the changes is drastically improving the test coverage.

I would definitely discuss the problem with him (directly or on
distutils-sig) as he will want to know about it - either to explain why the
change is necessary and help you modify the pywin32 setup.py or to revert
the change.

Michael Foord

2009/5/19 Tim Golden m...@timgolden.me.uk

 Something in the changes to build_ext.py in r72585 has broken the setup.py
 build for pywin32:


 http://svn.python.org/view/python/trunk/Lib/distutils/command/build_ext.py?r1=72531r2=72585pathrev=72585

 The symptom is that pywintypes.lib is created in the
 build directory, but distutils is then looking to
 copy pywintypes27.lib (note the version suffix):

 error: can't copy
 'build\temp.win32-2.7\Release\win32\src\pywintypes27.lib': doesn't exist or
 not a regular file

 The error is also present in the release26-maint branch.

 I've just started to try to work out where exactly the problem
 lies and whether it's an ill-tested distutils change or a false
 assumption in the pywin32 setup.py. Or something else.

 Since distutils is a notorious maze of twisty modules, all alike,
 and since the pywin32 setup.py is hardly a model of simplicity,
 if anyone has immediate insights I'd be glad to hear them.

 Thanks

 TJG
 ___
 python-win32 mailing list
 python-win32@python.org
 http://mail.python.org/mailman/listinfo/python-win32




-- 
http://www.ironpythoninaction.com/
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] IronPython in Action Out!

2009-04-10 Thread Michael Foord
Hello all,

*Finally* IronPython in Action is out. This is the first English language
book on IronPython and is now in stock with Manning and Amazon.com and on
the Safari bookshelf. You can get all the details from:

* http://www.ironpythoninaction.com

It covers a whole range of topics, with introductions to Python and .NET,
using various Python libraries and .NET framework classes, web development
with ASP.NET, Silverlight and web services, plus topics like WPF, testing,
metaprogramming, system administration, embedding IronPython in .NET
applications and so on.

The foreword is by Jim Hugunin and Dino Viehland is the technical editor.

Many thanks to all those who helped, including those who gave feedback
during the early access program.

All the best,

Michael Foord

-- 
http://www.ironpythoninaction.com/
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] IronPython at PyCon 2009

2009-01-31 Thread Michael Foord
(Slightly off-topic, sorry.) The talk schedule has gone up for for PyCon
2009 in Chicago. There are three talks on IronPython, plus a tutorial on the
Wednesday before the conference.

The conference dates are:

   * March 25-26th Tutorial Days
   * March 27-29th Conference
   * March 30th - April 2nd Development Sprints

Jim Hugunin is one of the invited speakers, so his talk doesn't yet appear
on the schedule - but his usual talk is IronPython the Road Ahead.

I've blogged about all the talks, plus the tutorial that Jonathan Hartley
and I will be giving, on IronPython URLs.

http://ironpython-urls.blogspot.com/2009/01/ironpython-at-pycon-2009.html

All the best,


Michael Foord

-- 
http://www.ironpythoninaction.com/
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] IronPython Tutorial at PyCon UK

2008-07-29 Thread Michael Foord
Hello all,

September 12-14th at the Birmingham Conservatoire is the 2nd UK Python
Conference, organised by the UK Python community.

This year the conference starts with a tutorial day, and Christian Muirhead
[#]_, Menno Smits and I will be running a half day IronPython tutorial. The
tutorial day is only £30, so if you're interested in learning about
IronPython it is an ideal opportunity.

Tutorials: http://www.pyconuk.org/timetable.html
Currently accepted talks: http://www.pyconuk.org/talk_abstracts.html
Booking: http://www.pyconuk.org/booking.html

Details on a summary of the accepted talks and tutorials on my blog.
http://www.voidspace.org.uk/python/weblog/arch_d7_2008_07_26.shtml#e996

Thanks

Michael Foord

.. [#] Christian and I are the authors of the nearly published IronPython in
Action with Manning Publications.

-- 
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/
http://www.trypython.org/
http://www.ironpython.info/
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Running Python + pywin32 portably

2008-07-04 Thread Michael Foord

Paul Moore wrote:

On 04/07/2008, Michael Foord [EMAIL PROTECTED] wrote:
  

Movable Python comes with the Pywin32 extensions.

http://www.voidspace.org.uk/python/movpy/



Thanks. Does that mean that out of the box pywin32 works portably, or
were changes needed for Movable Python? (I don't want to use Movable
Python itself, for reasons that aren't really relevant here).

Paul.
  
I can't remember the precise hacks I needed to make. I think that was 
more to do with getting it to work with py2exe rather than anything to 
do with being portable.


It is certainly worth *trying* portably and seeing what problems you 
encounter - I *Suspect* they will be minimal.


Michael Foord

--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/
http://www.trypython.org/
http://www.ironpython.info/
http://www.resolverhacks.net/
http://www.theotherdelia.co.uk/

___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Request for comments - the spaces issue

2008-05-24 Thread Michael Foord

Dahlstrom, Roger wrote:
Ha - you'd hate my code then.  I like a lot of spaces, makes it easier for me to keep the blocks seperated. 
  


I'm afraid that I abhor them. :-)

Michael Foord
http://www.ironpythoninaction.com/

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Golden
Sent: Saturday, May 24, 2008 4:28 AM
Cc: Python-Win32 List
Subject: Re: [python-win32] Request for comments - the spaces issue

[bob gailer]
  
Please omit the space before ( in code. I find that very distracting. 
Example:


print result.Properties_ (sValue).Value # current

print result.Properties_(sValue).Value # preferred, and how most 
code I've seen looks.
  


[Tim Roberts]
  
Do you understand that this is strictly a personal preference?  Some 
people like it, some people don't.  You are certainly allowed to 
prefer one over the other, but it's a bit much to ask someone else to 
change their coding style to match yours, unless you are a paying 
client.  ;)



[Roger Dahlstrom]
  
I'd add to that that I prefer the space, and I only use notepad++ for 
coding.  Everything worked fine for me.



On balance I'm inclined to stick to my spaces-before style, not
least because I've been coding that way for well over 20 years
and it's not that easy to change, even if I felt well-disposed.
(Which I don't :) )

Apologies to Bob  anyone else who finds this style irksome. As
you might imagine, I find the opposite style cluttered and hard
to read. Likewise I imagine there are many who find my two-spaces
indent style cluttered while I find even four and certainly any
more to be grotesquely elongated.

TJG

___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


DISCLAIMER:
This e-mail, and any attachments thereto, is intended only for use by the 
addressee(s) named herein and
may contain legally privileged and/or confidential information. If you are not 
the intended recipient
of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and 
any attachments thereto, is strictly prohibited. If you have received this in error, please immediately notify 
me and permanently delete the original and any copy of any e-mail and any printout thereof. 
E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept 
liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission.


NOTICE REGARDING PRIVACY AND CONFIDENTIALITY
Direct Edge ECN LLC may, at its discretion, monitor and review the content of 
all e-mail communications.

www.directedge.com
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32
  


___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Request for comments - the spaces issue

2008-05-24 Thread Michael Foord

bob gailer wrote:

Tim Golden wrote:

[snip]



Likewise I imagine there are many who find my two-spaces
indent style cluttered while I find even four and certainly any
more to be grotesquely elongated.


I also prefer the 2 space indent!

I also realize that when I wrote my previous reply I was not conscious 
that I was replying to the original post. So I referred to you as Tim. 
Sorry for that.




Four spaces is useful so that anything more than a few levels 
indentation really *is* too elongated - it is a good sign that you need 
to refactor your code. :-)


Dropping to two space indent isn't a good way of solving the problem. ;-)

FWIW Guido remarked a while ago that all of google's Python code is two 
space indented.


Michael Foord
http://www.ironpythoninaction.com/
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Request for comments

2008-05-22 Thread Michael Foord

Hello Tim,

That looks really good!

Michael

Tim Golden wrote:

I have a request of the python-win32 community. Have a look at:

http://timgolden.me.uk/python-on-windows/

In particular, click through to the section on the Registry (which is 
the only section which has anything useful in it!)

and then tell me what you think. About anything. The contents,
the style, the colours, the colors, the depth of examples, the
notes. What should be there? What shouldn't? How much overlap
there should be with other sources of documentation? How much
should just be links across? Should I reproduce the pywin32 docs
verbatim. (Difficult: I've got a branch which is trying. Very trying).
Anything.

Points to bear in mind:

 * This is very alpha
 * I'm using Sphinx but I've done very little with its capabilities
 * The examples I've put together work: you can drop them straight 
onto an interpreter window and run them. But is that a desirable goal.
 * My intention is that this be a community effort. (The source is 
actually

hosted at Google Code).
 * This URL (probably) won't be its final resting place.

In particular, it will be very clear as you read that I'm 100% sure 
where I'm going with it yet. But at the very least I want lots of 
examples which, even in passing, semi-document the kind of stuff which 
people ask about

on python-win32 and python-list.

Enough babble from me. Have a look.

TJG
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Request for comments

2008-05-22 Thread Michael Foord

Hello Tim,

I posted the link on Twitter, and got a response back asking if there 
would be documentation on deployment - py2exe, PyInstaller etc.


Whilst I doubt you can be expected to be a fount of *all* knowledge, 
perhaps links or summaries of these topics could be good.


Michael Foord
http://www.ironpythoninaction.com/

Tim Golden wrote:

I have a request of the python-win32 community. Have a look at:

http://timgolden.me.uk/python-on-windows/

In particular, click through to the section on the Registry (which is 
the only section which has anything useful in it!)

and then tell me what you think. About anything. The contents,
the style, the colours, the colors, the depth of examples, the
notes. What should be there? What shouldn't? How much overlap
there should be with other sources of documentation? How much
should just be links across? Should I reproduce the pywin32 docs
verbatim. (Difficult: I've got a branch which is trying. Very trying).
Anything.

Points to bear in mind:

 * This is very alpha
 * I'm using Sphinx but I've done very little with its capabilities
 * The examples I've put together work: you can drop them straight 
onto an interpreter window and run them. But is that a desirable goal.
 * My intention is that this be a community effort. (The source is 
actually

hosted at Google Code).
 * This URL (probably) won't be its final resting place.

In particular, it will be very clear as you read that I'm 100% sure 
where I'm going with it yet. But at the very least I want lots of 
examples which, even in passing, semi-document the kind of stuff which 
people ask about

on python-win32 and python-list.

Enough babble from me. Have a look.

TJG
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] Access Denied Errors with IronPython and WMI

2008-04-25 Thread Michael Foord

Hello guys,

I'm writing some examples of using IronPython and WMI to connect to 
computers on the local network. I'm getting some 'access denied' errors 
and wondered if there was anyone on this list who might be able to help me.


If there is then I will post details.

All the best,


Michael Foord
http://www.ironpythoninaction.com/
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Access Denied Errors with IronPython and WMI

2008-04-25 Thread Michael Foord

Roger Upole wrote:

Michael Foord wrote:

Hello guys,

I'm writing some examples of using IronPython and WMI to connect to
computers on the local network. I'm getting some 'access denied' errors
and wondered if there was anyone on this list who might be able to 
help me.


If there is then I will post details.

All the best,


Michael Foord


If the target machine has remote administration disabled, you may get an
Access denied.  Also, there may be custom permissions set on the WMI
namespace.  Do you get the error when trying to connect, or when calling
a particular method ?



Thanks for replying Roger - I'm now away from the office with no access 
to the network. I've had a couple of pointers to investigate the 
permissions on the target machine.


I'll try this on Monday and see how far I get.

Michael


Roger


___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Iron Python and Visual Basic 2005 (or 2008) Express

2008-03-04 Thread Michael Foord
Dick Moores wrote:
 Years ago I learned a bit of Visual Basic (VB6,
 IIRC) at a community college. About a year ago I
 downloaded the free Visual Basic 2005 Express
 (http://www.microsoft.com/express/vb/Default.aspx),
 but didn't do much with it.

 But I was wondering if it was possible to write
 Python code in Iron Python and use it somehow in
 Visual Basic 2005 (or 2008) Express. VB seemed a very easy
 way to create a GUI, but of course I prefer Python for the code.

 So, possible/impossible/impractical/foolish/Pythonically_traitorous?
   

Your question as phrased doesn't actually mean a great deal. :-)

Do you want to code with Python or with VB? (They are different 
languages and you can't just mix them in the same source files - well 
you can actually but not in the way you mean I think...)

This sort of question would be much better directed to the IronPython 
mailing list by the way:
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Do you actually mean can you use IronPython with Visual Studio 
Express? If so, the answer is not really. But you can use IronPython 
to create any sort of application that you can with VB.

A good place to start is with the Early Access program for IronPython 
in Action:
http://www.manning.com/foord

Michael


 Thanks,

 Dick Moores

 ___
 python-win32 mailing list
 python-win32@python.org
 http://mail.python.org/mailman/listinfo/python-win32
   

___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Is Mark Hammond going to produce a new Python Programming on Win32 book?

2008-02-27 Thread Michael Foord
Tim Roberts wrote:
 Michael Foord wrote:
   
 Tim Roberts wrote: 
 
  
 Well, there's an interesting issue here.  Much of the new stuff you 
 have mentioned has nothing to do with the Python that we know and 
 love.  .NET and winforms (which is part of .NET) requires managed 
 code, and that means IronPython.  IronPython is NOT the same as 
 Python; although the language is the same, the library and the 
 idiomatic usage are so very different that it's difficult for one 
 person to be competent in both.

   
   
 Hmmm... that hasn't been my experience. Programming IronPython with 
 idiomatic Python works very well.
 

 Perhaps the issue is more than I'm not comfortable with idiomatic .NET.  
 I did take a semi-serious stab at working with WPF in IronPython, but it 
 just wasn't comfortable.

 I am very pleased to see that an IronPython book is in the works.  
 Because I think WPF is one of the most exciting things to come out of 
 Microsoft in a very long time, I will be among the first in line.

   
Ok. Personally I have found that I can still *basically* use idiomatic 
Python when working with .NET classes. The exception is when optimizing 
as the performance profiles of IronPython vs CPython are very different.

advertThe IronPython Book is already available in early access 
preview form and the WPF chapter will appear in the preview in the next 
couple of weeks or so - http://www.manning.com/foord /advert

Michael

___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Is Mark Hammond going to produce a new Python Programming on Win32 book?

2008-02-27 Thread Michael Foord
Tim Roberts wrote:
 happybrowndog wrote:
   
 I've had Mark's Python Programming on Win32 book for 6 years now, and 
 it's been a constant source of information and a joy to read and possess.

 Windows has added a lot since the book hit the shelves, with the 
 maturation of .Net, winforms and other application technologies, and a 
 new OS.  There's still the old way of doing things with COM, etc.  The 
 Ctypes package has also fleshed out to be very useful on Windows.  Then 
 there's IronPython, and Python for .Net.
   
 

 Well, there's an interesting issue here.  Much of the new stuff you have 
 mentioned has nothing to do with the Python that we know and love.  .NET 
 and winforms (which is part of .NET) requires managed code, and that 
 means IronPython.  IronPython is NOT the same as Python; although the 
 language is the same, the library and the idiomatic usage are so very 
 different that it's difficult for one person to be competent in both.

   

Hmmm... that hasn't been my experience. Programming IronPython with 
idiomatic Python works very well.

Michael
http://www.manning.com/foord

 Indeed, for things that are not .NET, Mark's book is still pretty much 
 current.

 Perhaps we'll get a book on IronPython to make it a little more 
 approachable for us CPython users.

   

___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] How to get the dynamic parts of the url, with python ?

2008-01-31 Thread Michael Foord
Tova Sirkis wrote:
 urllib2.urlopen(url)   only returns the static part of the url.
 Is it possible, with python, to get the dynamic parts of the url, too? 
 (for example ads)
 If yes, how?

It is possible - although can be difficult as ads are usually fetched 
with Javascript. You can certainly get the javascript though.

I'll give you a clue - how do you think the browser does it when you 
only type the main URL into the address bar...

Michael Foord
http://www.manning.com/foord

 Thanks
 Tova Sirkis 
 

 ___
 python-win32 mailing list
 python-win32@python.org
 http://mail.python.org/mailman/listinfo/python-win32
   

___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] [python] Re: python on visual studio 2008

2008-01-04 Thread Michael Foord
Marcos Pinto wrote:
 thanks, but those are also built with 7.1 and not 2005 or 2008
   

In the Python source (for 2.5) there should be a VS 2005 project. Have 
you tried updating this for VS 2008? (PCBuild8 folder I believe)

Subversion head should be buildable with VS 2008 which will be the 
default for Windows. (PCBuild9 folder I believe)

Michael Foord
http://www.manning.com/foord

 On Jan 4, 2008 3:59 PM, Reedick, Andrew [EMAIL PROTECTED] wrote:
   
 www.activestate.com has pre-built windows binaries for Python.



 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Marcos Pinto
 Sent: Friday, January 04, 2008 4:39 PM
 To: python-win32@python.org
 Subject: [python-win32] python on visual studio 2008

 does anyone know of a third-party which unofficially provides python
 built with visual studio 2008, instead of the official 2003?  i've
 tried to build python myself, but failed, so i was wondering if anyone
 already provides it?
 thanks
 ___
 python-win32 mailing list
 python-win32@python.org
 http://mail.python.org/mailman/listinfo/python-win32

 
 ___
 python-win32 mailing list
 python-win32@python.org
 http://mail.python.org/mailman/listinfo/python-win32

   

___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] sys.stdout.closed missing with win32trace

2007-11-04 Thread Michael Foord
TK Soh wrote:
 It looks like the closed attribute for sys.stderr and sys.stdout are
 missing when win32trace is in effect. Any way to work around this?
   

I have no idea about win32traceutil, but the sys module provides 
sys.__stdout__ and sys.__stderr__ so that even when modules replace the 
streams with custom objects you can still access the originals. This may 
or may not be helpful...

Michael Foord
http://www.manning.com/foord

 python script:
 --
 import win32traceutil
 import sys
 if not sys.stdout.closed:
 print stdout is opened
 --

 Trace collector output:
 --
 Traceback (most recent call last):
   File try.py, line 3, in module
 if not sys.stdout.closed:
 AttributeError: 'PyTraceObject' object has no attribute 'closed'
 ___
 python-win32 mailing list
 python-win32@python.org
 http://mail.python.org/mailman/listinfo/python-win32

   

___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] [python] Re: Writing .NET component in Python

2007-09-06 Thread Michael Foord
Sidnei da Silva wrote:
 Here's the information that I've found:

 http://msdn2.microsoft.com/en-us/library/ms973800.aspx

 So basically you use tlbimp to create a 'Runtime Callable Wrapper' which is 
 a trusted .NET assembly that can call your COM object.

   

IronPython would certainly be a great way to test consuming your COM 
object from the .NET side.

Michael
http://www.ironpython.info/
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] Python Magazine - pywin32

2007-07-04 Thread Michael Foord
Hello all,

There is a new Python magazine just launching:

http://www.pythonmagazine.com

They are looking for articles that will appeal to Windows users, so if 
anyone fancies getting paid to write an article on pywin32 I'm sure they 
will be interested.

Michael Foord
http://www.voidspace.org.uk/ironpython/index.shtml
___
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] SilverLight, a substitute for Python-Active-Scripting in IE?

2007-05-01 Thread Michael Foord
Michel Claveau wrote:
 Hi!

 SilverLight (MS flash killer), is a plug-in for InternetExplorer (Win), 
 FireFox (Win), and Safari (Mac).
 SilverLight is scriptable with Python ( Jscript, and, soon, with Ruby)

 The release 1.1-Alpha come with JScript  Python (or ironPython?)

 See :
 http://www.microsoft.com/silverlight/default.aspx
 http://www.microsoft.com/silverlight/why-compelling.aspx
 http://silverlight.net/Default.aspx
 http://www.microsoft.com/silverlight/install.aspx


 But, I don't had try SilverLight...

 Who had try it?

   

I'm trying to try it now. :-)

Not easy to get it to work...

Fuzzyman
http://www.voidspace.org.uk/ironpython/index.shtml



 @-salutations
   

___
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] C# Vs Python

2007-04-02 Thread Michael Foord
James Matthews wrote:
 I am not asking for a very detailed comparison that i know no one will 
 give i am just wondering for windows development which language would 
 be better? What i mean is GUI apps, interfacing with excel,word and 
 outlook etc..


You can have the best of both worlds with IronPython.

Python is syntactically and semantically more concise than C#, with 
language features like higher order functions, list comprehensions, 
standard polymorphic containers and much more.

IronPython allows you to use .NET classes - and the interface with C# is 
basically seamless (except for .NET attributes).

At Resolver we have a 20 000 line IronPython application (plus around 75 
000 lines of test code) which has just gone to our first customer. I 
highly recommend it - particularly if you have .NET experience.

Where CPython beats IronPython is cross-platform capabilities. On the 
other hand, Windows Forms (.NET) is better than any GUI toolkit I've seen.

Michael Foord
http://www.voidspace.org.uk/ironpython/index.shtml

 Thanks
 James

 -- 
 http://www.goldwatches.com/watches.asp?Brand=39
 http://www.wazoozle.com
 

 ___
 Python-win32 mailing list
 Python-win32@python.org
 http://mail.python.org/mailman/listinfo/python-win32
   

___
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] Pythonwin Problems

2006-12-16 Thread Michael Foord
Hello all,

There are various problems with Pythonwin under Movable Python.

The latest that I have discovered is that Pythonwin fails to bring up 
the find dialog the *second* time you use it. It fails with the 
following traceback :

Traceback (most recent call last):
   File \movpy\lib\pythonwin\pywin\scintilla\view.py, line 349, in 
OnCmdEditFind
 find.ShowFindDialog()
   File \movpy\lib\pythonwin\pywin\scintilla\find.py, line 36, in 
ShowFindDialog
 _ShowDialog(FindDialog)
   File \movpy\lib\pythonwin\pywin\scintilla\find.py, line 53, in 
_ShowDialog
 curDialog.CreateWindow()
win32ui: CreateIndirect failed
win32ui: Error in Command Message handler for command ID 57636, Code 0

Anyone got any clues as to what may be causing this ?

There are a couple of other dialog related failures as well, but I've 
found workarounds for these (so far).

Fuzzyman
http://www.voidspace.org.uk/index2.shtml


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.15.21/589 - Release Date: 15/12/2006

___
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] Python for System Administration

2006-12-12 Thread Michael Foord
Hello all,

Sorry for the intrusion.

I'm working on a book proposal about IronPython, with Manning.

One of the chapters will be about Windows System Administration with 
Python, and will probably include some sections about Powershell. It 
will show how to use the Powershell libraries from IronPython and 
writing Powershell cmdlets with IronPython.

I'd like to also include some sections about 'general' system 
administration tasks (on windows computers and networks) that can be 
achieved with Python.

I'd very much like to hear from anyone who uses Python for sys-admin 
tasks. I'd like to know the sort of tasks you use Python for, and if 
possible see some examples that I can translate into IronPython code.

Feel free to reply on list or privately email me.

Thank you for your indulgence. ;-)

Michael
http://www.voidspace.org.uk/python/index.shtml


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.15.16/582 - Release Date: 11/12/2006

___
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Python for System Administration

2006-12-12 Thread Michael Foord
Simon Dahlbacka wrote:


  Unsurprisingly perhaps, a lot of my recommendations
  involve WMI. Now I've no idea if WMI is still a concept
  under .NET or how it's invoked if it is. At present,
  you use the pywin32 GetObject method to invoke it.
  Is that still possible under IronPython? Or is there
  some -- possibly built-in -- equivalent?
 

 I've not used WMI before (although I've browsed your work before and
 *nearly* used it a few times).

 I assume they are in unmanaged code ?
 
 
 
 ..isn't the stuff in System.Management for WMI things, and thus probably 
 the
 way to look into when wanting to use IronPython ?
 

http://msdn.microsoft.com/msdnmag/issues/02/05/WMIMan/

Looks like it. Thanks.

I should be able to create/translate some good examples from here.

Fuzzy

 regards,
 
 Simon
 
 
 
 
 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.1.409 / Virus Database: 268.15.16/582 - Release Date: 11/12/2006
 



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.15.16/582 - Release Date: 11/12/2006

___
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] Building from Source

2006-11-14 Thread Michael Foord
Hello all,

I have just tried to build the Pywin32 extensions from source - using 
the pywin32-210.zip archive.

I have Visual Studio 2005 installed and have built Pywin32 from source 
before. I'm using Python 2.4 under Windows XP.

The build fails as follows, can anyone suggest a reason ?

C:\Python Binaries\pywin32-210setup.py bdist_wininst
Building pywin32 2.4.210.0
running bdist_wininst
running build
running build_py
creating build
creating build\lib.win32-2.4
creating build\lib.win32-2.4\win32
creating build\lib.win32-2.4\win32\lib
copying win32\lib\afxres.py - build\lib.win32-2.4\win32\lib

[snip ..]

copying isapi\simple.py - build\lib.win32-2.4\isapi
copying isapi\threaded_extension.py - build\lib.win32-2.4\isapi
copying isapi\__init__.py - build\lib.win32-2.4\isapi
running build_ext
Warning - can't find an installed platform SDK
Traceback (most recent call last):
  File C:\Python Binaries\pywin32-210\setup.py, line 1496, in ?
data_files=[('', 
(os.path.join(os.environ['temp'],'pywin32.version.txt'),))
 +
  File C:\Python24\lib\distutils\core.py, line 149, in setup
dist.run_commands()
  File C:\Python24\lib\distutils\dist.py, line 946, in run_commands
self.run_command(cmd)
  File C:\Python24\lib\distutils\dist.py, line 966, in run_command
cmd_obj.run()
  File C:\Python24\lib\distutils\command\bdist_wininst.py, line 107, 
in run
self.run_command('build')
  File C:\Python24\lib\distutils\cmd.py, line 333, in run_command
self.distribution.run_command(command)
  File C:\Python24\lib\distutils\dist.py, line 966, in run_command
cmd_obj.run()
  File C:\Python Binaries\pywin32-210\setup.py, line 359, in run
build.run(self)
  File C:\Python24\lib\distutils\command\build.py, line 112, in run
self.run_command(cmd_name)
  File C:\Python24\lib\distutils\cmd.py, line 333, in run_command
self.distribution.run_command(command)
  File C:\Python24\lib\distutils\dist.py, line 966, in run_command
cmd_obj.run()
  File C:\Python24\lib\distutils\command\build_ext.py, line 279, in run
self.build_extensions()
  File C:\Python Binaries\pywin32-210\setup.py, line 490, in 
build_extensions
self.build_extension(ext)
  File C:\Python Binaries\pywin32-210\setup.py, line 678, in 
build_extension
why = self._why_cant_build_extension(ext)
  File C:\Python Binaries\pywin32-210\setup.py, line 426, in 
_why_cant_build_
xtension
raise RuntimeError, Can't find a version in Windows.h
RuntimeError: Can't find a version in Windows.h

All the best,


Fuzzyman
http://www.voidspace.org.uk/python/index.shtml


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.14.5/533 - Release Date: 13/11/2006

___
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Capturing stdout when running a Python Script

2006-10-27 Thread Michael Foord
David Nicolson wrote:
 This might do what you want to achieve. It seems to make py2exe crash  
 on exit, some file locking error. Works fine otherwise though.

 #!/usr/bin/env python

 import sys

 class LogBuffer:
  def __init__(self):
  pass

  def flush(self):
  sys.__stdout__.flush()

  def write(self,string):
  string = string.strip()
  sys.__stdout__.write(Captured: +string+\n)

 if __name__ == __main__:
  logbuffer = LogBuffer()
  sys.stdout = logbuffer
  print Hello

   
I've written a class called 'StandOut' which does exactly this (plus 
more). It works fine with py2exe.

http://www.voidspace.org.uk/python/standout.html

Michael Foord
http://www.voidspace.org.uk


 On 27/10/2006, at 5:48 PM, Johan Lindvall wrote:

   
 Hi,

 Is there any way of capturing or displaying stdout when running a
 Python script? I know about:

 import sys
 sys.stdout = open(logfile.txt, a)

 but I don't want to modify my scripts to achieve this.

 -- 
 /Johan.
 ___
 Python-win32 mailing list
 Python-win32@python.org
 http://mail.python.org/mailman/listinfo/python-win32
 



 ___
 Python-win32 mailing list
 Python-win32@python.org
 http://mail.python.org/mailman/listinfo/python-win32

   

___
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] Pythonwin

2006-09-18 Thread Michael Foord
Hello all,

I'm trying to get Pythonwin working with Movable Python.

The first step was to try using a pure Python version of the executable. 
(Code reproduced below).

This appears to work (both for installed Python and Movable Python) - 
however their are various minor problems I need to resolve.

I don't mind maintaining a patched version, but would appreciate some 
clues. :-)

The first issue is that the run script dialog doesn't appear- instead 
the file open dialog appears, and re-appears when closed. This happens 
whenever the python version is run - whether from normal Python or 
Movable Python.

I've isolated the problem (well - at least partly) to the 
'scriptutils.py' file.

It is in the line 'if dlg.DoModal() != win32con.IDOK:' (I've messed up 
line numbers sorry) in the 'RunScript' function.

When dlg.DoModal is called, DlgRunScript.OnBrowse is activated somehow...

The Python version of the executable is :

import sys
import win32ui
# importing 'intpyapp' automatically registers an app object.
from pywin.framework import intpyapp

# Remove this script name from sys.argv, else Pythonwin will try and 
open it!
sys.argv = sys.argv[:-1]
# Get the MFC app object and boot it up.
app = win32ui.GetApp()
app.InitInstance()
app.Run()
app.ExitInstance()


All the best,


Michael Foord
http://www.voidspace.org.uk/python/movpy/


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.5/450 - Release Date: 18/09/2006

___
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Pure Python Pythonwin.exe

2006-06-22 Thread Michael Foord
Mark Hammond wrote:
 Pythonwin the IDE has many fans, and I would like to get it
 working with
 Movable Python [#]_.
 

 Great!

   
 Pythonwin is launched with 'pythonwin.exe'. Presumably (I speak from
 ignorance here) this uses the registry to determine the
 installed Python.
 

 Nope - it uses some old code that really should die.

   
 When I run Pythonwin.exe on a computer with no installed Python (but a
 working Movpy setup) I get the message :

 The application can not locate win32ui.pyd (or python) (126)
 The specified  module could not be found.

 This is after putting the Pythonwin directory on the path [#]_ - and
 win32ui.pyd exists in the current directory (same directory as
 pythonwin.exe).
 

 That surprises me.  win32ui.pyd next to pythonwin.exe should work fine -
 that is the first thing checked by the code (which FYI is in
 pythonwin/win32uiHostGlue.h)

   
Maybe a generic error message when it fails to find Python ? Seeing as 
you posted Python code below I lost my motivation to go poking round in 
C++ files. :-)


 I see that the Pythonwin source code is C++, so I guess there
 is no way
 of creating a Pure Python version. :-)
 

 But there is :)

   
This is great, it runs fine with Movable Python. (Although I have yet to 
find a machine *without* Python installed to try it properly, I need to 
get VMWare running again.)

When it runs for the first time it prints the following message to the 
console (but works fine) :

Failed to connect to Pythonwin|System. Error 0

Is this because there is no currently running version of pythonwin for 
it to connect to ?

Anyway, many thanks.

Fuzzyman
http://www.voidspace.org.uk/python/index.shtml


 import sys
 import win32ui
 # importing 'intpyapp' automatically registers an app object.
 from pywin.framework import intpyapp

 # Remove this script name from sys.argv, else Pythonwin will try and open
 it!
 sys.argv = sys.argv[:-1]
 # Get the MFC app object and boot it up.
 app = win32ui.GetApp()
 app.InitInstance()
 app.Run()
 app.ExitInstance()

 The above code should boot a fully functioning Pythonwin - just execute it
 from pythonw.exe and you should be good to go.  The only reason I haven't
 moved to something like this is that (a) pythonwin.exe already exists, and
 (b) having a .exe makes it more obvious to a casual user...

 Cheers,

 Mark


   

___
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32