Python on 10.14 Mojave

2018-10-10 Thread Kevin Walzer
I'm trying to build Python 3.7.0 on macOS 10.14, and Tkinter is not 
linking to my installation of Tcl/Tk 8.6.8 in /Library/Frameworks. 
Instead it is linking to the ancient 8.5 Tk installed in 
/System/Library/Frameworks. My usual way of forcing Python to link to my 
installation is to edit setup.py and comment out all search directories 
except /Library/Frameworks, but that seems to be ignored here. Is there 
any other way to link to the correct frameworks?


--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Linux/Windows GUI programming: GUI-fy a CLI using pyInstaller

2018-01-05 Thread Kevin Walzer

On 1/1/18 11:45 AM, X. wrote:

Ulli Horlacher:

I have to transfer a python 2.7 CLI programm into one with a (simple) GUI.
The program must run on Linux and Windows and must be compilable with
pyinstall, because I have to ship a standalone windows.exe
Any kind of installer is not acceptable.

Reading https://github.com/pyinstaller/pyinstaller/wiki/Supported-Packages
supported GUI packages are PyGTK, PyQt4, PyQt5, wxPython
I have tested tkinter by myself and it works, too.
I do not like GTK and Qt, because they are too complex.

I want to do VERY simple things and I prefer a simple GUI toolkit :-)



me too !



Try easygui:

https://pypi.python.org/pypi/easygui


--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python application launcher (for Python code)

2017-02-20 Thread Kevin Walzer

On 2/19/17 10:01 PM, Deborah Swanson wrote:

I could probably write this myself, but I'm wondering if this hasn't
already been done many times.  Anyone have some git links or other
places to download from?

What do you mean by "application launcher"? It's not more complicated 
than "python my script.py." Run your console of choice on any platform 
that supports Python.


--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: PyDictObject to NSDictionary

2017-02-03 Thread Kevin Walzer

On 2/2/17 6:30 PM, Charles Heizer wrote:

Hello,
I'm embedding python in to my Objective-C app and I need to know how do I 
convert a PyDictObject (PyObject) to a NSDictionary?

Thanks!

Does the PyObjC library provide any support for this? It allows 
integration between the Cocoa API's and Python.


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Label behavior's difference between tkinter and ttk

2016-04-05 Thread Kevin Walzer
In general, the "img.config" syntax is suitable for the classic Tk 
widgets, not the themed ttk widgets. They have a very different (and 
very gnarly) syntax for indicating changed state. I am not inclined to 
see a bug here.


--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Can't load Tkinter in embedded Python interpreter on Windows

2016-04-05 Thread Kevin Walzer

Adding

 PySys_SetArgv(argc, argv);

did the trick.

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Can't load Tkinter in embedded Python interpreter on Windows

2016-04-05 Thread Kevin Walzer
I am trying to build a stub exe on Windows that embeds Python and 
launches my Tkinter app. I want a full-blown exe program starter because 
the various Python freezing tools (py2exe, pyinstaller) do not work to 
my satisfaction with Python 3.5.


I am able to get the executable built but I cannot get it to load 
Tkinter and run. The current error is:


"AttributeError: module 'sys' has no attribute 'argv'"

when called from the Tkinter init method.

Here is my command-line invocation for the compiler:

---
gcc quickwho.c -I 
\C:\Users\kevin\AppData\Local\Programs\Python\Python35\include 
-LC:\Users\kevin\AppData\Local\Programs\Python\Python35\libs 
-LC:\Users\kevin\AppData\Local\Programs\Python\Python35\DLLs -lShlwapi 
-lpython35 -o quickwho.exe



And here is my C stub launcher:

#include 


#include 
#include 
#include 
#include 

int main(int argc, char *argv[])
{

Py_SetProgramName(argv[0]);
Py_Initialize();

 TCHAR exedir [MAX_PATH];


  #if 0
  GetModuleFileName(NULL, exedir, MAX_PATH);
  _tprintf("%s/n", exedir);
  PathRemoveFileSpec(exedir);
  _tprintf("%s/n", exedir);
  #endif

   /*Get the module's full path, and set to the current working 
directory.*/

  if (!GetModuleFileName(NULL, exedir, MAX_PATH)) {

TCHAR errmsg[512];
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,0, 
GetLastError(),0,errmsg,1024,NULL);


_tprintf( TEXT("The path is %s, and the error is %s/n"), exedir, 
errmsg );

  }


  if (!PathRemoveFileSpec(exedir)) {

TCHAR errmsg[512];
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,0, 
GetLastError(),0,errmsg,1024,NULL);
_tprintf( TEXT("The target dir is %s, and the error is %s/n"), 
exedir, errmsg );

  }

  if (!SetCurrentDirectory(exedir)) {

TCHAR errmsg[512];
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,0, 
GetLastError(),0,errmsg,1024,NULL);
_tprintf( TEXT("The working dir is %s, and the error is %s/n"), 
exedir,errmsg );

  }


PyRun_SimpleString("exec(open(\"QuickWho.py\").read())");
Py_Finalize();

return 0;
}

Can anyone suggest what I might do to get Tkinter to load and run my exe?

Thanks,
Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: GitHub's “pull request” is proprietary lock-in

2016-01-03 Thread Kevin Walzer

On 1/2/16 11:43 PM, Ben Finney wrote:

That and other vendor-locked workflow aspects of GitHub makes it a poor
choice for communities that want to retain the option of control over
their processes and data.


The Tcl community has moved to Fossil with great success:

http://www.fossil-scm.org

Lightweight DCVS, integrated bug tracking, rock-solid code (authored by 
D. Richard Hipp, uses SQLite as its store).


The transition was non-trivial: the Tcl core developers had to move over 
a decade of commit history from CVS at Sourceforge to Fossil, which they 
did, successfully. One of the reasons Fossil was chosen is exactly this: 
to maintain the code independent of a third-party platform. (At the time 
of the transition, in 2011, Sourceforge was removing support for CVS, 
they had a server outage for over a week, and other issues were giving 
the community pause on continuing to use SF for hosting.)


I'm not a hardcore Git user so have no substantive opinions on the 
merits of Git or Github per se: I have a Github account and have 
contributed code via pull requests to projects hosted on it. But I found 
learning Fossil very simple. And using Fossil does not preclude 
mirroring the codebase in Git; there is a Tcl/Tk mirror at Github.


Just a thought.

--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: pyinstaller and Python 3.5 on Windows?

2015-11-19 Thread Kevin Walzer

On 11/18/15 5:46 PM, Ulli Horlacher wrote:


ImportError: DLL load failed: The specified module could not be found.


Is there a solution available?



I understand that Python 3.5 has shipped how the MS dll's from Visual 
Studio are shipped, and perhaps the freezing tools (pyinstaller, py2exe) 
haven't yet caught up. Consider filing a bug with the pyinstaller 
developers.


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Which GUI?

2015-07-25 Thread Kevin Walzer

On 7/24/15 4:11 PM, Cecil Westerhof wrote:

Top-posting is (rightly) frowned upon in this group. Could you use
inline posting next time?


Meta is definitely NOT discouraged on this list, but it should be. 
Nothing like derailing an interesting thread with lectures on where to 
post. And someone will chime in with a diatribe against Google 
groups...wait for it...wait for it...


To address the OP's query, I recommend Tkinter. Plays very nicely with C 
and C++.


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: beginners choice: wx or tk?

2015-07-11 Thread Kevin Walzer

On 7/11/15 10:48 AM, Laura Creighton wrote:

Unless I was misinformed 2 weeks or so ago when I asked, that is the
problem.  Tcl/Tk 8.6 works (and is shipped with) OSX, but tkinter
and idle don't work with it.  We will see what Ned Deily says
when he gets around to reading this.


You were misinformed. Tkinter has worked fine with Tk 8.6 for a long 
time. The issues with Tk on the Mac, owing to Apple's force migration of 
GUI libraries to Cocoa, have finally been more or less resolved, and Tk 
8.6.4 is now quite stable on OS X.


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI toolkit(s) status

2014-11-22 Thread Kevin Walzer

On 11/22/14, 3:59 AM, wxjmfa...@gmail.com wrote:

TeXLive (since 2014, if I'm not wrong) has a GUI installer
and package manager, I recognized a "tcl/tk/tkinter-like" - Perl
tool and contrary to Python it works.


That's Perl-Tk, which, as I said, is still around, but only runs on 
Windows and X11/Linux--no native Mac Port. And it hasn't been updated in 
years, it does not take advantage of recent advances in Tk.


--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI toolkit(s) status

2014-11-21 Thread Kevin Walzer

On 11/20/14, 11:34 PM, Terry Reedy wrote:

A possible solution for Tk is to replace the non-C Tcl parts of TK with
Python (or the CPython API functions as needed for speed).  I have no
idea how horrendous a project creating Py/Tk would be.


It would be very horrendous. See Perl/Tk as the example. They ripped out 
the Tcl interpreter and interfaced directly with Tk's C API. The result 
was a rigid, inflexible binding that was never ported to the Mac 
(because it required a C implementation) and could never be easily 
updated to take advantage of new features in Tk, because again it 
required a C implementation. Perl-Tk still exists, but more modern 
bindings like ActiveState's Tkx module have restored the Tcl 
interpreter, giving you access to all Tk advances and platforms "for free."


Apart from the ease of updating Tk features, from a design standpoint I 
think this is the right call. There may be a little extra overhead in 
having an extra interpreter embedded, but that is what Tcl was 
originally designed for: embedding. It handles this requirement more 
easily and with less pain than most languages. I think that's why Tk 
became the default GUI binding of choice for other scripting languages.


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI toolkit(s) status

2014-11-21 Thread Kevin Walzer

On 11/20/14, 4:04 AM, Christian Gollwitzer wrote:

Apple is a
moving target, they pulled the rug from under Tk's feet twice over the
past 10 years. Nobody knows if Tk will continue to exist on the mac if
Cocoa is withdrawn some day and replaced by a new and completely
different windowing framework.


There is indeed a lack of manpower and expertise for Tk/Mac:  I'm pretty 
much it, except when someone submits a patch to scratch a specific itch.


Apple has introduced Swift as a new systems language, but (as I 
understand it) the intent is to supersede Objective-C as a language, not 
the Cocoa frameworks per se. So I think the risk of a brand-new 
windowing system replacing Cocoa (and thus requiring yet another new 
implementation of Tk) is pretty small. There may be a larger risk with 
newer API's being expressed mainly in Swift, which would require 
conversion to Objective-C for legacy codebases, but that is a smaller 
hurdle to clear.


--Kevin
--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: OS X Menubar in Tkinter

2014-10-23 Thread Kevin Walzer

On 10/21/14, 1:58 AM, Mark Lawrence wrote:

I'm pleased to see that you have an answer.  In return would you please
access this list via
https://mail.python.org/mailman/listinfo/python-list or read and action
this https://wiki.python.org/moin/GoogleGroupsPython to prevent us
seeing double line spacing and single line paragraphs, thanks.


And admonitions of this type should be taken to 
comp.misc.propernntpformatting or 
groups.google.com/propergroupsformatting. They are OT for a list devoted 
to the Python programming language. I'd rather see flame wars over 
indenting vs. curly braces than this kind of constant policing of folks 
who come to us via Google: they greatly increase the noise I have to 
filter out.


--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk

2014-10-03 Thread Kevin Walzer

On 10/3/14, 3:55 PM, Ned Deily wrote:

Even if there were no incompatibilities, on OS X with Tcl and Tk (and
other) frameworks, the version number is embedded in the path to the
shared library and the linker normally creates an absolute path at that.


Is this because Python lacks the concept of stubs?

A Tcl library compiled for 8.5 can be loaded into 8.6 with no 
re-compiling required because of stubs.

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk

2014-10-01 Thread Kevin Walzer

On 10/1/14, 7:51 AM, Peter Tomcsanyi wrote:

"Ned Deily"  wrote in message
news:nad-d2ddcb.14070824062...@news.gmane.org...

The easiest option would be a downloadable package that would allow the
default python.org 8.5-linked _tkinter to be overridden with an 8.6
version.  There may be some news on that front in the near future.


It's October...
So I tried Python 3.4.2rc1 and it seems that it still links to Tk 8.5 on
Mac.
Does it mean that there is no plan to link to Tk 8.6 in Python 3.4.2 on
Mac?
Or is there something that can override 8.5 to 8.6 as you wrote?



The solution here is to build Python and Tcl/Tk yourself, in the 
versions you want, and then things should work just fine.



--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Will IronPython / WPF work on Mac OS X?

2014-08-04 Thread Kevin Walzer

On 8/4/14, 8:17 AM, danwgr...@gmail.com wrote:

Hello,
I am thinking of using IronPython to build an Python application. Using WPF in 
Visual Studio to draw the GUI and create the XAML.  Can I then run this Python 
application on a Mac OS X (10.8)?
Thanks.



IronPython is a Windows-only product, I believe...doesn't it run on top 
of .NET? I don't see how it would work on the Mac unless it also worked 
with Mono.


--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Tcl/Tk alpha channel bug on OSX Mavericks is fixeded, but how/when can I use the fix?

2014-08-04 Thread Kevin Walzer

On 8/4/14, 5:40 AM, Peter Tomcsanyi wrote:

"Kevin Walzer"  wrote in message
news:lrmc0r$suj$1...@dont-email.me...

New releases of Tcl/Tk 8.5 and 8.6 are due out soon; right now they
are undergoing final testing as betas/release candidates.


Thanks for the promising news.
Where should I look for the announcement that there is something new?
Is this the correct place?
http://sourceforge.net/projects/tcl/files/Tcl/


You can check comp.lang.tcl for an announcement.


But will be the 8.5. branch updated, too?
I need 8.5 because CPython on Mac does not yet use 8.6...
I cannot see there 8.5.15.1 (at least that is how ActiveTcl is numbered)
which solved some oter Mavericks issues in October 2013 (all 8.5. files
are older than October 2013)...
So will be there a 8.5.16?


8.5 and 8.6 will be updated.



you can download the source tarballs for Tcl and Tk when they are
released, untar them to a specific directory, cd to the directory, and
run these commands:

make -C $insert_tcl_dirname_here/macosx
make -C $insert_tk_dirname_here/macosx

and then

sudo make -C $insert_tcl_dirname_here/macosx install
sudo make -C $insert_tk_dirname_here/macosx install


I have some command line skills and I have the command line developer
tools installed (is that enough?), but I am not sure if I understand
which directory's name is $insert_tcl_dirname_here (I suppose that the $
sign belongs to the name of the "variable", am I right?). Is it the
directory where I unterd tcl (and which is under the directory where i
cd-ed to)?


$insert_tcl_dirname = something like tcl8.5.16. Just look at the numbering.

In other words, you want a directory with two subdirectories: tcl8.5.16 
and tk8.5.16 (since you are looking at 8.5).



This will install the updated version of Tcl and Tk in
/Library/Frameworks, and Python should pick them up.


Well, should...
I will try. But when I followed a similar procedure of installing the
tkpng package then after "sudo make install" it seemed to be ok, but it
was apparently added to other version of Tk than CPython is using...
Can somebody else confirm or disconfirm that the above procedure will
install the new Tcl/Tk to that place where CPython (that is already
installed) will pick it from? Or do I need to reinstall CPython after
this? Or...?


Where is your current installation of Python? The above instructions 
assume that you are using the standard Python from python.org. As I 
mentioned before, if you have installed things via a package manager 
(brew, Fink or MacPorts) you will have to follow their instructions.


--Kevin


--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3 is killing Python

2014-08-03 Thread Kevin Walzer

RIck,

On 7/17/14, 2:15 PM, Rick Johnson wrote:

Sadly, all of my calls to improve IDLE have been meet with
rebukes about me "whining". The "powers that be" would wise
to*UTILIZE*  and*ENCOURAGE*  my participation instead of
*IGNORING*  valuable talent and*IMPEDING*  the expansion of
this "private boys club".


A bit late to this, I suppose...

Where are your patches? Can you point me to anywhere at the Python bug 
tracker where they can be found?


I'll highlight the two major patches I've submitted over the past few 
years:


http://bugs.python.org/issue15853
http://bugs.python.org/issue6075

One fixed a pretty bad crash on the Mac, and the other optimized IDLE's 
Mac port to adjust to some API changes in Tk because of a switch in the 
native back end (Carbon to Cocoa).


In both cases I posted an e-mail or two to the relevant mailing list 
(IDLE-dev and MacPython) to provide a head-up about the patch, answer 
questions, and so on--but that was it. No major "calls to improve IDLE," 
just some code that DID improve IDLE. The "powers that be" didn't commit 
the patches right away, and not without some modification and testing, 
but they eventually did commit them, and the outcome satisfied my 
intention in submitting the patches in the first place.


Both of these patches addressed issues that made IDLE pretty much 
un-usable for me. Obviously a crash will do this, but also, when I 
switched my installation of Tk from the Carbon-backed one to the 
Cocoa-backed one, there were lots of little glitches because of subtle 
differences in how Cocoa did things.


I suppose I simply could have filled the mailing lists with complaints 
that these things were Big Problems for me and Someone Should Do 
Something About Them, but there was no guarantee that someone would pick 
up the challenge. Fortunately, I had the knowledge, skills and time to 
submit patches that were sufficiently developed that the relevant Python 
maintainers could take them, apply them, modify slightly as required, 
test them, and then commit them. This did ensure that Something Would Be 
Done about my issue, because the Person Who Did Something About It was me.


I know you are proficient in both Python and Tkinter, as I've noted from 
the helpful advice you give Tkinter newbies on the list from time to 
time, and so I'm sure you have the skill set to put together some 
patches that address specific points of pain for you. And despite the 
disagreement that others may register with you in these threads from 
time to time, I'm quite confident that useful patches will be gratefully 
accepted, even if not immediately.


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Tcl/Tk alpha channel bug on OSX Mavericks is fixeded, but how/when can I use the fix?

2014-08-03 Thread Kevin Walzer

On 8/3/14, 1:24 PM, Peter Tomcsanyi wrote:



I think that it is because of this problem in Mavericks:
http://core.tcl.tk/tk/tktview?name=99b84e49ff

The above link says that it has been solved in Tcl/Tk.
But: what does it mean for me - a Python user?
Can anyone say when a version containing the above bug fix will be
available in a form of an installable package that I can use with Python
on a Mac?
How can I know that such a package is avaibale?
Or can anyone point me to some instructions how could I compile Tcl/Tk
for myslef and (more importanty) how to install the result of that
compilation so that Python 3.4 recognizes that it should use that
package (and not three other installations of Tcl/Tk in my computer)?



New releases of Tcl/Tk 8.5 and 8.6 are due out soon; right now they are 
undergoing final testing as betas/release candidates.


If you are using the standard Python installer from Python.org, then you 
can wait for ActiveTcl to be updated (not sure of their release 
schedule) or you can download the source tarballs for Tcl and Tk when 
they are released, untar them to a specific directory, cd to the 
directory, and run these commands:


make -C $insert_tcl_dirname_here/macosx
make -C $insert_tk_dirname_here/macosx

and then

sudo make -C $insert_tcl_dirname_here/macosx install
sudo make -C $insert_tk_dirname_here/macosx install

This will install the updated version of Tcl and Tk in 
/Library/Frameworks, and Python should pick them up.


These instructions assume you have Apple's developer tools installed and 
are at least minimally comfortable using the command line.


If you have installed Python via some other process, cf. MacPorts or 
Homebrew, you'll have to wait until they pick up the new versions of Tcl 
and Tk and follow their instructions for upgrading.


Hope this helps,
Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: .Net Like Gui Builder for Python?

2014-07-27 Thread Kevin Walzer

On 7/25/14, 10:55 AM, Orochi wrote:

Hi,
This Question may sound lame ,but I am searching for .Net Like Gui Builder for 
Python.
I tried PyQt Designer' and 'Glade', No doubt its great but it created only 
interface.
I have to code all the things in separate file.
what I was searching for is Visual Studio .Net like Gui builder where you
drag and drop widgets and just double click on the widget to edit code of that 
widget.All other formalities of creating a function and class for the main 
window and widget(e.g Button) is already done.

So,Is there any Gui App builder like Visual Studio or having features like 
Visual Studio for Python.

Thank You!

I'm not sure which GUI framework you use, but Tkinter is so simple to 
code in directly that you don't really need a UI builder. Give that a try.


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Mac python py2app problem

2014-07-15 Thread Kevin Walzer

On 7/15/14, 9:56 PM, Nicholas Cannon wrote:

Hey i have made an app and i have made a .msi for windows with py2exe and i 
have also exported it with py2app on mac. No problems here they all work fine. 
I then put the .msi on sourceforge and it works great but when i put the .app 
on there and download it it says something like i can open this on old 
architecture or something so i have to put it through google drive and i dont 
like this like i share the link and folder and people can download it there but 
it is dodgy. Could someone please help me out like if there is a .msi type 
thing for mac with py2exe?



It's hard to make sense of what you are asking for. Can you just zip up 
the app bundle that py2app produces and upload it that way? That works 
for many developers.


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3 is killing Python

2014-07-15 Thread Kevin Walzer

On 7/15/14, 6:38 PM, Mark Lawrence wrote:

   I did see your correction but it gave me an opportunity to mention
google groups, something that just can't be missed


If the newgroup had a filter to trim out complaints about Google groups, 
half the traffic would be gone. :-)


--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3 is killing Python

2014-07-15 Thread Kevin Walzer
"Top posting" is the practice of responding to an e-mail thread by 
putting your response at the top of the text you are quoting. It's 
standard practice in the corporate world...


On 7/15/14, 6:13 PM, Abhiram R wrote:

a) What is "top post"?Â


...but  Unix/newsgroup ettiquette says that it's gauche to do this, 
because it presents an unacceptable cognitive burden to the user trying 
to catch the context of the thread by forcing them to read your reply 
first, before they read the preceding quoted comments.


--Kevin
--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3 is killing Python

2014-07-15 Thread Kevin Walzer

On 7/15/14, 9:00 AM, Chris Angelico wrote:

The problem isn't Python 2, nor Python 3, nor even the fact that there
are two Pythons. The problem is that a lot of people don't understand
when to choose one or the other, don't understand what the promises of
support are, and (perhaps worst of all) keep hearing FUD about how
Python 3 is killing Python. And so the confusion perpetuates.
Eventually the world will get past that, but in the meantime, we have
to deal with these sorts of storms-in-teacups from people who simply
cannot comprehend what's going on.


I think it's more than a tempest in a teacup.

The number of language revisions that result in deliberate, code-level 
incompatibility out there is pretty small. People rightly expect that 
code written for version 2.x of a language will continue to work with 
version 3.x, even if 3.x is designed to go in another direction.


I can only think of two widely used languages in the last decade where 
there was this type of major break in binary compatibility: Perl and 
Visual Basic. Perl 6 is kind of a moot point because it's never shipped 
(insert reference to Duke Nukem or GNU HURD here, as appropriate), and 
Perl 5 has not just seen continued development, but invigorated 
development in recent years. But the example of VB is instructive. 
VB.NET is similar, but not identical, to classic VB, and as far as I am 
aware its uptake has not been nearly as wide as classic VB. Microsoft 
was able to force what limited migration we've seen mainly because VB is 
not open source and they can simply drop support for it from Windows.


I've stayed with Python 2.7 because I've seen no benefit in 3.x that 
outweighs the hassle of going through my code line by line to make it 
compatible. As a Mac developer I deal with this kind of code/API churn 
with each release of Mac OS X, and I have no desire to increase my 
headaches.


Though I expect I will eventually update to 3.x, however, like many 
other developers I am also annoyed by the decision to break backwards 
compatibility in Python. The decision strikes me as arrogant. Cruft and 
backwards compatibility are an inevitable part of any mature programming 
language, and maintaining compatibility is important--more important 
than bolting on shiny new features, in my view. If shiny new features 
must be added, they should be added side-by-side with older API's.


I think the Python developers have undervalued the conservator part of 
their role. Yes, they have provided tools to help application and 
library developers migrate their code, but it should not be incumbent on 
third-party developers to re-architect stable, working code simply 
because the language has broken binary compatibility. Defenders of the 
3.x migration portray such developers as laggards, but I see Python 
3.x's failure to silently and successfully import 2.x code as a failure 
on the language's end.


I won't go so far as to say that Python 3 is killing Python. Python will 
survive. But the headaches of migration are substantial, and should not 
be necessary.


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk

2014-06-25 Thread Kevin Walzer

On 6/25/14, 1:49 AM, wxjmfa...@gmail.com wrote:

I can also add, tcl or tk or tkinter (8.6) is on Windows
quite buggy. In fact, simply*unusable*.


How so?

Please report bugs at http://core.tcl.tk/tcl/reportlist or 
http://core.tcl.tk/tk/reportlist, as needed.


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Event handling for COM object with win32com (pywin32)

2014-06-22 Thread Kevin Walzer

On 6/22/14, 5:15 AM, peter.balazo...@emspin.com wrote:

Do I miss something in code or incorrectly handling the events or COM Object?


There is a pywin32 mailing list that may be able to offer more help here.

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: OT: This Swift thing

2014-06-03 Thread Kevin Walzer

On 6/3/14, 4:43 PM, Sturla Molden wrote:

Are Python apps still banned from AppStore, even if we bundle an
interpreter?


Python apps are not banned from the App Store. See 
https://itunes.apple.com/us/app/quickwho/id419483981?mt=12.


--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: the Gravity of Python 2

2014-01-08 Thread Kevin Walzer

On 1/8/14, 9:30 AM, Mark Lawrence wrote:

But to be serious why not stick with 2.x if there's no compelling reason
to move?  Whatever happened to "if it ain't broke, don't fix it"?  And
before anyone says anything please don't start on about the bytes versus
string debate, I'm fairly certain that there are a substantial number of
application areas that don't run into these problems.


+1 to this.

I haven't updated my Python apps to 3.x because there's nothing in 3.x 
that offers benefits to my users.


I deal with constant API churn as a Mac developer. I have no interest in 
adding to this complexity and headaches by switching from 2.x to 3.x.


I imagine I'll update someday, but not anytime soon.

--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Kevin Walzer

On 12/16/13, 10:20 AM, Chris Angelico wrote:

Having made a tweak to gitk at one point, I have to say Tcl is
definitely inferior to Python.


Without starting a flame war, can you elaborate? I'm curious about your 
perspective.


(I studied PSL--Python as a Second Language--so develop in it with a 
slight accent. I'm a native Tcl developer, for better or worse.)


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Kevin Walzer

On 12/15/13, 5:06 PM, Chris Angelico wrote:


Yeah, but there's a difference between passing your GUI incantations
on to a library function (written in C but now just part of a binary
library) and feeding them to a completely different language
interpreter. When I write something with PyGTK, I can't, even in
theory, give it arbitrary C code to execute. From what I understand
here, that *is* true of Tcl, which means that the Python download
contains a Python interpreter and a Tcl interpreter. I'm not saying
that's a bad thing to do, but it is calculated to provoke remark.


Yes, a Tkinter app has both a Python interpreter and an underlying Tcl 
interpreter. Let's be clear about that.


The technical reason for this is that, during Python's early 
development, Tk was the simplest, most powerful and OSS-friendly GUI 
toolkit out there (compared to, let's say, Motif). Its reliance on Tcl 
was a plus because Tcl's C API is exceptionally clean and easy to 
embed/call from other C libraries (that was Tcl's original main focus, 
embedding in C).


Embedding the Tcl interpreter remains a sound decision today. It makes 
it trivial to keep Tkinter updated in sync with Tk updates, since the 
Tcl interpreter does most of the heavy lifting. The recent effort to 
wrap Tk's new themed widgets is a good one: nearly all of the work was 
done at the Python level. Compare this approach to Perl's original one, 
which stripped out Tcl and implemented Tk integration entirely in C. Any 
updates require heavy lifting in C and, in fact, Perl/Tk has not kept up 
with Tk's main line of development (it does not run natively on the Mac, 
for instance).


Calling through Tkinter to Tcl also provides some other conveniences. If 
you're writing a Tkinter app and want to access some platform-specific 
functionality that requires C calls, that may require a library 
extension written against Tcl/Tk's C API (i.e. the Mac's NSServices 
API--that can't be accessed using ctypes because it hooks into the 
window server). Fortunately, Tk is very easy to extend in C--much 
simpler than extending wxWidgets or Qt.


Finally, Tcl is itself a fully-featured, general programming language 
that is a peer to Python both generationally and in terms of its 
capabilities; the main way it lags is in the size of its development 
community. In other words, you are not handing the ball off to a 
90-pound weakling if you need to call into Tcl from Python via Tkinter. ;-)


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Packaging a proprietary Python library for multiple OSs

2013-12-06 Thread Kevin Walzer

On 12/5/13, 10:50 AM, Michael Herrmann wrote:

On Thursday, December 5, 2013 4:26:40 PM UTC+1, Kevin Walzer wrote:

On 12/5/13, 5:14 AM, Michael Herrmann wrote:
If your library and their dependencies are simply .pyc files, then I
don't see why a zip collated via py2exe wouldn't work on other
platforms. Obviously this point is moot if your library includes true
compiled (C-based) extensions.


As I said, I need to make my *build* platform-independent.


Giving this further thought, I'm wondering how hard it would be to roll 
your own using modulefinder, Python's zip tools, and some custom code. 
Just sayin'.


--Kevin


--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Packaging a proprietary Python library for multiple OSs

2013-12-05 Thread Kevin Walzer

On 12/5/13, 10:50 AM, Michael Herrmann wrote:

As I said, I need to make my *build* platform-independent.


cx_Freeze is platform independent, but I'm not sure if it generates 
libraries or simply executables.


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Packaging a proprietary Python library for multiple OSs

2013-12-05 Thread Kevin Walzer

On 12/5/13, 5:14 AM, Michael Herrmann wrote:

Even though I am not generating an EXE, I am using py2exe to obtain the distributable Zip 
file for my library. This "hack" is very convenient, as py2exe allows me to 
simply say which packages I require and does the work of performing a dependency analysis 
of the required libraries for me. py2exe automatically generates the Zip file with my 
(compiled) library code, and all dependencies.


If your library and their dependencies are simply .pyc files, then I 
don't see why a zip collated via py2exe wouldn't work on other 
platforms. Obviously this point is moot if your library includes true 
compiled (C-based) extensions.


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Getting the Appdata Directory with Python and PEP?

2013-12-02 Thread Kevin Walzer

On 11/26/13, 5:49 PM, Eamonn Rea wrote:

Maybe this module is of some use to you:
>
>https://pypi.python.org/pypi/appdirs
>
>
>
>It provides a unified Python API to the various OS specific 'user' directory 
locations.
>
>
>
>Irmen

I saw this, but I wanted to do it myself as I stated in the OP:)


This module appears to simply use hard-coded paths on Unix/Linux and OS 
X--not much to learn there, except which paths to code.


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Suggest an open-source issue tracker, with github integration and kanban boards?

2013-11-17 Thread Kevin Walzer

On 11/13/13, 7:46 AM, Alec Taylor wrote:

Started to build this on my own; then was like, hang on! - This is
probably something very commonly requested…

Can you recommend an open source project (or two) written in Python;
which covers multi project + sub project issue tracking linked across
github repositories?

[on the github side, want to be able to reference "commit 
solved by patch from issue #"; fine to have that extra annotation only
present on my server]

Also would be perfect if it has kanban board support, issue
prioritisation and distribution/assignment amongst team members; as
well as related analytics.

Thanks for all suggestions! =)



Not written in Python, but Fossil (http://www.fossil-scm.org/) offers an 
all-in-one, lightweight DCVS/issue-tracking/wiki/blog package. Written 
the author of SQLite.


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Will Python 3.x ever become the actual standard?

2013-10-23 Thread Kevin Walzer

On 10/23/13 7:57 AM, duf...@gmail.com wrote:

Years have passed, and a LARGE number of Python programmers has not even 
bothered learning version 3.x.


That's true for me. My own projects run just fine with 2.7.

I have no specific issue with 3.x, nor phobia of it, but my time as a 
developer is limited, and I'd rather use it to add features to my apps 
using the stable base of 2.7 rather than go through the headaches of 
modifying my codebase to accommodate the differences with 3.x.


This is something that's On My List to Do Someday, but right now there's 
no real upside to it for my apps. As long as 2.7 is supported, I'll 
probably continue to use it.


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Screenshots in Mac OS X

2013-10-22 Thread Kevin Walzer

On 10/22/13 8:19 PM, Pratik Mehta wrote:

Hey Kevin,

Thanks for reverting.

I know about the "screencapture" function and the parameters available.

But, how would I take the user input, as in, that is just command-line, as soon 
as I execute the program, it will take whatever kind of parameter is passed 
under screencapture.

I want that, in the same program, if the user presses Shift+Command+3, whole 
screenshot should be taken.

When, Shift + Command + 4 is pressed, a particular frame should be displayed to 
select the area / region.

Also, I want to create my own command : Shift + Command + 5 ==> this is 
specially for web browser, whenever I press this key on any of the web-page, the 
whole web page should be grabbed along with its snapshot, and snapshot's filename 
should be web-page's url which I am currently on.

Also, this process should be executing at the backend, so that, whenever these 
keys are pressed, it overrides the system's functionality and uses mine.



There are no simple answers to these questions.

With Tkinter, it's possible to code a basic UI and bind combinations of 
specific keys to trigger specific callbacks, which can fire specific 
sequences of arguments to the screencapture CLI tool. That's the quick 
and dirty way. I'm not going to write this code for you. Look at 
TkDocs.com and effbot's site for an introduction to Tkinter.


If you are not looking for a GUI app to do this, but some sort of 
system-level daemon, that requires a lower level of coding. You'll need 
to look at such system frameworks as CoreGraphics and Cocoa to find the 
API's you need. PyObjC (Python binding to Cocoa) can probably be helpful 
here. Frankly, I'm not sure Python is the best tool here, but if you go 
this route, you want a Python API that hews as closely to the 
system-level calls as possible, and PyObjC will likely be your best path 
here.


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Screenshots in Mac OS X

2013-10-22 Thread Kevin Walzer

On 10/22/13 6:08 PM, Kevin Walzer wrote:

On 10/22/13 4:15 PM, Pratik Mehta wrote:

Anyone there to help me out???



import os
os.system('screencapture', 'foo.png')



...and see 'man screencapture' for options.

I leave setting up a Tkinter GUI with proper key bindings as an exercise 
for the reader.


--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Screenshots in Mac OS X

2013-10-22 Thread Kevin Walzer

On 10/22/13 4:15 PM, Pratik Mehta wrote:

Anyone there to help me out???



import os
os.system('screencapture', 'foo.png')


--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Sexism in the Ruby community: how does the Python community manage it?

2013-10-17 Thread Kevin Walzer

On 10/17/13 6:11 PM, Chris Angelico wrote:

On Fri, Oct 18, 2013 at 8:50 AM, Kevin Walzer  wrote:

I've worked in marketing, editing, technical writing, and development, and
at no place I have ever worked would such behavior be greeted with anything
but immediate termination.


That's all very well, but what if these gems were created, not by
someone at work (where termination is possible), but by a single guy
at home (and I mean "single" in two senses here)? He's not going to
lose his job over it - at least, I *hope* he wouldn't get fired for
what he did on his own time - so where's the incentive going to come
from?

ChrisA



Well, putting the package name on an official List of Asshattery is a 
good start.


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Sexism in the Ruby community: how does the Python community manage it?

2013-10-17 Thread Kevin Walzer

On 10/16/13 11:13 PM, Owen Jacobson wrote:

3. How can we reach out to the Ruby community and help *them* get past
the current crop of gender issues, and help them as a group to do better
next time?


The Ruby community seems to be a singular example of "brogrammer" 
culture: mostly young men, lots of drinking, lots of sex humor, extreme 
work intensity, arrogant intelligence, and a tendency to view women as 
people to get laid with, and a distinct lack of experience with working 
with women as equals or superiors. It's frat life transplanted to 
startup culture. I have no idea why this seems so endemic in the Ruby 
community; it probably has something to do with the huge popularity of 
Rails  and the resurgence of tech startups over the past several years: 
both have created a "gold rush" environment that has attracted huge 
numbers of young programmers with technical chops but who are shockingly 
undeveloped in other ways.  It's immature men meeting an immature 
business environment (i.e., a startup) without procedures in place to 
set an appropriate tone. Such behavior in most other fields would get 
them fired so fast it would make their heads spin, if not getting them 
drummed out of the field altogether.


I suspect that Python doesn't have these problems because it's an older, 
more established language, and the community is comprised of older and 
more mature individuals who have outgrown such shenanigans, or never 
embraced them in the first place. Python has grown steadily but never 
had the boom that Ruby on Rails had. I'm sure the Python community has 
its issues with institutionalized sexism, not least because computer 
fields in general have so few women, but I have seen no evidence of the 
overt, sexist hostility that pervades "brogrammer" culture.


As to what the Python community can do, I'm not sure what, apart from 
calling out the idiot "brogrammers" who perpetuate such hostility to 
women, and refusing to associate with it. The real opportunity to 
address this lies with the startup founders and executives who tolerate 
this kind of behavior, and don't send its perpetuators packing. Losing a 
job because you're a sexist jerk might get you thinking about the 
importance of treating all people with respect. If you're a startup 
founder who tolerates such behavior because you're afraid of losing your 
developers to other companies, then you're a coward; and if you simply 
don't see a problem with such behavior or deny that it exists, then you 
are worse than a coward, and you are worse than a jerk.


Let me reiterate: the overt sexism and hostility toward women that 
emanates from "brogrammer" culture is shocking to anyone who works in a 
more established field with a better balance between men and women. I've 
worked in marketing, editing, technical writing, and development, and at 
no place I have ever worked would such behavior be greeted with anything 
but immediate termination. Even the software startup I worked at did not 
have such issues; while the developers were all men, the company was 
founded by a husband-and-wife team, and the women who worked there (in 
technical writing and sales support) were treated with respect, because 
the founder would not tolerate anything else.


It would be great to see more leaders at big tech companies speak out 
against such garbage. What impact would it have if Larry Page, Mark 
Zuckerberg, Marissa Meyer, and others say, "If you do that crap here, 
you won't be here"? Or what if venture capitalists said, "We won't fund 
you if you don't provide an equitable work environment that puts jerks 
out on their rear end." Nothing short of some hard, painful experience 
is likely to have a large-scale change on the sexist culture that 
pervades so much of tech.


A bit off-topic perhaps, for which I apologize, but I've been following 
the whole "sexism in tech" subject with increasing disgust and dismay, 
and I wanted to strongly protest against it.


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python GUI?

2013-09-13 Thread Kevin Walzer

On 9/11/13 4:55 PM, eamonn...@gmail.com wrote:

Tkinter -- Simple to use, but limited


With the themed widget introduced in Tk 8.5, Tkinter is now a peer to 
the other GUI toolkits in most respects, surpasses them in some (canvas 
widget), and lags behind in just two areas: printing (several 
platform-specific solutions but no cross-platform API) and HTML display 
(a few extensions but no standard widget set).


I've stayed with Tkinter because it fits my brain the best. Old 
complaints about it being ugly or limited no longer hold water.


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
https://mail.python.org/mailman/listinfo/python-list


Re: Simple Python script as SMTP server for outgoing e-mails?

2013-08-03 Thread Kevin Walzer

On 8/1/13 10:15 AM, Gilles wrote:

I already have a static IP, so the issue is more that remote MTAs
might not accept connections from MTAs running on users' PC instead of
ISP's.


For what it's worth, that hasn't been my experience.

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: how to package embedded python?

2013-07-29 Thread Kevin Walzer

On 7/25/13 5:05 PM, David M. Cotter wrote:

what must i include in my app package if i'm embedding python?

i tried including *everything* in the "DLLs" directory, but my app still 
crashes as soon as i attempt to initialize python.

this is on a system that does not have python installed, as most of my users 
won't have it.  is it actually a requirement that they first install python?  
(cuz it does work then)



Have you looked at these docs?

http://docs.python.org/2/extending/embedding.html

Lots of other hits on Google for ""embedding Python in C app."

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Cross-Platform Python3 Equivalent to notify-send

2013-07-27 Thread Kevin Walzer

On 7/27/13 6:58 AM, Devyn Collier Johnson wrote:

Linux systems with the proper software can use the "notify-send"
command. Is there a cross-platform Python3 equivalent?

Mahalo,

Devyn Collier Johnson
devyncjohn...@gmail.com


http://pythonhosted.org/gntp/ ?

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Simple Python script as SMTP server for outgoing e-mails?

2013-07-24 Thread Kevin Walzer

On 7/23/13 5:53 PM, Gilles wrote:

On Mon, 22 Jul 2013 10:14:15 -0400, Kevin Walzer 
wrote:

http://www.hmailserver.com


Thanks. hMailServer was one of the apps I checked, and I was just
making sure there weren't something simpler, considering my needs,
ideally something like Mongoose MTA.

Regardless, because of the SPAM anti-measures mentioned above, it
seems like I was over-optimistic about running an MTA and sending
e-mails from my home computer :-/



The reason I mentioned hMailServer is that I host my own mail server for 
my business--I have a static IP address, and correctly configured 
DNS--and so I'm able to send out large batches of e-mails to customers 
from my network without being blocked by my ISP. I'm running a Mac 
server so my mail system is the typical Unix setup (Postfix, etc.), but 
hMailServer was the closest thing I've found for Windows.


Configuring your own server isn't cheap in terms of time even if you use 
FOSS components, and your ISP may charge more for a static IP, so I 
completely understand if you don't want to go that route.


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Simple Python script as SMTP server for outgoing e-mails?

2013-07-22 Thread Kevin Walzer

On 7/21/13 10:42 AM, Gilles wrote:

Hello

Every once in a while, my ISP's SMTP server refuses to send
perfectly legit e-mails because it considers them as SPAM.

So I'd like to install a dead-simple SMTP server on my XP computer
just to act as SMTP backup server.
All I'd need is to change the SMTP address in my e-mail client, and
off they go. No need for anything else like user authentication or
SPAM control.

Is there a no-brainer, ready-to-use solution in Python that I could
use for this?

Thank you.



http://www.hmailserver.com

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Beginner - GUI devlopment in Tkinter - Any IDE with drag and drop feature like Visual Studio?

2013-07-22 Thread Kevin Walzer

On 7/22/13 4:54 AM, Cucole Lee wrote:

Why Thinter? You can try wxpython.



Well, it's partly a matter of taste, but I for one find wxPython's 
API...inelegant.


--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Stack Overflow moderator “animuson”

2013-07-19 Thread Kevin Walzer

On 7/10/13 3:55 AM, Mats Peterson wrote:

A moderator who calls himself “animuson� on Stack Overflow doesn’t
want to face the truth. He has deleted all my postings regarding Python
regular expression matching being extremely slow compared to Perl.
Additionally my account has been suspended for 7 days. Such a dickwad.

Mats



And we should care because...?

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Re-using copyrighted code

2013-06-09 Thread Kevin Walzer

On 6/8/13 5:31 PM, Malte Forkel wrote:

Now, how am I supposed to deal with that? Ask Secret Labs for some kind
of permission? Leave it as it is and add my own copyright line?


Secret Labs AB is Frederic Lundh, author of the Python Image Library and 
many bits included in Python's stdlib. Here is info about him:


http://effbot.org/zone/about.htm

His contact info is listed here:

http://www.pythonware.com/company/contact.htm

I have trouble believing there would be any issue with you re-using the 
code, especially since it is included with Python's stdlib.


--Kevin
--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Future standard GUI library

2013-05-20 Thread Kevin Walzer

On 5/20/13 1:04 AM, Vito De Tullio wrote:

FLTK? (http://www.fltk.org/index.php)


FLTK is even uglier than non-themed Tkinter: non-native on every 
platform. Tkinter wraps native widgets on MacOS and WIndows, but FLTK 
draws its own widgets everywhere.


--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: any cherypy powred sites I can check out?

2013-05-19 Thread Kevin Walzer

On 5/16/13 2:30 PM, Chris Angelico wrote:

On Fri, May 17, 2013 at 4:17 AM,   wrote:

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


You're firing off a bunch of minimal-content threads that ask other
people to do work for you. I recommend you put a bit more thought into
your posts, and show that you're willing to do a basic web search
before you just ask a question :)



He's also known on the Tcl newsgroup as Gavino; a Google search for 
"gavino tcl" will turn up some interesting hits. I also see that he's 
posting on comp.lang.perl as "Johannes Falcone." The common thread of 
his recent postings are subjects posed as questions, usually about 
various web frameworks, sometimes without even a single line in the 
message body. On the Tcl list it's AOLServer and NavServer. I'm not 
familiar with the Perl frameworks he's curious about.


--Kevin


--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Future standard GUI library

2013-05-19 Thread Kevin Walzer

On 5/18/13 11:01 PM, llanitedave wrote:

I'm curious about how commonly tkinter is actually used among Python app 
developers as compared to wx, Pyside, or PyQT.  I get the impression that more 
distributed apps are built with wxPython, at least, than tkinter.  My 
impression is far from actual knowledge, of course.



I have two commercial apps developed with Tkinter:

http://www.codebykevin.com/phynchronicity.html
http://www.codebykevin.com/quickwho.html

--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Future standard GUI library

2013-05-18 Thread Kevin Walzer
 Python's stdlib in 
years. You are quite safe in developing against this API, unless your 
taste simply does not run to using the ttk widgets.


Hope this helps,
Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: ActivePython 3.2.2.3 is now available

2013-05-01 Thread Kevin Walzer

On 5/1/13 8:01 AM, Robert wrote:

Will this be the last one? It has been two years.



Hard to say. AS has been focusing on cloud-based stuff lately. 
ActivePerl hasn't been updated for a long time either. ActiveTcl is 
still maintained.


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Drag and drop in Windows

2013-04-30 Thread Kevin Walzer

Official link:

http://tkinterdnd.sourceforge.net

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


Re: Drag and drop in Windows

2013-04-30 Thread Kevin Walzer

On 4/29/13 6:25 AM, Robert Flintham wrote:



I’ve found this (TkDND):

http://wiki.tcl.tk/2768



Michael Lange has written a nice Python wrapper for TkDND. His site is 
offline at the moment, but I found the source files on my system and 
have wrapped them up here:


http://www.codebykevin.com/TkinterDnD2-0.zip

Hope this helps,
Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: simple GUI environment

2013-03-05 Thread Kevin Walzer

On 3/5/13 9:20 AM, Eric Johansson wrote:

The main reason I discount both of those is that they are effectively
dead as I can see. Last updates in the 2010/2011 range.


Why not give EasyGUI a try? The site is still active, and two years 
isn't without an update doesn't mean a project is dead, especially if 
it's a simple and mature project that doesn't need a lot of maintenance. 
If your needs are basic, then I'd say EasyGUI would be a good fit. By 
contrast, a library undergoing heavy development with a 
constantly-shifting API can cause tons of headaches.


--Kevin

--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Is there a graphical GUI builder?

2013-02-20 Thread Kevin Walzer

On 2/19/13 5:19 PM, Rex Macey wrote:

I see that there is TKinter, which is a scripting function to build GUIs. To be 
clear, I'm looking for a graphical interface to build GUIs.


Tkinter is so easy to use to build GUI's that a GUI tool isn't needed. 
Hardly any Tk or Tkinter developer uses anything but a text editor and 
console to develop a user interface.


--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: PYTHON 3.3 + GUI + COMPILE

2012-12-27 Thread Kevin Walzer

On 12/27/12 9:08 PM, Dimitrios Xenakis wrote:

Morning,
I have been looking for a library solution of both GUI and Compiler but for 
Python 3.3 and ofcourse i was hoping for a combination that would be most 
compatible between them. After searching i may have concluded to cx_Freeze 
(because it was the only one that noticed that currently supports version 
Python 3.3), but i do not know what GUI library should i combine it with. Does 
cx_Freeze alone put any kind of restriction to my choice of GUI? I would also 
be interested in using my programs for commercial purposes, so would this put 
again some other kind of limitations to my GUI choice? I have read many good 
stuff about PySide, but still i do not know wether this is the one that i 
should choose. Is PySide same as PyQT and PyQT4 and QT or which is the exact 
relationship between those? Disadvantages - advantages, capabilities, benefits, 
costs, etc. (What is the lowest possible cost of buying such a commercial 
license for my programming?. Are there different versions and should i be carefu

l
l to choose the best for me? Where could i get this from? PySide is total free 
for my commercial needs?) I need to be legit so i guess i should learn how to 
handle with the licencing thing. Please somebody clear things for me.


Thanks 4 your time i really appreciate that.



cx_Freeze has good support for Tkinter, PyQt, and (as far as I know) 
wxPython.


License: Qt is LGPL. PyQt is GPL or commercial. PySide is, I believe, 
the same as Qt itself. I'm not sure how mature or well-supported PySide 
is, in general.


wxPython is LGPL with a commercial exception clause, which allows you to 
use it in closed-source apps.


Tkinter, as part of the stlib, has a very liberal license (BSD-style), 
as does Tcl/Tk, which allows for free use in commercial apps.


Hope this helps,
Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Second try: non-blocking subprocess pipe and Tkinter in 2.7

2012-12-21 Thread Kevin Walzer
Yesterday I posted a question about keeping a Tkinter GUI during a 
long-running process, i.e. reading data from a pipe via the subprocess 
module. I think that question did not quite get at the heart of the 
issue because it assumed that Python, like Tcl which underlies Tkinter, 
supports non-blocking, asynchronous reading out of the box. Apparently 
it does not.


So, my question is hereby revised as such: how can I implement a 
non-blocking read of a subprocess pipe that can write data to the 
Tkinter text widget in an manner that does not cause the GUI to lock up?


--Kevin
--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Keeping a Tkinter GUI alive during a long running process

2012-12-20 Thread Kevin Walzer
I maintain a Tkinter application that's a front-end to to a package 
manger, and I have never been able to find a way to keep the app from 
locking up at some point during the piping in of the package manager's 
build output into a text widget. At some point the buffer is overwhelmed 
and the app simply can't respond anymore, or writes data to the text 
widget after locking up for a period.


I've long used the typical Tkinter design pattern of opening a pipe to 
the external command, and letting it do its thing. However, after a 
time, this locks up the app. If I try to throttle the buffer with some 
combination of "update" or "after" or "update_idletasks," that keeps the 
data flowing, but it comes in too slowly and keeps flowing in long after 
the external process has terminated.


Below is a sample function that illustrates how I approach this issue. 
Can someone suggest a better approach?


 #install a fink package
def installPackage(self):

self.package = self.infotable.getcurselection()
if not self.package:
showwarning(title='Error', message='Error', detail='Please 
select a package name.', parent=self)

return
else:
self.clearData()
self.packagename = self.package[0][1]
self.status.set('Installing %s' % self.packagename)
self.setIcon(self.phynchronicity_install)
self.playSound('connect')
self.showProgress()
self.file = Popen('echo %s | sudo -S %s -y install %s' % 
(self.passtext, self.finkpath.get(), self.packagename), shell=True, 
bufsize=0, stdout=PIPE).stdout

for line in self.file:
    self.inserturltext(line)
self.after(5000, self.update_idletasks)

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: IDLE Crashing in Mac OS 10.8.2 with 2.7.3

2012-10-09 Thread Kevin Walzer

On 10/9/12 11:27 AM, bkee...@gmail.com wrote:

I've tried all the usual suspect of uninstalling and reinstalling IDLE and 
Python 2.7.3, but my IDLE environment always crashes unexpectedly on Mac OS X 
10.8.


Where did you get Python? What version of Tcl/Tk do you have installed? 
Is it the one from ActiveState or the one bundled with OS X?


--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Article on the future of Python

2012-09-26 Thread Kevin Walzer

On 9/25/12 11:35 AM, Steven D'Aprano wrote:

IronPython in C#. Jython is written in Java. CLPython is written in Lisp.
Berp and HoPe are written in Haskell. Nuitka is written in C++. Skulpt is
written in Javascript. Vyper is written in Ocaml. PyPy is written in
RPython.

Some of those Python compilers are obsolete, unmaintained or
experimental. Others are not. But either way, it is certainly not true
that Python is written in C. One specific Python compiler happens to be
written in C, that is all.


Apart from IronPython, what constituency do these alternative 
implementations of Python have that would raise them above the level of 
interesting experiments?


--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Article on the future of Python

2012-09-25 Thread Kevin Walzer

On 9/25/12 4:15 AM, Mark Lawrence wrote:

Hi all,

I though this might be of interest.

http://www.ironfroggy.com/software/i-am-worried-about-the-future-of-python



Interesting article, but the comments of those who say "the only 
language I need to know is Python" strike me as a bit limited. If this 
is the case, then Python can never be moved forward, because it is 
written in C.


I program in Python, C, Objective C, JavaScript, Tcl, AppleScript, and 
I'm learning Perl. Python could *not* handle all the domains I target in 
my projects. For instance: if I want to access Mac-native functionality 
via Tkinter that isn't currently available in the library, I have to 
drill down into C or Objective-C, write a wrapper that hooks in to the 
primitives via Tcl's C API, then possibly write some additional Tcl code 
to provide a cleaner interface, *then* write some kind of Python wrapper 
that I can access in my Tkinter app.


I can understand loving the language and wanting to work just in the 
language, but it's another thing entirely to call Python the One 
Language to Rule Them All. (That's C, because all other languages are 
implemented in it. :-) )


--Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Reading a file in IDLE 3 on Mac-Lion

2012-09-23 Thread Kevin Walzer

On 9/23/12 8:45 AM, Kevin Walzer wrote:

There's nothing to do here; it's an aspect of the native dialog.


To clarify: there's nothing to do at the C level, which is where the 
native dialog is invoked. IDLE can probably be patched to accept other 
file types, such as "dat."


--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Reading a file in IDLE 3 on Mac-Lion

2012-09-23 Thread Kevin Walzer

On 9/23/12 3:33 AM, Ned Deily wrote:

This appears to a difference in behavior between Carbon Tk 8.4 and Cocoa
Tk 8.5 on OS X.  The python.org 32-bit-only installers are built to link
with the former and, with 8.4, the Open file dialog box does have the
file-type filter menu as Hans describes.  The python.org 64-/32-bit
installers link with the newer Cocoa Tk 8.5 and, with it, the Open file
dialog box does not have the filter menu.  I'm not sure there is
anything that IDLE or Tkinter can do about that; any change may need to
be by the Tcl/Tk folks.  But it would be good if you would open an issue
at bugs.python.org so we can follow up on it.


It's a function of NSOpenPanel, the underlying native dialog that 
supports the "open file" dialog on OS X. It doesn't have a "file filter" 
capability, and so it will only recognize hard-coded types that are 
passed to it, cf. py and txt files. "dat" isn't recognized, I tested it 
out. There's nothing to do here; it's an aspect of the native dialog.


--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Tkinter bug in Entry widgets on OS X

2012-08-31 Thread Kevin Walzer

On 8/31/12 11:18 AM, Arnaud Delobelle wrote:



I'm not trying to do anything.  When a user presses the UP or DOWN
arrow, then a strange character is inserted in the Entry box.  I'd
rather nothing happened.

Why is the user doing that? If they are trying to navigate to a 
different part of the interface, they need to use the tab key, not the 
arrow key. It's not a multi-line text widget and shouldn't be expected 
to work like one.


--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Tkinter bug in Entry widgets on OS X

2012-08-31 Thread Kevin Walzer

On 8/31/12 6:18 AM, Arnaud Delobelle wrote:

I'm very inexperienced with Tkinter (I've never used it before).  All
I'm looking for is a workaround, i.e. a way to somehow suppress that
output.


What are you trying to do? Navigate the focus to another widget? You 
should use the tab bar for that, not the arrow key. The entry widget is 
a single-line widget, and doesn't have up/down as the text widget does.


--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)

2012-06-11 Thread Kevin Walzer

On 6/11/12 8:01 AM, Wolfgang Keller wrote:

Tkinter is imho honestly the very best "argument" if you want to make
potential new users turn their backs away from Python for good. Just
show them one GUI implemented with it and, hey, wait, where are you
running to...


Yes, Tkinter GUI's are very ugly.

http://www.codebykevin.com/phynchronicity-running.png

http://www.codebykevin.com/quickwho-main.png

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)

2012-06-10 Thread Kevin Walzer

On 6/8/12 8:27 AM, Wolfgang Keller wrote:

What "GUI designer" would come the closest to the way that Cocoa's
Interface Builder works? I.e. is there any one (cross-platform) that
allows to actually "connect" the GUI created directly to the code and
make it available "live" in an IDE?


If you're developing on the Mac, PyObjC allows you to use Interface 
Builder for developing Python apps.


However, there are those of us who are deeply uncomfortable with IB and 
related tools, such as RealBasic and LiveCode/Runtime Revolution. These 
tools make code organization very hard by reducing the amount of code 
written to the point of the UI working by "magic," and/or by breaking up 
your code into little snippets that you can only view by clicking on the 
widget in the UI tool.


A related issue is that using a tool such as this makes you heavily 
dependent on that particular tool, and subject to its developers' 
priorities, release schedule, and bugs. The pace of Xcode 
development--with Apple making frequent changes to project formats in a 
backwards-incompatible way--is an example of this.


One reason I prefer to code UI's by hand is because a) in Tkinter it's 
very easy to do, and b) it allows me to have a much better mental model 
of my code and my app's functionality--I can put everything into as many 
.py files as I need to, and can edit my code with any text editor.


I think these issues are a reason that the slick "drag-and-drop" UI 
builders tend to be developed by commercial software shops to support 
their language and/or IDE, but find little traction among open-source 
developers and languages.


--Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: what gui designer is everyone using

2012-06-07 Thread Kevin Walzer

On 6/5/12 10:10 AM, Mark R Rivet wrote:

I want a gui designer that writes the gui code for me. I don't want to
write gui code. what is the gui designer that is most popular?
I tried boa-constructor, and it works, but I am concerned about how
dated it seems to be with no updates in over six years.


None. I write GUI code by hand (Tkinter).

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Recruiting for Python Developer - Perm

2012-05-22 Thread Kevin Walzer

On 5/22/12 5:30 AM, Python Recruiter wrote:

Key skills required for this role are:
1. Python Development on Linux
2. Experienced Software Developer

Desirable:
1. AppScript
2. Adobe Illustrator


I'm in the U.S. so would not be applying for your position, but one 
thing your post neglects to mention is that competence on Mac OS X may 
also be required here. appscript is a Mac-specific technology (Python 
interface to Apple Event framework), and can be used to script Adobe 
Illustrator, which, of course, does not run on Linux.


--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: How to hide console with Popen on Windows?

2012-05-18 Thread Kevin Walzer

On 5/18/12 4:22 AM, xliiv wrote:

Like the topic, more details in followed links..


http://stackoverflow.com/questions/10637450/how-to-hide-console-with-popen-on-windows

http://code.activestate.com/recipes/409002-launching-a-subprocess-without-a-console-window/?c=14452

Please help :(
Any hint i would appreciate


There are some Windows-specific flags in the subprocess module that you 
can set to control the display of a console window. I use something like 
this:


 self.pscmd=os.path.join(execdir, 'pstools-1.1/txt2ps.exe')
   startupinfo =  subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
txtps = self.pscmd  + ' -o ' + tempfile.gettempdir() + 
'\\whois.ps' + ' ' + tmpfile

subprocess.check_output(txtps, startupinfo = startupinfo)

Hope this helps.
--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python and Tkinter by John E Grayson

2012-05-17 Thread Kevin Walzer

On 5/16/12 11:55 PM, Mark R Rivet wrote:

  I have a copy of this book and was wondering how relevant the content
is considering the publish date is 2000. Are people still using this
information? Anyone have any experience with this book? I guess what I
mean, is, any of the code in this book deprecated? or does it still
contain information used today the same as then. I mean, I guess some
things don't change right? For instance,  the derivative of x^2 is 2x
now and in the 1800's.


Mark Lutz' "Programming Python" has extensive coverage of Tkinter (it's 
a huge book and devotes several chapters to Tkinter), and has been 
updated at regular intervals, most recently in the last year or two; 
I've found it a very helpful reference and guide to Tkinter programming.


--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Carbon Event Manager (Carbon.CarbonEvt module) - working?

2012-05-15 Thread Kevin Walzer

On 5/15/12 3:06 PM, msmucr wrote:

Do I have something wrong or is it simply broken and unmaintained now?


Support for Carbon Events was removed in Python 3.x and it does not work 
in 64-bit, to my knowledge--most of the Carbon API's are not supported 
by Apple anymore.


--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: converting from tcl/tkl to python

2012-03-09 Thread Kevin Walzer

On 3/9/12 10:10 AM, Richard Boothroyd wrote:


First, I am not a developer so go easy on my ignorance ;-). Our
company designs and develops hearing aid audibility fitting equipment.
(www.audioscan.com). Our current software GUI is all based on TCL/TKL
and we are running into issues on developing a "prettier" GUI in an
effort to modernize some of our equipment.

My understanding is that Python is a much better GUI tool than TCL/TKL
so I'd appreciate any insight on this assumption. Also I'm wondering
what kind of effort and expertise it would take to convert from TCL/
TKL to Python. Let me know what further info you may require.



First, don't assume that Tcl/Tk is not up to the job. I took a look at 
some of your software screenshots at your website and noticed that you 
are using the "classic" Tk widgets, which, while functional, are a bit 
dated in their appearance. Tcl/Tk 8.5 has added a separate group of 
widgets called the ttk (for "themed Tk")  widgets that are fully native 
in appearance on Windows/Mac and much improved in their appearance on 
Linux/Unix. Here's a screenshot of a Tcl/Tk app using the ttk widgets on 
Windows:


http://sourceforge.net/p/windowstoolset/screenshot/screenshot.png

If modernizing the UI is all you need to do, a careful update of your 
code using the themed Tk widgets will take you a long way, with far less 
work and cost than porting your code to Python.


Having said this, if you are seeing other issues with Tcl (lack of 
support for certain libraries/API's, code is becoming unmanagable, etc.) 
and you have concluded that Python is a superior choice overall, then 
there are a number of different routes you can take:


1. Python's built-in GUI toolkit is a wrapper for Tk called Tkinter. 
Recent versions of Python support the themed Tk widgets as well as the 
classic Tk widgets. Doing a port of your code from Tcl/Tk to Python will 
be somewhat simpler if you use Python's Tkinter library, because the 
general layout will be similar. However, there are no automated tools 
for mapping Tk to Tkinter that I am aware of--you will have to do a 
rewrite of your code.


2. Python also has bindings for many other UI toolkits, including 
wxWidgets (a very nice cross-platform toolkit that has native UI 
bindings), Qt, Gtk, and others. If you prefer a different 
design/toolkit/API, these may be worth a look. However, if you opt for 
one of these toolkits and Python, then you are essentially starting from 
scratch with your software--it will be a complete rewrite not just in 
the programming language but also in the UI design as well. That will 
take a great deal of additional time and cost.


To sum up: a rewrite of your software in Python will amount a 
major-to-complete overhaul of the code base, depending on how you 
approach the UI design--and this will involve significant cost and time. 
This may make sense if you feel you have reached the end of the line 
with Tcl and your desire for a different language is for reasons in 
addition to the look and feel of the UI. However, if your software and 
its code is otherwise satisfactory and you need simply to update the UI 
design, that can be done in Tcl at far less cost using the ttk widgets.


Hope this helps,

Kevin
--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: How do you use the widgets in tkinter.ttk if you want to "import tkinter as tk"?

2012-03-04 Thread Kevin Walzer

On 3/3/12 12:06 AM, John Salerno wrote:

I suppose the 'advantage' of this is that it will replace tk widgets
with equivalent ttk widgets, if they exist and have the same name. I
believe one has to program them differently, however, so the replacement
cannot be transparent and one mush know anyway what gets replaced and
what not.


Grr, sounds like a pain if I want to use the new widgets. Does this cause 
conflict with someone who isn't running 8.5, or will they still see the older 
widgets as normal?

I'm tempted just to go back to wxPython. Two sets of widgets in Tkinter is a 
little annoying.


The new widgets are not a drop-in replacement for the traditional Tk 
widgets. They can be used with 8.4 if the "tile" Tk extension is 
installed. This is how the ttk widgets were first deployed; they didn't 
enter Tk's core until 8.5.

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Buffering in Wing and IDLE 3

2012-02-01 Thread Kevin Walzer

On 2/1/12 3:01 PM, Terry Reedy wrote:

On 2/1/2012 10:17 AM, Franck Ditter wrote:


I would prefer to use IDLE but as we are in France, the Python team
does not seem to be aware that the ~ and others are not available
on MacOS-X here (probably the same in Europe)...


We are quite aware of the problem but cannot directly do anything about
it as the problem is with tcl/tk and Apple. A couple of days ago, Kevin
Walzer wrote on an IDLE-sig post "I'm currently reviewing an updated
patch to address the problem. When I commit the patch, it will go into
both Tk's trunk and in the Cocoa 8.5 backport, and eventually be
available through ActiveState's distribution."


And it's been committed:

http://core.tcl.tk/tk/info/9844fe10b9

--Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Learning Python 2.4

2011-12-21 Thread Kevin Walzer

On 12/20/11 7:31 PM, Rick Johnson wrote:

Anything before Python
3.0 is now obsolete. We are currently at 3.2.2 for a stable release.


2.7 is still a supported production release of Python. It has not been 
end-of-lifed.


--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: ttk Listbox

2011-10-31 Thread Kevin Walzer

On 10/31/11 4:03 PM, Ric@rdo wrote:

On Mon, 31 Oct 2011 10:00:22 -0400, Kevin Walzer
wrote:


On 10/31/11 12:37 AM, Ric@rdo wrote:


What would be an equivalent widget in ttk like a Listbox and if
possible a small example? I tried to look here
http://docs.python.org/library/ttk.html but did not see anything.

Maybe I did not look in the right place?

tia


The listbox isn't part of the themed ttk widgets. The ttk::treview is,
and that can be set up as a single-column list display. There may be an
example of how to do this in the docs or source code tree (I don't use
the widget myself so I don't have any sample code to share).

--Kevin


Quick question:

Then why is it mentioned here
http://www.tkdocs.com/tutorial/morewidgets.html?

Listboxes are created using the Listbox function:

l = Listbox(parent, height=10)


The listbox is a Tk widget, not a ttk widget. It's one of the original 
Tk/Tkinter widgets, and has no themed equivalent.


--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: ttk Listbox

2011-10-31 Thread Kevin Walzer

On 10/31/11 12:37 AM, Ric@rdo wrote:


What would be an equivalent widget in ttk like a Listbox and if
possible a small example? I tried to look here
http://docs.python.org/library/ttk.html but did not see anything.

Maybe I did not look in the right place?

tia


The listbox isn't part of the themed ttk widgets. The ttk::treview is, 
and that can be set up as a single-column list display. There may be an 
example of how to do this in the docs or source code tree (I don't use 
the widget myself so I don't have any sample code to share).


--Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: getattr and method name

2011-10-02 Thread Kevin Walzer
Turns out the error was a typo in the actual method being 
called...*faceinhands*


Sorry for the noise.

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


getattr and method name

2011-10-02 Thread Kevin Walzer
I'm seeing a very odd error in an application I'm developing using 
Python 2.7.2, on Mac OS 10.7.


This application uses a wrapper method to look up other method names via 
getattr and then call those methods. I have not previously had an issue 
with this name, but for some reason this functionality no longer works 
as expected.


Here is the relevant code:

#run command with root privileges
def runCommand(self, cmd, *args):
try:
functionstring = args[2]
callfunction = getattr(self, functionstring.split('.')[1])
self.passtext = self.tk.call('authorize::getAuthPassword')
callfunction()
except:
try:
print cmd
functionstring = cmd.split()[2]
callfunction = getattr(self, functionstring.split('.')[1])
self.passtext = self.tk.call('authorize::getAuthPassword')
callfunction()
except:
raise

I use this approach to call the method named in the "cmd" parameter 
because I also have to look up a password name that is returned by an 
underlying Tk package that I use in my application (that's the reason 
for the 'self.tk.call'). What is happening is when I use the 
"callfunction()" call, instead of the method name being called, a string 
like this is being invoked:


<__main__.phynchronicityApp instance at 0x101b232d8>>


The "scanPackages" method (just to use it as an example) uses Popen to 
call an underlying system tool on the OS. However, when invoked via 
callfunction(), the 'bound method...' string is passed to the OS instead 
as a command! As a result, I get this output from the pipe:


/bin/sh: bound: No such file or directory

I am not sure what in my application is causing this kind of breakage, 
as earlier versions of the app ran fine with similar code on earlier 
versions on the OS. Is this the correct way to structure this kind of 
functionality, or am I better off structuring it some other way?


--Kevin
--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python bug in Windows 8--report now, or later?

2011-09-20 Thread Kevin Walzer

On 9/20/11 8:32 AM, Alec Taylor wrote:

I can confirm that os.mkdir('C:\\h') and os.path.exists('C:\\h') work
on Windows 8 Dev x64.


OK--looks like I will need to do a bit more digging into my own code. 
Thanks for clarifying.


--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Python bug in Windows 8--report now, or later?

2011-09-17 Thread Kevin Walzer
I have been testing my Python application on the just-released developer 
preview of Windows 8 and have noted an error: the application does not 
create an app folder in the user's "application data" directory. This 
causes the app to crash on startup. Manually creating the directory 
solves the problem. Since the app uses an os.mkdir() call to create the 
directory, and since the app runs fine on Windows 7, my guess is that 
the bug lies somewhere in the interaction between Python (I'm using 
ActivePython 2.7) and Windows.


Here's the relevant code:

#make preferences directory if it does not exist
def makePrefsDir(self):
self.appdir = os.path.join(os.path.join(os.environ['APPDATA'], 
'MyApp'))

if not os.path.exists(self.appdir):
os.mkdir(self.appdir)

I realize that this developer preview of Windows is still at somewhere 
between alpha- and beta-level, and it's possible things will get better. 
Should I wait to report this as a bug until Windows 8 is released, or do 
the Python developers test Python on pre-release versions of Windows?

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


Re: OSX application built with py2app can't see bundled PySide module?

2011-09-02 Thread Kevin Walzer

On 9/1/11 3:54 PM, Aaron Scott wrote:

I'm trying to deploy a Python app on OSX that was built with PySide. py2app 
packages it without issue, copying and linking a lot of PySide and Qt files in 
the process. But then, when I try to run the built app, I get this error:

Traceback (most recent call last):
   File 
"/Users/sequence/Desktop/code/dailies/dist/dailies_v02.app/Contents/Resources/__boot__.py",
 line 31, in
 _run('dailies_v02.py')
   File 
"/Users/sequence/Desktop/code/dailies/dist/dailies_v02.app/Contents/Resources/__boot__.py",
 line 28, in _run
 execfile(path, globals(), globals())
   File 
"/Users/sequence/Desktop/code/dailies/dist/dailies_v02.app/Contents/Resources/dailies_v02.py",
 line 9, in
from PySide.QtCore import *
   File "PySide/__init__.pyc", line 2, in
   File "PySide/private.pyc", line 2, in
   File "PySide/QtCore.pyc", line 18, in
   File "PySide/QtCore.pyc", line 15, in __load
ImportError: '/usr/lib/python2.6/lib-dynload/PySide/QtCore.so' not found

The weird thing is, QtCore.so IS included in the application bundle: py2app 
copied it to the build under 
Contents/Resources/lib/python2.6/lib-dynload/PySide/. Is there a reason the 
application isn't seeing this?


You might want to post this question to the MacPython list--that's where 
the py2app experts are found.


--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python Windows Extensions for Mac

2011-08-20 Thread Kevin Walzer

On 8/19/11 4:02 PM, johnny.venter wrote:


Hello, I am looking for the Python Windows Extensions to see if they can be 
installed on a Mac.THanks.



You can certainly try to install them via easy_install, I supposed, but 
it's doubtful they would do anything, as the Mac does not support win32 
API calls any more than Windows supports Cocoa/Objective-C calls.


--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: os.system() on Windows in Tkinter app spawns console window

2011-08-14 Thread Kevin Walzer

On 8/13/11 1:15 AM, Nobody wrote:

On Fri, 12 Aug 2011 22:49:32 -0400, Kevin Walzer wrote:


I'm developing a Tkinter app for a Windows customer, and the app bundles
several command-line tools (ported from Unix). I call out to these
console tools from the Tkinter app via os.system(). However, in the
frozen version of my app, when I call out to these tools, I get multiple
console windows popping up. This is jarring to say the least. Is there
any way to run the commands under the hood without the console/DOS
windows popping up?


Just a wild guess, but try explicitly redirecting the commands'
stdin/stdout/stderr. You might also consider using subprocess.call()
instead of os.system().



I've gotten the CLI commands to execute silently by setting the window 
flags for subprocess as discussed here:


http://code.activestate.com/recipes/409002-launching-a-subprocess-without-a-console-window/

These flags are apparently undocumented, but this solution works 
perfectly. Perhaps the flags should be better documented.


--Kevin
--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Ten rules to becoming a Python community member.

2011-08-14 Thread Kevin Walzer
I'd like to post a detailed response, e.g. a point-by-point engagement 
with Rantingrick's list, but as I lack time, this will have to suffice:


http://xkcd.com/386/

There! Can I get my community pin now? :-)
--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


os.system() on Windows in Tkinter app spawns console window

2011-08-12 Thread Kevin Walzer
I'm developing a Tkinter app for a Windows customer, and the app bundles 
several command-line tools (ported from Unix). I call out to these 
console tools from the Tkinter app via os.system(). However, in the 
frozen version of my app, when I call out to these tools, I get multiple 
console windows popping up. This is jarring to say the least. Is there 
any way to run the commands under the hood without the console/DOS 
windows popping up?


--Kevin
--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


DDE vs. COM for Python Windows apps

2011-08-06 Thread Kevin Walzer
I'm developing a Windows version of a Mac/Python app and I'd like to add 
a scripting interface to it. On the Mac I do this via Apple Events--this 
is an Apple technology that allows applications to drive other 
applications and query them for data using a message-passing interface. 
Each application defines a suite of commands and/or data objects that it 
will invoke, depending on which Apple Event is passed to it; these 
commands and data objects are most commonly documented in an AppleScript 
API dictionary, though there are other ways to send Apple Events as well.


On Windows, I've found two separate mechanisms that seem to offer what 
I'm looking for: Dynamic Data Exchange (DDE) and Component Object Model 
(COM). As I understand it, DDE allows data transfer and 
command-automation between applications via a lightweight 
message-passing interface. COM seems to offer similar functionality, 
with a much more complex learning curve.


The main complaint I've seen about DDE is that it is very old. The main 
complaint I've seen about COM is that it is very complex and very 
brittle. Based on my research, it seems that DDE might be sufficient for 
my needs--I want other applications to be able to send commands to my 
application and have data returned to them. But I'd like to have a 
better understanding of the merits of each.


Can someone summarize the advantages that COM might have over DDE, in a 
Pythonic context?


--Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Tkinter/py2exe with installer

2011-07-24 Thread Kevin Walzer
Can anyone point me in the direction of a Tkinter/Python app that has 
been wrapped with py2exe and is deployed on Windows as a standalone 
using one of the standard installer tools? (MSI, NSIS, Inno Setup, etc.) 
I'm working on a Tkinter app for Windows and have had a surprisingly 
hard time finding such apps to use as examples/benchmarks, etc. (The 
only one I've found, in fact, is Webgobbler at 
http://sebsauvage.net/python/webgobbler/index.html; a nice app, but I'd 
like more examples.)


--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: I am fed up with Python GUI toolkits...

2011-07-21 Thread Kevin Walzer

On 7/20/11 9:05 AM, rantingrick wrote:

On Jul 19, 9:44 pm, Kevin Walzer  wrote:


2. Bloatware. Qt and wxWidgets are C++ application frameworks. (Python
has a standard library!)


Again, so? This isn't applicable to Tk, by the way. It's a GUI toolkit
specifically designed for scripting languages.


Tk is SPECIFICALLY designed for TCL. Tkinter works ONLY by embedding a
TCL interpreter. You statements are misleading.


Of course I know this--I'm one of the core Tcl/Tk developers on my 
platform. :-) My statement was actually based on Mark Lutz's 
characterization in "Programming Python," when he defends Tk's inclusion 
in the stdlib (and his own book's extensive focus on it) by observing 
that the toolkit was specifically designed for use with scripting 
languages--Tcl at the start, but also Python, Perl, Ruby...he seemed to 
want to downplay Tk's Tcl-ish roots, as if he were embarassed by them. I 
guess it's a Tcl-ish subject.




3. Unpythonic memory management: Python references to deleted C++
objects (PyQt). Manual dialog destruction (wxPython). Parent-child
ownership might be smart in C++, but in Python we have a garbage
collector.


Again, so? Again, this isn't applicable to Tk.


He did not even mention Tk in that block, do you have a TK persecution
complex?


No, but it's an advantage that Tk has over the other ones, and an 
argument that reinventing the wheel is unncessary.





4. They might look bad (Tkinter, Swing with Jython).


Then again, they might not.  A lot depends on the skill of the
developer. I write highly polished commercial apps with Tk GUI's. I'm
sick of developers blaming their ugly apps on the toolkit rather than
their own lack of design training and/or skills.


This is true. Lots of people lack the skill to create professional
quality GUI applications however lots of GUI devs lack the skill to
create clean and intuitive API's also. Tkinter/TclTk and WxPython
\WxWidgets has lots of warts in this respect.


I think what constitutes a "clean API" is partly a matter of taste.




5. All projects to write a Python GUI toolkit die before they are
finished. (General lack of interest, bindings for Qt or wxWidgets
bloatware are mature, momentum for web development etc.)


That's right. People issue a clarion call for a new GUI toolkit, then
discover that even a so-called "ugly, limited, minimalist" toolkit like
Tk has twenty years of development behind it. And people think they can
duplicate this effort in a few months by starting a flame war on
comp.lang.python?


Just because someone wants to entertain ideas for a new GUI does mean
they are starting flame wars. I would say out all the responses so far
YOURS is the most emotional.


*shrug*

Maybe it is. I prefaced this by saying, "OK, I'll bite," which suggests 
that perhaps I shouldn't, because complaints and hand-wringing are 
really a waste of time. In the future, I think my response (if I make 
one at all) will more likely be something like this:


"An interesting idea. Please post back when you have a source code repo, 
build instructions so we can play with your code, a mailing list, and a 
license that is suitable for both open-source and proprietary development."


The most substantial effort at developing a new GUI API for Python did 
just this--PySide (alternative bindings to Qt). No hand-wringing, no 
flame wars, just an announcement of the project, an invitation to 
contribute, and so on. Whether you think it's a misguided project or an 
attempt to reinvent the wheel is beside the point--it's a substantial 
project, with both leadership and a growing community that support 
ongoing development and rapid maturation.


In my own experience, this is the only way to move things forward or 
bring about any useful change--roll up my sleeves and do it myself. I've 
done this a bit with Tkinter (maintaining bindings/wrappers to a popular 
Tk widget, tablelist), but I've done this extensively with Tk itself on 
the Mac. I complained on mailing lists for years that Tk didn't do this 
or that on the Mac, and these complaints fell on deaf ears; finally, I 
decided to dive into the deep end, learn the low-level API's to do what 
I wanted, and bingo! Suddenly Tk did what I wanted.


That's the essence of open-source development--scratching your own itch. 
Sometimes you get lucky and a large corporate entity has an itch to 
scratch, and this can bring large-scale projects with large-scale 
benefits. I believe Nokia is funding PySide. While Tk's port to the 
Mac's Cocoa API was done by a single developer, the project was funded 
by Apple. Creating a new GUI toolkit may require this scale of effort 
and investment. But even without it, if a developer can get something 
started and make enough progress to be of interest to others, then a 
larger community may move th

Re: I am fed up with Python GUI toolkits...

2011-07-19 Thread Kevin Walzer

OK, I'll bite...

On 7/19/11 10:12 PM, sturlamolden wrote:


1. Designed for other languages, particularly C++, tcl and Java.


So? Doing a GUI toolkit is a hard project.



2. Bloatware. Qt and wxWidgets are C++ application frameworks. (Python
has a standard library!)


Again, so? This isn't applicable to Tk, by the way. It's a GUI toolkit 
specifically designed for scripting languages.




3. Unpythonic memory management: Python references to deleted C++
objects (PyQt). Manual dialog destruction (wxPython). Parent-child
ownership might be smart in C++, but in Python we have a garbage
collector.


Again, so? Again, this isn't applicable to Tk.



4. They might look bad (Tkinter, Swing with Jython).


Then again, they might not.  A lot depends on the skill of the 
developer. I write highly polished commercial apps with Tk GUI's. I'm 
sick of developers blaming their ugly apps on the toolkit rather than 
their own lack of design training and/or skills.




5. All projects to write a Python GUI toolkit die before they are
finished. (General lack of interest, bindings for Qt or wxWidgets
bloatware are mature, momentum for web development etc.)


That's right. People issue a clarion call for a new GUI toolkit, then 
discover that even a so-called "ugly, limited, minimalist" toolkit like 
Tk has twenty years of development behind it. And people think they can 
duplicate this effort in a few months by starting a flame war on 
comp.lang.python?




1. Lean and mean -- do nothing but GUI. No database API, networking
API, threading API, etc.


Presenting...Tk.



2. Do as much processing in Python as possible. No more native code
(C, C++, Cython) than needed.


And what's wrong with native (ie. compiled) code? Python is written in 
native code, isn't it? To extend Python in significant ways, it is often 
necessary to drop down into native code.




3. Instances of extension types can clean themselves up on
deallocation. No parent-child ownership model to mess things up. No
manual clean-up. Python does all the reference counting we need.


Presenting...Tk.



4. No artist framework. Use OpenGL, Cairo, AGG or whatever else is
suitable.


"Artist framework"? I'm not sure what you mean here.



5. No particular GUI thread synchronization is needed  -- Python has a
GIL.


No comment here.


6. Expose the event loop to Python.


Presenting...Tk.


7. Preferably BSD-style license, not even LGPL.


Presenting...Tk.


8. Written for Python in Python -- not bindings for a C++ or tcl
toolkit.


Well, that's the holy grail, but given the history of other toolkits, 
you'll reach a comparable level of maturity in 2031.





The Eclipse SWT library does some of this for Java does some of this,
though it also has flaws (e.g. manual memory management). A Python GUI
toolkit could be partially based on the SWT code.


Your practical suggestion for the basis for a new Python GUI toolkit 
is...a Java GUI toolkit? I'm quite confused.


Is it worth the hassle to start a new GUI toolkit project?


Not unless you want to reinvent the wheel yet again.


Or should modern deskop apps be written with something completely
different, such as HTML5?


If it's written in HTML5, it is, by definition, not a desktop app.

--Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-11 Thread Kevin Walzer

On 7/11/11 2:28 PM, Ivan Kljaic wrote:

Did you notice that 2 of these 4 are not for python? One is out of dTe
and one has a fucked up licence. Sorry guys but there is not even one
single rad gui tool for python as long as there is no serious
guibuilder.


One reason there hasn't been much demand for a GUI builder is that, in 
many cases, it's just as simpler or simpler to code a GUI by hand. 
Certainly with the Tkinter library this is trivial. The only GUI builder 
I've ever used that was arguably superior to hand-coding is Interface 
Builder, on Mac OS X, and it's truly needed there. (The Cocoa frameworks 
don't really lend themselves to hand-coding.) Otherwise I find GUI 
builders inflexible, and more trouble than they are worth.


--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-11 Thread Kevin Walzer

On 7/10/11 6:50 PM, Ivan Kljaic wrote:

Ok Guys. I know that most of us have been expiriencing the need for a
nice Gui builder tool for RAD and most of us have been googling for it
a lot of times. But seriously. Why is the not even one single RAD tool
for Python. I mean what happened to boa constructor that it stopped
developing. I simply do not see any reasons why there isn't anything.
Please help me understand it. Any insights?


http://pyobjc.sourceforge.net/

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


Re: trouble creating tooltips using Wx in Tk canvas

2011-07-06 Thread Kevin Walzer

On 7/6/11 3:35 PM, Ravikanth wrote:


As it says, you haven't created the wx.App object necessary for pretty
much all wxPython code.  You could create one, but your tooltip still
would not work correctly because you would be running the Tkinter
event loop rather than the wxPython event loop.  If you want to use
the wxToolTip widget, then you should write your program to use
wxPython only.  Alternatively, googling for "tkinter tooltip" turns up
a couple of recipes; you could try one of those.

Cheers,
Ian


Thank you Ian for your insights to me on this.
I will migrate to wxPython to achieve the functionality.


Tooltips are trivial to create in Tkinter:

http://tkinter.unpythonic.net/wiki/ToolTip

--Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list


  1   2   3   4   >