Re: Trouble getting to windows My Documents directory

2015-07-11 Thread Chris Warrick
On 11 July 2015 at 02:24,   wrote:
> The My Documents directory is not guaranteed to be named "Documents". On
> older versions of windows it was "My Documents", and on foreign versions
> of windows it is a name in their language.

That’s not necessarily “older”.

Windows XP/7/8: My Documents
Windows Vista/8.1: Documents

As for localized versions, Vista and up do the translation in Windows
Explorer but use English names on disk.

…but even with all that, users (or their administrators) can move the
My Documents folder away from the home directory (to a file server,
for example).

-- 
Chris Warrick 
PGP: 5EAAEA16
-- 
https://mail.python.org/mailman/listinfo/python-list


How to use Tornado.gen.coroutine in TCP Server?

2015-07-11 Thread Zely Zon
hi ,evreyone!
i want to know how to user tornado.gen.coroutine in Tcp server?
here is my  question  link in stackoverflow.  
http://stackoverflow.com/questions/31353861/how-to-use-tornado-gen-coroutine-in-tcp-server
thank you !
-- 
https://mail.python.org/mailman/listinfo/python-list


Python 3.5.0b3(64 bit) - idle refused to work on windows 7 desktop pc.

2015-07-11 Thread Simon Ball

Good morning,

Everything else appeared to work though.
Kept getting the windows 'donut' telling
me it was doing something, but then
the program did not appear.

Windows 7 Home Premium Service Pack 1 intel 64 bit pc.

Kind regards
Simon Ball

Luton
Bedfordshire
UK


--
Using Opera's mail client: http://www.opera.com/mail/
--
https://mail.python.org/mailman/listinfo/python-list


beginners choice: wx or tk?

2015-07-11 Thread Ulli Horlacher
I want to start a project with python.
The program must have a (simple) GUI and must run on Linux and Windows.
The last one as standalone executable, created with pyinstaller.

I have already an implementation in perl/tk :
http://fex.rus.uni-stuttgart.de/fop/ZAcXSugp/schwuppdiwupp.png
http://fex.belwue.de/download/schwuppdiwupp.pl

I am not really happy with tk, because it has some bugs, at least its perl
integration. I have never used wx.

What is the recommendation for a python beginner: wx or tk?


-- 
Ullrich Horlacher  Server und Virtualisierung
Rechenzentrum IZUS/TIK E-Mail: [email protected]
Universitaet Stuttgart Tel:++49-711-68565868
Allmandring 30aFax:++49-711-682357
70550 Stuttgart (Germany)  WWW:http://www.tik.uni-stuttgart.de/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: beginners choice: wx or tk?

2015-07-11 Thread Chris Angelico
On Sat, Jul 11, 2015 at 7:28 PM, Ulli Horlacher
 wrote:
> I want to start a project with python.
> The program must have a (simple) GUI and must run on Linux and Windows.
> The last one as standalone executable, created with pyinstaller.

Not sure what your advantage is with pyinstaller, it adds a level of
complication that doesn't usually justify itself IMO.

> I have already an implementation in perl/tk :
> http://fex.rus.uni-stuttgart.de/fop/ZAcXSugp/schwuppdiwupp.png
> http://fex.belwue.de/download/schwuppdiwupp.pl
>
> I am not really happy with tk, because it has some bugs, at least its perl
> integration. I have never used wx.
>
> What is the recommendation for a python beginner: wx or tk?

Using wxPython means you need another library, while tkinter comes
with Python. There are some limitations to tk, and I personally don't
like its style, but if you're wanting to package it up into an EXE,
every third-party library you add will increase the size of that EXE,
potentially quite significantly (wxPython will drag in everything that
it depends on, which IIRC is quite a bit).

There are other choices, too - pygtk/pygobject (GTK) and pyqt (Qt)
come to mind - is there a particular reason you're limiting the
question to just wx vs tk?

Personally, I quite like GTK, but I don't have much experience with
either of the Python bindings. Never used wxPython or PyQt.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: beginners choice: wx or tk?

2015-07-11 Thread Ulli Horlacher
Chris Angelico  wrote:

> On Sat, Jul 11, 2015 at 7:28 PM, Ulli Horlacher
>  wrote:
> > I want to start a project with python.
> > The program must have a (simple) GUI and must run on Linux and Windows.
> > The last one as standalone executable, created with pyinstaller.
> 
> Not sure what your advantage is with pyinstaller, it adds a level of
> complication that doesn't usually justify itself IMO.

I am not addicted to pyinstaller. It just works.
Do you have a better alternative?


> Using wxPython means you need another library, while tkinter comes
> with Python. 

pyinstaller can make a standalone executable, there is no need for the
users to install "another library". They just click on the program icon,
that's it.


> There are other choices, too - pygtk/pygobject (GTK) and pyqt (Qt)
> come to mind

Both create BIG executables, much bigger than with wx or tk.


-- 
Ullrich Horlacher  Server und Virtualisierung
Rechenzentrum IZUS/TIK E-Mail: [email protected]
Universitaet Stuttgart Tel:++49-711-68565868
Allmandring 30aFax:++49-711-682357
70550 Stuttgart (Germany)  WWW:http://www.tik.uni-stuttgart.de/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3.5.0b3(64 bit) - idle refused to work on windows 7 desktop pc.

2015-07-11 Thread Mark Lawrence

On 11/07/2015 10:06, Simon Ball wrote:

Good morning,

Everything else appeared to work though.
Kept getting the windows 'donut' telling
me it was doing something, but then
the program did not appear.

Windows 7 Home Premium Service Pack 1 intel 64 bit pc.

Kind regards
Simon Ball

Luton
Bedfordshire
UK



Please state exactly what you did to try and run the program, e.g. click 
on a desktop shortcut or something on the start menu, or what you typed 
at the command line prompt.


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Re: beginners choice: wx or tk?

2015-07-11 Thread Mark Lawrence

On 11/07/2015 10:28, Ulli Horlacher wrote:

I want to start a project with python.
The program must have a (simple) GUI and must run on Linux and Windows.
The last one as standalone executable, created with pyinstaller.

I have already an implementation in perl/tk :
http://fex.rus.uni-stuttgart.de/fop/ZAcXSugp/schwuppdiwupp.png
http://fex.belwue.de/download/schwuppdiwupp.pl

I am not really happy with tk, because it has some bugs, at least its perl
integration. I have never used wx.

What is the recommendation for a python beginner: wx or tk?



Right now if you only have the choice of wx or tk I'd stick with tk as 
it comes with Python 2 and 3, whereas wx is still in development for 3. 
 However as Chris Angelico has already said there are other choices, 
see here https://wiki.python.org/moin/GuiProgramming for a comprehensive 
list.


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Re: beginners choice: wx or tk?

2015-07-11 Thread Christian Gollwitzer

Am 11.07.15 um 11:28 schrieb Ulli Horlacher:

I want to start a project with python.
The program must have a (simple) GUI and must run on Linux and Windows.
The last one as standalone executable, created with pyinstaller.

I have already an implementation in perl/tk :
http://fex.rus.uni-stuttgart.de/fop/ZAcXSugp/schwuppdiwupp.png
http://fex.belwue.de/download/schwuppdiwupp.pl


May I ask what is the reason to port this over to Python? Is it to learn 
Python, or do you want to use packages that are not available for Perl?


Christian
--
https://mail.python.org/mailman/listinfo/python-list


Re: beginners choice: wx or tk?

2015-07-11 Thread Chris Angelico
On Sat, Jul 11, 2015 at 7:51 PM, Ulli Horlacher
 wrote:
> Chris Angelico  wrote:
>
>> On Sat, Jul 11, 2015 at 7:28 PM, Ulli Horlacher
>>  wrote:
>> > I want to start a project with python.
>> > The program must have a (simple) GUI and must run on Linux and Windows.
>> > The last one as standalone executable, created with pyinstaller.
>>
>> Not sure what your advantage is with pyinstaller, it adds a level of
>> complication that doesn't usually justify itself IMO.
>
> I am not addicted to pyinstaller. It just works.
> Do you have a better alternative?
>
>
>> Using wxPython means you need another library, while tkinter comes
>> with Python.
>
> pyinstaller can make a standalone executable, there is no need for the
> users to install "another library". They just click on the program icon,
> that's it.

Yeah, I'd distribute the .py files and have done with it. Maybe do it
up as a package and distribute it via pip, which allows you to fetch
dependencies automatically. The supposed ease of "just click on the
program icon" is all very well, but it means you have to have a
whopping new download any time there's an update to your code (they
have to redownload the entire binary even if you're using the same
Python and the same libraries), and you have to distribute a whole
bunch of different versions (32-bit vs 64-bit, possibly different
builds for different Windowses, etc), and deal with the support issues
from people who grabbed the wrong one. Once Python itself has been
installed, users can still normally "just click on the program icon"
even though it's a .py file - that's the whole point of file
associations. And then their installed Python can be updated by the
normal mechanisms, and your code will happily run on the new version.
Suppose, for instance, that your program does something over HTTPS,
and people are using it in a critical environment... and then someone
discovers a flaw in OpenSSL, which has happened now and then. A bugfix
release of CPython will fix that instantly for everyone who's using
the standard python.org downloads; but if you've packaged up your own
Python, it'll be frozen at whatever version you had when you built
that - which might not even be the latest available at the time. How
quickly will you get around to building new installers?

Much better to distribute Python code without an interpreter, and let
people get their own interpreters.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


0 + not 0

2015-07-11 Thread candide
>>> 0 + not 0
  File "", line 1
0 + not 0
  ^
SyntaxError: invalid syntax
>>>


What is syntactically wrong with 0 + not 0?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: 0 + not 0

2015-07-11 Thread Chris Angelico
On Sat, Jul 11, 2015 at 8:26 PM, candide  wrote:
 0 + not 0
>   File "", line 1
> 0 + not 0
>   ^
> SyntaxError: invalid syntax

>
>
> What is syntactically wrong with 0 + not 0?

I'm actually not sure why this can't be handled. Possibly it's a
limitation of the parser. Certainly 0 + (not 0) works just fine. This
suggests that the exponentiation operator may have been special-cased
to cope with this:

https://docs.python.org/3/reference/expressions.html#id21

So maybe there's just no corresponding special case for this - which,
I have to say, is not exactly a common construct.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: 0 + not 0

2015-07-11 Thread Irmen de Jong
On 11-7-2015 12:26, candide wrote:
 0 + not 0
>   File "", line 1
> 0 + not 0
>   ^
> SyntaxError: invalid syntax

> 
> 
> What is syntactically wrong with 0 + not 0?
> 

I would say that the boolean operator 'not' cannot occur in an arithmetic 
expression.
Maybe you meant to use the bitwise not:

>>> 0 + ~0
-1


Irmen
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: 0 + not 0

2015-07-11 Thread Luuk

On 11-7-2015 12:38, Irmen de Jong wrote:

On 11-7-2015 12:26, candide wrote:

0 + not 0

   File "", line 1
 0 + not 0
   ^
SyntaxError: invalid syntax





What is syntactically wrong with 0 + not 0?



I would say that the boolean operator 'not' cannot occur in an arithmetic 
expression.
Maybe you meant to use the bitwise not:


0 + ~0

-1


Irmen



It can occur in an arithmetic expression, and 'not' has a higher 
precedence than '+'

(https://docs.python.org/2/reference/expressions.html#operator-precedence)

0 + not 0
should evalutate to
0 + True
1

just like this does:
0 + (not 0)
1


True + True
2

But, it gets confusing..
>>> not 0 + 1
False
>>> not 0
True
>>> True + 1
2
>>>

i would expect 'not 0 + 1' to return the same value as 'True + 1'


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


Re: 0 + not 0

2015-07-11 Thread Chris Angelico
On Sat, Jul 11, 2015 at 9:12 PM, Luuk  wrote:
> It can occur in an arithmetic expression, and 'not' has a higher precedence
> than '+'
> (https://docs.python.org/2/reference/expressions.html#operator-precedence)
>

I think you're misreading the table; 'not' has *lower* precedence than '+'.

> But, it gets confusing..
 not 0 + 1
> False
 not 0
> True
 True + 1
> 2

>
> i would expect 'not 0 + 1' to return the same value as 'True + 1'

(not 0 + 1) == (not (0 + 1))

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: beginners choice: wx or tk?

2015-07-11 Thread Laura Creighton
In a message of Sat, 11 Jul 2015 09:28:43 -, Ulli Horlacher writes:
>I want to start a project with python.
>The program must have a (simple) GUI and must run on Linux and Windows.
>The last one as standalone executable, created with pyinstaller.
>
>I have already an implementation in perl/tk :
>http://fex.rus.uni-stuttgart.de/fop/ZAcXSugp/schwuppdiwupp.png
>http://fex.belwue.de/download/schwuppdiwupp.pl
>
>I am not really happy with tk, because it has some bugs, at least its perl
>integration. I have never used wx.
>
>What is the recommendation for a python beginner: wx or tk?
>
>-- 
>Ullrich Horlacher  Server und Virtualisierung
>Rechenzentrum IZUS/TIK E-Mail: [email protected]
>Universitaet Stuttgart Tel:++49-711-68565868
>Allmandring 30aFax:++49-711-682357
>70550 Stuttgart (Germany)  WWW:http://www.tik.uni-stuttgart.de/

If you already have a tk version, then tkinter will be a whole lot
more familiar with you.  The question is, why do you want to reimplement
this thing in Python?  If the plan is to get rid of some perl and tk
bugs, then it would be good to check if the bugs exist in tkinter +
python as well.

One of the strengths of wxPython was supposed to be that the signatures
of things was very like what windows developers were already used to
when writing windows code.  Since I never had a windows machine to
develop code on, I wasn't one of the people who was already used to
things like this, so that was no benefit to me.  I tried it for a bit
and discovered I liked PyQT better, so I learned that instead.  But
I don't think that this means that one is better than the other, so
much as 'try them for a bit and see what you like'.

Tk works with Python 3.  wxPython doesn't yet.  So if your porting is
being done 'because I want to learn Python' then it is probably Python
3 you want to learn, so that's a strong reason to use tkinter.

Also, if you need your app to work with MacOS, be warned that you
will need an older version of tk than the most recent one.
This information is current: https://www.python.org/download/mac/tcltk/
Don't use 8.6

I'd also recommend kivy, which has the added advantage that if
somebody wants to use your app from a cellphone or a tablet, it
will just work.  see: http://kivy.org/#home

Laura

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


Re: 0 + not 0

2015-07-11 Thread Luuk

On 11-7-2015 13:20, Chris Angelico wrote:

On Sat, Jul 11, 2015 at 9:12 PM, Luuk  wrote:

It can occur in an arithmetic expression, and 'not' has a higher precedence
than '+'
(https://docs.python.org/2/reference/expressions.html#operator-precedence)



I think you're misreading the table; 'not' has *lower* precedence than '+'.


But, it gets confusing..

not 0 + 1

False

not 0

True

True + 1

2




i would expect 'not 0 + 1' to return the same value as 'True + 1'


(not 0 + 1) == (not (0 + 1))

ChrisA



But operator precedence of 'not' is higher than of '+' 
--
https://mail.python.org/mailman/listinfo/python-list


Re: 0 + not 0

2015-07-11 Thread candide
Le samedi 11 juillet 2015 13:21:03 UTC+2, Chris Angelico a écrit :
> I think you're misreading the table; 'not' has *lower* precedence than '+'.
> 


Right but Python docs helps a lot in misreading ;) Following the iconicity 
principle, it's pretty obvious that one has to display table priority beginning 
with items having the highest priority, cf. for instance table operator 
precedence for Java provided by oracle tutorial or for the C language as given 
by the K&R book.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: 0 + not 0

2015-07-11 Thread candide
Le samedi 11 juillet 2015 13:31:03 UTC+2, Luuk a écrit :

> 
> But operator precedence of 'not' is higher than of '+' 


Right but what does this prove? For instance, unary minus has higher precedence 
than exponentiation but the expression

2 ** -1

doesn't raise a syntax error.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: beginners choice: wx or tk?

2015-07-11 Thread Christian Gollwitzer

Am 11.07.15 um 13:27 schrieb Laura Creighton:

Also, if you need your app to work with MacOS, be warned that you
will need an older version of tk than the most recent one.
This information is current: https://www.python.org/download/mac/tcltk/
Don't use 8.6


I'm not sure how recent this really is. Kevin Walzer has done a lot of 
work to get recent Tcl/Tk (i.e. 8.6) running on OSX. The most recent 
ActiveTcl release is 8.6.4.1. I'm using exclusively Tk 8.6 on the Mac 
without problems.


Christian
--
https://mail.python.org/mailman/listinfo/python-list


Re: 0 + not 0

2015-07-11 Thread Chris Angelico
On Sat, Jul 11, 2015 at 9:54 PM, candide  wrote:
> Le samedi 11 juillet 2015 13:31:03 UTC+2, Luuk a écrit :
>
>>
>> But operator precedence of 'not' is higher than of '+' 
>
>
> Right but what does this prove? For instance, unary minus has higher 
> precedence than exponentiation but the expression
>
> 2 ** -1
>
> doesn't raise a syntax error.

You'll see down below a footnote referring to this as a special case.
But I don't know the details of how it all works, so short of digging
into the source code, I can't explain this any better. There are
others on this list who can, I believe.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: 0 + not 0

2015-07-11 Thread candide
Le samedi 11 juillet 2015 14:05:58 UTC+2, Chris Angelico a écrit :

> You'll see down below a footnote referring to this as a special case.

I didn't spot the footnote and I don't regard it as dealing with a "special 
case": the footnote is paraphrasing the precedence hierarchy given by the 
table. I  see it more as a glose (operator exponentiation is not so common in 
programming languages) or, better, a warning because precedence of unary minus 
is "between" two "multiplicative" operators (** and *).

By the way, example provided by the doc in this footnote doesnt't properly 
illustrate the precedence of ** versus unary minus : whatever the precedence 
is, there is only one way to evaluate 2**-1. On the opposite, -1**2 (for 
instance) leads to two evaluations : (-1)**2 and -(1**2) and would provide an 
appropriate and better example.




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


Re: 0 + not 0

2015-07-11 Thread Serhiy Storchaka

On 11.07.15 13:26, candide wrote:

0 + not 0

   File "", line 1
 0 + not 0
   ^
SyntaxError: invalid syntax





What is syntactically wrong with 0 + not 0?


This looks as a bug to me. Please file a report on http://bugs.python.org.


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


Re: beginners choice: wx or tk?

2015-07-11 Thread Laura Creighton
In a message of Sat, 11 Jul 2015 13:56:09 +0200, Christian Gollwitzer writes:
>Am 11.07.15 um 13:27 schrieb Laura Creighton:
>> Also, if you need your app to work with MacOS, be warned that you
>> will need an older version of tk than the most recent one.
>> This information is current: https://www.python.org/download/mac/tcltk/
>> Don't use 8.6
>
>I'm not sure how recent this really is. Kevin Walzer has done a lot of 
>work to get recent Tcl/Tk (i.e. 8.6) running on OSX. The most recent 
>ActiveTcl release is 8.6.4.1. I'm using exclusively Tk 8.6 on the Mac 
>without problems.
>
>   Christian

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.

Laura
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: 0 + not 0

2015-07-11 Thread candide
Le samedi 11 juillet 2015 15:38:51 UTC+2, Serhiy Storchaka a écrit :

> This looks as a bug to me. Please file a report on http://bugs.python.org.


OK, I'll report.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: beginners choice: wx or tk?

2015-07-11 Thread Ned Deily
In article <[email protected]>,
 Laura Creighton  wrote:
> In a message of Sat, 11 Jul 2015 13:56:09 +0200, Christian Gollwitzer writes:
> >Am 11.07.15 um 13:27 schrieb Laura Creighton:
> >> Also, if you need your app to work with MacOS, be warned that you
> >> will need an older version of tk than the most recent one.
> >> This information is current: https://www.python.org/download/mac/tcltk/
> >> Don't use 8.6
> >I'm not sure how recent this really is. Kevin Walzer has done a lot of 
> >work to get recent Tcl/Tk (i.e. 8.6) running on OSX. The most recent 
> >ActiveTcl release is 8.6.4.1. I'm using exclusively Tk 8.6 on the Mac 
> >without problems.
> 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.

Apple still does not ship 8.6 with OS X, only 8.5 (as of OS X 10.6) and, 
for backwards compatibility, 8.4.  That's why the python.org Python 
installers for OS X do not yet use 8.6.  ActiveState does provide an OS 
X installer for Tcl/Tk 8.6 but it is not open source; assuming your use 
is compatible with their (liberal) license, you can build your own 
Python linking with it.  Also, some third-party package managers for OS 
X supply a Python linked with their own Tcl/Tk 8.6, e.g. MacPorts.  We 
haven't wanted to get into the business of building and shipping our own 
Tcl/Tk for python.org OS X installers but, because of Apple's recent 
poor support for Tcl/Tk, we more or less need to; it's on the list of 
future enhancements.

-- 
 Ned Deily,
 [email protected]

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


Python Error: ImportError: No module named ''folder_name’ at Command Prompt

2015-07-11 Thread Ernest Bonat, Ph.D.
Hi All,


I’m doing a CSV data analysis in Python using Eclipse IDE/PyDev. I have
organized my project using the standard MVC architecture. In Eclipse IDE
everything is working properly. When I run my main.py file it at Command
Prompt I got an error: ImportError: No module named 'folder_name'. It’s
like the location path of the ‘'folder_name’ was not found. Do I need to
update my main.py file to run it at the Command Prompt?


Thank you for all your help,


Thanks

Ernest Bonat, Ph.D.
Senior Software Engineer | Senior Data Analyst
Visual WWW, Inc. | President and CEO
115 NE 39th Avenue | Hillsboro, OR 97124
Cell: 503.730.4556 | Email: [email protected]

*The content of this email is confidential. It is intended only for the use
of the persons named above. If you are not the intended recipient, you are
hereby notified that any review, dissemination, distribution or duplication
of this communication is strictly prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message.*
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: beginners choice: wx or tk?

2015-07-11 Thread Ulli Horlacher
Laura Creighton  wrote:

> The question is, why do you want to reimplement this thing in Python? 

The Windows support of perl/pp (a perl "compiler" similar to pyinstall) is
really bad. It does not work any more with Windows 7, I still have to use
Windows XP.


> If the plan is to get rid of some perl and tk bugs, then it would be good
> to check if the bugs exist in tkinter + python as well.

It's on my checklist :-)


> Tk works with Python 3.  wxPython doesn't yet.
> So if your porting is being done 'because I want to learn Python' then it
> is probably Python 3 you want to learn, so that's a strong reason to use
> tkinter.

Indeed! Thanks for the warning!
Then I will go with python+tk.


> I'd also recommend kivy, which has the added advantage that if
> somebody wants to use your app from a cellphone or a tablet, it
> will just work.  see: http://kivy.org/#home

Is it compatible with pyinstall?
My main target architecture is Windows, for which I need a standalone
executable.

-- 
Ullrich Horlacher  Server und Virtualisierung
Rechenzentrum IZUS/TIK E-Mail: [email protected]
Universitaet Stuttgart Tel:++49-711-68565868
Allmandring 30aFax:++49-711-682357
70550 Stuttgart (Germany)  WWW:http://www.tik.uni-stuttgart.de/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: beginners choice: wx or tk?

2015-07-11 Thread Ulli Horlacher
Christian Gollwitzer  wrote:

> > I have already an implementation in perl/tk :
> > http://fex.rus.uni-stuttgart.de/fop/ZAcXSugp/schwuppdiwupp.png
> > http://fex.belwue.de/download/schwuppdiwupp.pl
> 
> May I ask what is the reason to port this over to Python? Is it to learn 
> Python, or do you want to use packages that are not available for Perl?

Both is true.
It is a nice project to start learning python and perl/pp does not work
any more with Windows 7, when one needs SSL/TLS.

-- 
Ullrich Horlacher  Server und Virtualisierung
Rechenzentrum IZUS/TIK E-Mail: [email protected]
Universitaet Stuttgart Tel:++49-711-68565868
Allmandring 30aFax:++49-711-682357
70550 Stuttgart (Germany)  WWW:http://www.tik.uni-stuttgart.de/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: 0 + not 0

2015-07-11 Thread MRAB

On 2015-07-11 17:02, Stefan Ram wrote:

Serhiy Storchaka  writes:

On 11.07.15 13:26, candide wrote:

0 + not 0

   File "", line 1
 0 + not 0
   ^
SyntaxError: invalid syntax
What is syntactically wrong with 0 + not 0?

This looks as a bug to me. Please file a report


   I look at Python 3.4.3:

a_expr ::=  m_expr | a_expr "+" m_expr | a_expr "-" m_expr

   So, »not 0« must be an »m_expr« when used as the right operand of »+«.

m_expr ::=  u_expr | m_expr "*" u_expr | m_expr "//" u_expr | m_expr "/" u_expr | m_expr 
"%" u_expr
u_expr ::=  power | "-" u_expr | "+" u_expr | "~" u_expr
power ::=  primary ["**" u_expr]
primary ::=  atom | attributeref | subscription | slicing | call
atom  ::=  identifier | literal | enclosure
enclosure ::=  parenth_form | list_display | dict_display | set_display | 
generator_expression | yield_atom

   How can there be a »not«?

   »not« is used in

not_test ::=  comparison | "not" not_test
and_test ::=  not_test | and_test "and" not_test
or_test  ::=  and_test | or_test "or" and_test
conditional_expression ::=  or_test ["if" or_test "else" expression]
expression_nocond  ::=  or_test | lambda_expr_nocond
expression ::=  conditional_expression | lambda_expr

   , but an »expression« is not an »m_expr«.


If "not" had the high priority of unary "-", then:

not a < b

would be parsed as:

(not a) < b

If you extended the OP's example to:

0 + not 0 + 0

and permitted "not" in that position, it wouldn't be parsed as:

0 + (not 0) + 0

but as:

0 + (not (0 + 0))

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


Re: beginners choice: wx or tk?

2015-07-11 Thread nickgeovanis
I've recently been facing the same question but with a new (probably simpler) 
app than your own. I've decided to re-implement what I have in tk, replacing 
GTK in the python code. I am no expert in either but I find tk to be more 
coherent at the API level and better documented. However Windows and Mac 
support is not necessarily an issue for me.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: beginners choice: wx or tk?

2015-07-11 Thread Ian Kelly
On Sat, Jul 11, 2015 at 3:35 AM, Chris Angelico  wrote:
> On Sat, Jul 11, 2015 at 7:28 PM, Ulli Horlacher
>  wrote:
>> I want to start a project with python.
>> The program must have a (simple) GUI and must run on Linux and Windows.
>> The last one as standalone executable, created with pyinstaller.
>
> Not sure what your advantage is with pyinstaller, it adds a level of
> complication that doesn't usually justify itself IMO.
>
>> I have already an implementation in perl/tk :
>> http://fex.rus.uni-stuttgart.de/fop/ZAcXSugp/schwuppdiwupp.png
>> http://fex.belwue.de/download/schwuppdiwupp.pl
>>
>> I am not really happy with tk, because it has some bugs, at least its perl
>> integration. I have never used wx.
>>
>> What is the recommendation for a python beginner: wx or tk?
>
> Using wxPython means you need another library, while tkinter comes
> with Python. There are some limitations to tk, and I personally don't
> like its style, but if you're wanting to package it up into an EXE,
> every third-party library you add will increase the size of that EXE,
> potentially quite significantly (wxPython will drag in everything that
> it depends on, which IIRC is quite a bit).

I've worked with wxPython + pyInstaller in the past, and IIRC the
total size of those dependencies (roughly Python + wxPython +
matplotlib + numpy + cx_Oracle + sqlalchemy + pywin32) clocked in at
around 20 MB.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: 0 + not 0

2015-07-11 Thread Ian Kelly
On Sat, Jul 11, 2015 at 10:02 AM, Stefan Ram  wrote:
>   I look at Python 3.4.3:
>
> a_expr ::=  m_expr | a_expr "+" m_expr | a_expr "-" m_expr
>
>   So, »not 0« must be an »m_expr« when used as the right operand of »+«.
>
> m_expr ::=  u_expr | m_expr "*" u_expr | m_expr "//" u_expr | m_expr "/" 
> u_expr | m_expr "%" u_expr
> u_expr ::=  power | "-" u_expr | "+" u_expr | "~" u_expr
> power ::=  primary ["**" u_expr]
> primary ::=  atom | attributeref | subscription | slicing | call
> atom  ::=  identifier | literal | enclosure
> enclosure ::=  parenth_form | list_display | dict_display | set_display | 
> generator_expression | yield_atom
>
>   How can there be a »not«?
>
>   »not« is used in
>
> not_test ::=  comparison | "not" not_test
> and_test ::=  not_test | and_test "and" not_test
> or_test  ::=  and_test | or_test "or" and_test
> conditional_expression ::=  or_test ["if" or_test "else" expression]
> expression_nocond  ::=  or_test | lambda_expr_nocond
> expression ::=  conditional_expression | lambda_expr
>
>   , but an »expression« is not an »m_expr«.

I must concur. The grammar as written does not actually produce 1 +
not 0. I think it's still worthwhile opening a bug, because the
behavior is surprising and possibly not intentional.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: beginners choice: wx or tk?

2015-07-11 Thread John Ladasky
On Saturday, July 11, 2015 at 2:51:32 AM UTC-7, Ulli Horlacher wrote:
> Chris Angelico  wrote:
> > There are other choices, too - pygtk/pygobject (GTK) and pyqt (Qt)
> > come to mind
> 
> Both create BIG executables, much bigger than with wx or tk.

I worked with wxPython back when I was using Python 2.  I got impatient waiting 
for Phoenix when I switched to Python 3, so I started using PyQt as my GUI.  

I'm happy with PyQt.  I haven't created standalone executable files with it, 
though.  Do they necessarily have to be large?  I would think that well-written 
import statements would cut down on the file size.  Just import the objects you 
need, rather than the whole namespace.  PyQt is even organized in sub-modules, 
apparently to encourage you to refrain from importing everything.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: beginners choice: wx or tk?

2015-07-11 Thread Laura Creighton
In a message of Sat, 11 Jul 2015 16:01:05 -, Ulli Horlacher writes:
>> I'd also recommend kivy, which has the added advantage that if
>> somebody wants to use your app from a cellphone or a tablet, it
>> will just work.  see: http://kivy.org/#home
>
>Is it compatible with pyinstall?
>My main target architecture is Windows, for which I need a standalone
>executable.

Kivy has its own way to make standalone windows executables, which
uses pyinstallers.

see: http://kivy.org/docs/guide/packaging.html

Laura

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


Re: beginners choice: wx or tk?

2015-07-11 Thread Chris Angelico
On Sun, Jul 12, 2015 at 3:25 AM, John Ladasky
 wrote:
> On Saturday, July 11, 2015 at 2:51:32 AM UTC-7, Ulli Horlacher wrote:
>> Chris Angelico  wrote:
>> > There are other choices, too - pygtk/pygobject (GTK) and pyqt (Qt)
>> > come to mind
>>
>> Both create BIG executables, much bigger than with wx or tk.
>
> I worked with wxPython back when I was using Python 2.  I got impatient 
> waiting for Phoenix when I switched to Python 3, so I started using PyQt as 
> my GUI.
>
> I'm happy with PyQt.  I haven't created standalone executable files with it, 
> though.  Do they necessarily have to be large?  I would think that 
> well-written import statements would cut down on the file size.  Just import 
> the objects you need, rather than the whole namespace.  PyQt is even 
> organized in sub-modules, apparently to encourage you to refrain from 
> importing everything.
>

If there are submodules that you aren't importing, then it's possible
they don't need to be included. But if you just import a few names
from a module, you still need the entire module to be included.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: beginners choice: wx or tk?

2015-07-11 Thread Laura Creighton
In a message of Sat, 11 Jul 2015 19:37:17 +0200, Laura Creighton writes:
>Kivy has its own way to make standalone windows executables, which
>uses pyinstallers.

s/pyinstallers/PyInstaller/  sorry about that.

Laura


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


Re: 0 + not 0

2015-07-11 Thread Mark Lawrence

On 11/07/2015 17:56, Ian Kelly wrote:

On Sat, Jul 11, 2015 at 10:02 AM, Stefan Ram  wrote:

   I look at Python 3.4.3:

a_expr ::=  m_expr | a_expr "+" m_expr | a_expr "-" m_expr

   So, »not 0« must be an »m_expr« when used as the right operand of »+«.

m_expr ::=  u_expr | m_expr "*" u_expr | m_expr "//" u_expr | m_expr "/" u_expr | m_expr 
"%" u_expr
u_expr ::=  power | "-" u_expr | "+" u_expr | "~" u_expr
power ::=  primary ["**" u_expr]
primary ::=  atom | attributeref | subscription | slicing | call
atom  ::=  identifier | literal | enclosure
enclosure ::=  parenth_form | list_display | dict_display | set_display | 
generator_expression | yield_atom

   How can there be a »not«?

   »not« is used in

not_test ::=  comparison | "not" not_test
and_test ::=  not_test | and_test "and" not_test
or_test  ::=  and_test | or_test "or" and_test
conditional_expression ::=  or_test ["if" or_test "else" expression]
expression_nocond  ::=  or_test | lambda_expr_nocond
expression ::=  conditional_expression | lambda_expr

   , but an »expression« is not an »m_expr«.


I must concur. The grammar as written does not actually produce 1 +
not 0. I think it's still worthwhile opening a bug, because the
behavior is surprising and possibly not intentional.



http://bugs.python.org/issue24612

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Re: beginners choice: wx or tk?

2015-07-11 Thread Michael Torrie
On 07/11/2015 11:39 AM, Chris Angelico wrote:
>> I'm happy with PyQt.  I haven't created standalone executable files with it, 
>> though.  Do they necessarily have to be large?  I would think that 
>> well-written import statements would cut down on the file size.  Just import 
>> the objects you need, rather than the whole namespace.  PyQt is even 
>> organized in sub-modules, apparently to encourage you to refrain from 
>> importing everything.
>>
> 
> If there are submodules that you aren't importing, then it's possible
> they don't need to be included. But if you just import a few names
> from a module, you still need the entire module to be included.

It's not the size of the PyQt wrapper files themselves that are big.
It's the Qt dlls.  Last I worked with Qt, they added nearly 10 MB to an
app bundle's size.  You will have to ship them with your app one way or
another.  There is some modularity there.  But at the very least you
need QtCore and QtGui, which are between 8 and 15 MB total, depending on
debugging symbols, qt version, etc. Qt 5 seems to be more modular; there
are a lot more individual shared libraries that are smaller.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: 0 + not 0

2015-07-11 Thread random832
On Sat, Jul 11, 2015, at 07:20, Chris Angelico wrote:
> On Sat, Jul 11, 2015 at 9:12 PM, Luuk  wrote:
> > It can occur in an arithmetic expression, and 'not' has a higher precedence
> > than '+'
> > (https://docs.python.org/2/reference/expressions.html#operator-precedence)
> >
> 
> I think you're misreading the table; 'not' has *lower* precedence than
> '+'.

Precedence shouldn't actually matter when resolving a unary prefix
operator on the right of a binary operator. I don't understand how this
could possibly be interpreted in a different valid way rather than being
spuriously rejected as a syntax error.
-- 
https://mail.python.org/mailman/listinfo/python-list


Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-11 Thread Simon Evans
Dear Programmers, 
Thank you for your advice regarding giving the console a current address in the 
code for it to access the html file. 

The console seems to accept the code to that extent, but when I input the two 
lines of code intended to access the location of a required word, the console 
rejects it re :

AttributeError:'NoneType' object has no attribute 'li' 

However the document 'EcologicalPyramid.html' does contain the words 'li' and 
'ul', in its text. I am not sure as to how the input is arranged to output 
'plants' which is also in the documents text, but that is the word the code is 
meant to elicit. 

I enclose the pertinent code as input and output from the console, and the html 
code for the document 'EcologicalPyramid.html'

Thank you in advance for your help. 

-
>>> with open("C:\Beautiful Soup\ecologicalpyramid.html","r") as 
>>> ecological_pyramid:
soup = BeautifulSoup("C:\Beautiful Soup\ecological_pyramid.html","lxml")
... producer_entries = soup.find("ul")
  File "", line 2
producer_entries = soup.find("ul")
   ^
SyntaxError: invalid syntax
>>> producer_entries = soup.find("ul")
>>> print (producer_entries.li.div.string)
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'NoneType' object has no attribute 'li'
--
prin





plants
10


algae
10




deer
1000

deer
1000


rabbit
2000




fox
100


bear
100




lion
80


tiger
50




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


Re: beginners choice: wx or tk?

2015-07-11 Thread Ulli Horlacher
Chris Angelico  wrote:

> > pyinstaller can make a standalone executable, there is no need for the
> > users to install "another library". They just click on the program icon,
> > that's it.
> 
> Yeah, I'd distribute the .py files and have done with it.

This is not an option for me. My users only accept standalone executables.
They cannot install any runtime environment or extra libraries.


> distribute a whole bunch of different versions (32-bit vs 64-bit,

Is a 64 bit Windows unable to run 32 bit programs?


> Suppose, for instance, that your program does something over HTTPS, and
> people are using it in a critical environment... and then someone
> discovers a flaw in OpenSSL, which has happened now and then.

The same problem has docker - the newest and hottest computer hype ;-)


> Much better to distribute Python code without an interpreter, and let
> people get their own interpreters.

Again: this is a no-go for me, because my users cannot accept it.

-- 
Ullrich Horlacher  Server und Virtualisierung
Rechenzentrum IZUS/TIK E-Mail: [email protected]
Universitaet Stuttgart Tel:++49-711-68565868
Allmandring 30aFax:++49-711-682357
70550 Stuttgart (Germany)  WWW:http://www.tik.uni-stuttgart.de/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: beginners choice: wx or tk?

2015-07-11 Thread Paul Rubin
Ulli Horlacher  writes:
> This is not an option for me. My users only accept standalone executables.
> They cannot install any runtime environment or extra libraries.

Long ago I was involved with a thing like this and used Inno Setup,
which was great.  It's a very slick installer whose user experience is
similar to Install Shield if you're familiar with that.  I have no idea
what current best practice is, but I see that Inno Setup is still
around.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: beginners choice: wx or tk?

2015-07-11 Thread Ulli Horlacher
Paul Rubin  wrote:
> Ulli Horlacher  writes:
> > This is not an option for me. My users only accept standalone executables.
> > They cannot install any runtime environment or extra libraries.
> 
> Long ago I was involved with a thing like this and used Inno Setup,
> which was great.  It's a very slick installer

It is not a matter of knowledge, but one of user rights.
It is also forbidden by organization rules.


-- 
Ullrich Horlacher  Server und Virtualisierung
Rechenzentrum IZUS/TIK E-Mail: [email protected]
Universitaet Stuttgart Tel:++49-711-68565868
Allmandring 30aFax:++49-711-682357
70550 Stuttgart (Germany)  WWW:http://www.tik.uni-stuttgart.de/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-11 Thread Mark Lawrence

On 11/07/2015 23:17, Simon Evans wrote:

Dear Programmers,
Thank you for your advice regarding giving the console a current address in the 
code for it to access the html file.

The console seems to accept the code to that extent, but when I input the two 
lines of code intended to access the location of a required word, the console 
rejects it re :

AttributeError:'NoneType' object has no attribute 'li'

However the document 'EcologicalPyramid.html' does contain the words 'li' and 
'ul', in its text. I am not sure as to how the input is arranged to output 
'plants' which is also in the documents text, but that is the word the code is 
meant to elicit.

I enclose the pertinent code as input and output from the console, and the html 
code for the document 'EcologicalPyramid.html'

Thank you in advance for your help.

-

with open("C:\Beautiful Soup\ecologicalpyramid.html","r") as ecological_pyramid:

soup = BeautifulSoup("C:\Beautiful Soup\ecological_pyramid.html","lxml")


Beautiful Soup takes a string or a file handle so as it's good  practise 
to use the "with open" construct this should do it:-


soup = BeautifulSoup(ecological_pyramid,"lxml")

but do you actually need the "lxml", with the simple parsing I've done 
in the past I've never used it?


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Re: beginners choice: wx or tk?

2015-07-11 Thread Paul Rubin
Ulli Horlacher  writes:
>> Long ago I was involved with a thing like this and used Inno Setup,
>> which was great.  It's a very slick installer
> It is not a matter of knowledge, but one of user rights.
> It is also forbidden by organization rules.

I might not understand what you're looking for.  I thought you wanted a
single .exe to give your users.  Inno Setup packages up such a thing for
you, making it very convenient for them.  I think I used it in
conjunction with py2exe, another Windows packaging tool that might or
might not still be in use.  Do you mean it's not ok for the setup tool
to install files?  Hmm.  It might still be possible with py2exe.

On the UI issue, I've always used tkinter and been satisfied with it,
though the gui's I've done haven't been terribly fancy.  tkinter is
pretty easy to use and relatively portable, and included with python
distros, so that made it my default choice.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3.5.0b3(64 bit) - idle refused to work on windows 7 desktop pc.

2015-07-11 Thread Terry Reedy

On 7/11/2015 5:56 AM, Mark Lawrence wrote:

On 11/07/2015 10:06, Simon Ball wrote:

Good morning,

Everything else appeared to work though.
Kept getting the windows 'donut' telling
me it was doing something, but then
the program did not appear.

Windows 7 Home Premium Service Pack 1 intel 64 bit pc.

Kind regards
Simon Ball

Luton
Bedfordshire
UK



Please state exactly what you did to try and run the program, e.g. click
on a desktop shortcut or something on the start menu, or what you typed
at the command line prompt.


And whether python itself runs without Idle.


--
Terry Jan Reedy

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


Re: beginners choice: wx or tk?

2015-07-11 Thread Ulli Horlacher
Paul Rubin  wrote:

> Ulli Horlacher  writes:
> >> Long ago I was involved with a thing like this and used Inno Setup,
> >> which was great.  It's a very slick installer
> > It is not a matter of knowledge, but one of user rights.
> > It is also forbidden by organization rules.
> 
> Do you mean it's not ok for the setup tool to install files?

Yes, as I wrote before: They cannot install any files.
My program for them must be a single click-and-run executable.


> Hmm.  It might still be possible with py2exe.

What does py2exe better than pyinstaller?
pyinstaller works for me.


-- 
Ullrich Horlacher  Server und Virtualisierung
Rechenzentrum IZUS/TIK E-Mail: [email protected]
Universitaet Stuttgart Tel:++49-711-68565868
Allmandring 30aFax:++49-711-682357
70550 Stuttgart (Germany)  WWW:http://www.tik.uni-stuttgart.de/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: beginners choice: wx or tk?

2015-07-11 Thread Ian Kelly
On Sat, Jul 11, 2015 at 5:10 PM, Paul Rubin  wrote:
> Ulli Horlacher  writes:
>>> Long ago I was involved with a thing like this and used Inno Setup,
>>> which was great.  It's a very slick installer
>> It is not a matter of knowledge, but one of user rights.
>> It is also forbidden by organization rules.
>
> I might not understand what you're looking for.  I thought you wanted a
> single .exe to give your users.  Inno Setup packages up such a thing for
> you, making it very convenient for them.  I think I used it in
> conjunction with py2exe, another Windows packaging tool that might or
> might not still be in use.  Do you mean it's not ok for the setup tool
> to install files?  Hmm.  It might still be possible with py2exe.

Perhaps you've been misled by the talk about pyInstaller, which
despite the name does not create installers. It merely creates a
portable exe that runs the Python program contained in it, similar to
py2exe.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Error: ImportError: No module named ''folder_name’ at Command Prompt

2015-07-11 Thread Terry Reedy

On 7/11/2015 11:15 AM, Ernest Bonat, Ph.D. wrote:

Hi All,


I’m doing a CSV data analysis in Python using Eclipse IDE/PyDev. I have
organized my project using the standard MVC architecture. In Eclipse IDE
everything is working properly. When I run my main.py file it at Command
Prompt I got an error: ImportError: No module named 'folder_name'. It’s
like the location path of the ‘'folder_name’ was not found. Do I need to
update my main.py file to run it at the Command Prompt?


'import module' searches directories on sys.path for a file or directory 
named 'module'.  sys.path starts with '.', which represents the 
'current' directory. If you start with the directory containing main.py 
as current directory and 'folder-name' is in the same directory, the 
import should work.  Otherwise ??? EclipseIDE probably modifies the 
current dir and/or path to make things work.


For any more help, post the OS and locations of main.py, folder_name, 
and python.


--
Terry Jan Reedy


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


Re: beginners choice: wx or tk?

2015-07-11 Thread Jugurtha Hadjar

Hello,

On 07/11/2015 11:20 AM, Chris Angelico wrote:


Yeah, I'd distribute the .py files and have done with it. Maybe do
it up as a package and distribute it via pip, which allows you to
fetch dependencies automatically.


I'm also writing something, and the target audience is Windows users in
a Treasury department, not really a command line crowd.


The supposed ease of "just click on the

program icon" is all very well, but it means you have to have a
whopping new download any time there's an update to your code (they
have to redownload the entire binary even if you're using the same
Python and the same libraries), and you have to distribute a whole
bunch of different versions (32-bit vs 64-bit, possibly different
builds for different Windowses, etc), and deal with the support
issues from people who grabbed the wrong one.


Let the feature creep begin... :

Why not put the updates as diffs/patches? In any given change, there's
only a part of the .EXE that will change and I can't think of a good
reason to download the whole thing again like Google Chrome.

This either requires using some third party tool for the patch, or
rolling one's own.


Once Python itself has been

installed, users can still normally "just click on the program icon"
even though it's a .py file - that's the whole point of file
associations. And then their installed Python can be updated by the
normal mechanisms, and your code will happily run on the new
version. Suppose, for instance, that your program does something over
HTTPS, and people are using it in a critical environment... and then
someone discovers a flaw in OpenSSL, which has happened now and then.
A bugfix release of CPython will fix that instantly for everyone
who's using the standard python.org downloads; but if you've packaged
up your own Python, it'll be frozen at whatever version you had when
you built that - which might not even be the latest available at the
time. How quickly will you get around to building new installers?

Much better to distribute Python code without an interpreter, and
let people get their own interpreters.



I just found this:

https://us.pycon.org/2012/schedule/presentation/393/

It's a talk titled "Deep Freeze: building better stand-alone apps with
Python". I'll watch it later.


ChrisA




--
~Jugurtha Hadjar,
--
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


Fwd: Python Error: ImportError: No module named ''folder_name’ at Command Prompt

2015-07-11 Thread Ernest Bonat, Ph.D.
Thanks

Ernest Bonat, Ph.D.
Senior Software Engineer | Senior Data Analyst
Visual WWW, Inc. | President and CEO
115 NE 39th Avenue | Hillsboro, OR 97124
Cell: 503.730.4556 | Email: [email protected]

*The content of this email is confidential. It is intended only for the use
of the persons named above. If you are not the intended recipient, you are
hereby notified that any review, dissemination, distribution or duplication
of this communication is strictly prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message.*

-- Forwarded message --
From: Terry Reedy 
Date: Sat, Jul 11, 2015 at 8:59 PM
Subject: Re: Python Error: ImportError: No module named ''folder_name’ at
Command Prompt
To: "Ernest Bonat, Ph.D." 


Please send this followup to python-list.

On 7/11/2015 11:26 PM, Ernest Bonat, Ph.D. wrote:

> Hey Terry,
>
> Thanks for your help. I had follow the link: How to add a Python module
> to syspath?
> <
> http://askubuntu.com/questions/470982/how-to-add-a-python-module-to-syspath
> >
> and I could not make it work. I did use sys.path.insert() and
> sys.path.append() as:
>
> Examples: sys.path.append('/python_mvc_calculator/calculator/') or
> sys.path.insert(0, "/python_mvc_calculator/calculator")
>
> I did try it to:
> sys.path.append('/python_mvc_calculator/calculator/controller') or
> sys.path.insert(0, "/python_mvc_calculator/calculator/controller") too!
>
> The main.py file is in python_mvc_calculator/calculator folder and I
> need to import a module calculatorcontroller.py in
> "python_mvc_calculator/calculator/controller"
>
> I hope this explanation helps a bit!
>
> <
> http://askubuntu.com/questions/470982/how-to-add-a-python-module-to-syspath
> >
>
> Thanks
>
> Ernest Bonat, Ph.D.
> Senior Software Engineer | Senior Data Analyst
> Visual WWW, Inc. | President and CEO
> 115 NE 39th Avenue | Hillsboro, OR 97124
> Cell: 503.730.4556 | Email: [email protected]
> 
>
> /The content of this email is confidential. It is intended only for the
> use of the persons named above. If you are not the intended recipient,
> you are hereby notified that any review, dissemination, distribution or
> duplication of this communication is strictly prohibited. If you are not
> the intended recipient, please contact the sender by reply email and
> destroy all copies of the original message./
>
> On Sat, Jul 11, 2015 at 5:02 PM, Terry Reedy  > wrote:
>
> On 7/11/2015 11:15 AM, Ernest Bonat, Ph.D. wrote:
>
> Hi All,
>
>
> I’m doing a CSV data analysis in Python using Eclipse IDE/PyDev.
> I have
> organized my project using the standard MVC architecture. In
> Eclipse IDE
> everything is working properly. When I run my main.py file it at
> Command
> Prompt I got an error: ImportError: No module named
> 'folder_name'. It’s
> like the location path of the ‘'folder_name’ was not found. Do I
> need to
> update my main.py file to run it at the Command Prompt?
>
>
> 'import module' searches directories on sys.path for a file or
> directory named 'module'.  sys.path starts with '.', which
> represents the 'current' directory. If you start with the directory
> containing main.py as current directory and 'folder-name' is in the
> same directory, the import should work.  Otherwise ??? EclipseIDE
> probably modifies the current dir and/or path to make things work.
>
> For any more help, post the OS and locations of main.py,
> folder_name, and python.
>
> --
> Terry Jan Reedy
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Fwd: Python Error: ImportError: No module named ''folder_name’ at Command Prompt

2015-07-11 Thread Ernest Bonat, Ph.D.
Thanks for your help. I had follow the link: How to add a Python module
to syspath?


and I could not make it work. I did use sys.path.insert() and
sys.path.append() as:

Examples: sys.path.append('/python_mvc_calculator/calculator/') or
sys.path.insert(0, "/python_mvc_calculator/calculator")

I did try it to:
sys.path.append('/python_mvc_calculator/calculator/controller') or
sys.path.insert(0, "/python_mvc_calculator/calculator/controller") too!

The main.py file is in python_mvc_calculator/calculator folder and I
need to import a module calculatorcontroller.py in
"python_mvc_calculator/calculator/controller"

I hope this explanation helps a bit!



Thanks

Ernest Bonat, Ph.D.
Senior Software Engineer | Senior Data Analyst
Visual WWW, Inc. | President and CEO
115 NE 39th Avenue | Hillsboro, OR 97124
Cell: 503.730.4556 | Email: [email protected]


/The content of this email is confidential. It is intended only for the
use of the persons named above. If you are not the intended recipient,
you are hereby notified that any review, dissemination, distribution or
duplication of this communication is strictly prohibited. If you are not
the intended recipient, please contact the sender by reply email and
destroy all copies of the original message./
-- Forwarded message --
From: Terry Reedy 
Date: Sat, Jul 11, 2015 at 8:59 PM
Subject: Re: Python Error: ImportError: No module named ''folder_name’ at
Command Prompt
To: "Ernest Bonat, Ph.D." 


Please send this followup to python-list.

On 7/11/2015 11:26 PM, Ernest Bonat, Ph.D. wrote:

> Hey Terry,
>
> Thanks for your help. I had follow the link: How to add a Python module
> to syspath?
> <
> http://askubuntu.com/questions/470982/how-to-add-a-python-module-to-syspath
> >
> and I could not make it work. I did use sys.path.insert() and
> sys.path.append() as:
>
> Examples: sys.path.append('/python_mvc_calculator/calculator/') or
> sys.path.insert(0, "/python_mvc_calculator/calculator")
>
> I did try it to:
> sys.path.append('/python_mvc_calculator/calculator/controller') or
> sys.path.insert(0, "/python_mvc_calculator/calculator/controller") too!
>
> The main.py file is in python_mvc_calculator/calculator folder and I
> need to import a module calculatorcontroller.py in
> "python_mvc_calculator/calculator/controller"
>
> I hope this explanation helps a bit!
>
> <
> http://askubuntu.com/questions/470982/how-to-add-a-python-module-to-syspath
> >
>
> Thanks
>
> Ernest Bonat, Ph.D.
> Senior Software Engineer | Senior Data Analyst
> Visual WWW, Inc. | President and CEO
> 115 NE 39th Avenue | Hillsboro, OR 97124
> Cell: 503.730.4556 | Email: [email protected]
> 
>
> /The content of this email is confidential. It is intended only for the
> use of the persons named above. If you are not the intended recipient,
> you are hereby notified that any review, dissemination, distribution or
> duplication of this communication is strictly prohibited. If you are not
> the intended recipient, please contact the sender by reply email and
> destroy all copies of the original message./
>
> On Sat, Jul 11, 2015 at 5:02 PM, Terry Reedy  > wrote:
>
> On 7/11/2015 11:15 AM, Ernest Bonat, Ph.D. wrote:
>
> Hi All,
>
>
> I’m doing a CSV data analysis in Python using Eclipse IDE/PyDev.
> I have
> organized my project using the standard MVC architecture. In
> Eclipse IDE
> everything is working properly. When I run my main.py file it at
> Command
> Prompt I got an error: ImportError: No module named
> 'folder_name'. It’s
> like the location path of the ‘'folder_name’ was not found. Do I
> need to
> update my main.py file to run it at the Command Prompt?
>
>
> 'import module' searches directories on sys.path for a file or
> directory named 'module'.  sys.path starts with '.', which
> represents the 'current' directory. If you start with the directory
> containing main.py as current directory and 'folder-name' is in the
> same directory, the import should work.  Otherwise ??? EclipseIDE
> probably modifies the current dir and/or path to make things work.
>
> For any more help, post the OS and locations of main.py,
> folder_name, and python.
>
> --
> Terry Jan Reedy
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: beginners choice: wx or tk?

2015-07-11 Thread Paul Rubin
Ulli Horlacher  writes:
>> Do you mean it's not ok for the setup tool to install files?
> Yes, as I wrote before: They cannot install any files.

You wrote before that the users couldn't install files, but it wasn't
clear before that the setup tool also can't install files.

>> Hmm.  It might still be possible with py2exe.
> What does py2exe better than pyinstaller?
> pyinstaller works for me.

I don't know anything about pyinstaller.  I used py2exe and it worked,
so I mentioned that in case the info is useful.  If pyinstaller also
works, that's great, it sounds like your problem is solved.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: beginners choice: wx or tk?

2015-07-11 Thread Ned Deily
In article ,
 Kevin Walzer  wrote:

> 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.

I believe Laura is referring to the Pythons installed by python.org 
installers and it is true that their versions of tkinter and IDLE are 
not linked with 8.6 (but it is not correct that 8.6 is shipped with OS 
X).  As I replied earlier, the issue is not that Tkinter doesn't work 
with Tk 8.6 on OS X: as you say, it does.  The issues are that (1) Apple 
doesn't supply 8.6 with OS X; (2) the Pythons supplied by the python.org 
installers for OS X have traditionally depended on using Apple-supplied 
Tk's shipped with OS X (with an override to ActiveTcl if installed);  
(3) Apple has not updated the version of Tk 8.5 shipped with recent 
releases of OS X, thus still shipping an early version of Cocoa Tk with 
critical bugs that have been fixed upstream by you (Kevin) and others; 
(4) while liberally licensed, ActiveTcl is not free or open source 
software so it is problematic to require all tkinter users to have to 
install it when using python.org Pythons.  The best solution at the 
moment would be for the python.org OS X installers to supply their own 
builds of Tcl/Tk (like the python.org Windows installers do).  That 
hasn't happened yet (we tried one approach a while back but ran into 
problems with some key third-party Python packages expecting files to be 
in particular locations); I hope to try again in the near future.

-- 
 Ned Deily,
 [email protected]

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


Re: Fwd: Python Error: ImportError: No module named ''folder_name’ at Command Prompt

2015-07-11 Thread Vincent Vande Vyvre

Le 12/07/2015 06:02, Ernest Bonat, Ph.D. a écrit :

Thanks for your help. I had follow the link: How to add a Python module
to syspath?


and I could not make it work. I did use sys.path.insert() and
sys.path.append() as:

Examples: sys.path.append('/python_mvc_calculator/calculator/') or
sys.path.insert(0, "/python_mvc_calculator/calculator")

I did try it to:
sys.path.append('/python_mvc_calculator/calculator/controller') or
sys.path.insert(0, "/python_mvc_calculator/calculator/controller") too!

The main.py file is in python_mvc_calculator/calculator folder and I
need to import a module calculatorcontroller.py in
"python_mvc_calculator/calculator/controller"

I hope this explanation helps a bit!



Thanks



If "/python_mvc_calculator/calculator/controller" is a folder and if you 
have a file __init__.py into this folder, you have to use:


sys.path.insert(0, "/python_mvc_calculator/calculator/controller")
from calculatorcontroller import foo # or import calculatorcontroller

But the init file must be named __init__.py NOT init.py as sayed in 
askubuntu.


Vincent

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


Re: 0 + not 0

2015-07-11 Thread Gregory Ewing

Ian Kelly wrote:

I must concur. The grammar as written does not actually produce 1 +
not 0. I think it's still worthwhile opening a bug, because the
behavior is surprising and possibly not intentional.


It's almost certainly intentional. If you want

   not a + b > c

to be interpreted as

   not (a + b > c)

rather than

   (not a) + b > c

then 'not' has to be higher up in the chain of
grammar productions than the arithmetic operations.
Maintaining that while allowing 'a + not b' would
require contortions in the grammar that wouldn't be
worth the very small benefit that would be obtained.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list