Re: Why exception from os.path.exists()?

2018-06-09 Thread Chris Angelico
On Sun, Jun 10, 2018 at 5:53 AM, Ed Kellett  wrote:
> On 2018-06-08 03:42, Chris Angelico wrote:
>> Apart from the one odd bug with SimpleHTTPServer not properly sending
>> back 500s, I very much doubt that the original concern - namely that
>> os.path.exists() and os.stat() raise ValueError if therels a %00 in
>> the URL - can be abused effectively.
> Dismissing HTTP 500s as "not a vulnerability" sounds reasonable enough
> to me. But you're assuming that all other expressions of this bug in
> applications will be at least as benign. I'm not sure that that's warranted.
>

It is an exception. There are a small number of possible results:

1) It happens in code where ValueError could otherwise happen, and the
code gets confused. That's a bug, but bugs do happen. No way to
predict the actual results; it's probably going to make something else
go into a  default mode or something. Highly unlikely for it to
trigger a vulnerability, but if it does, the problem is that you have
code that's catching an exception that it shouldn't be.

2) It happens in code where ValueError is not expected, and is handled
as an unexpected exception. ALL end-user-facing code should have a
means of coping with exceptions (web servers should toss back a 500,
etc). If it doesn't, then *that* is the vulnerability, not the
ValueError itself; there are many MANY ways for Python code to
unexpectedly raise exceptions.

Either way, this exception isn't itself a problem; but it might reveal
a different problem. For instance, an end-user-facing app that has no
protective exception handler might be induced to terminate in this
way, which is a DOS; but the problem isn't os.path.exists raising
ValueError, the problem is an unexpected exception causing
termination.

It's important to pin down the true cause of the problem, and not
blame something for doing the proper Pythonic thing. Python is not Go;
exceptions exist to be used. The advantage of Go is that you never get
unexpected exceptions... instead, you just get unexpected incorrect
behaviour if you fail to check the return value of a function and just
assume that it did its job. Exceptions don't remove all responsibility
from you, but they DO make it a lot easier to handle them coherently.

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


Re: Stefan's headers [was:Names and identifiers]

2018-06-09 Thread Gene Heskett
On Saturday 09 June 2018 20:33:06 Steven D'Aprano wrote:

> On Sat, 09 Jun 2018 13:48:17 +0300, Marko Rauhamaa wrote:
> > Richard Damon :
> >> Copyright law is not what makes something 'closed source' in the
> >> eyes of the Open Source community. For example, Microsoft doesn't
> >> use Copyright to keep the source code for Windows secret, they just
> >> don't provide it.
> >
> > It would leak out with developers who move to new jobs. And that
> > would be good.
>
> Are you proposing to abolish trade secrets and NDAs as well? Good luck
> with that.
>
> Do your customers and clients know your opinion on releasing code you
> write for them to the rest of the world?
>
If they did, I expect it would cut the length of his ladder to where he 
eats off the hog by serious amounts.

While we may voice our opinions of the current copyright laws, they are 
to the advantage of companies who would have little or no reticence 
about silenceing dissenting opinions that might fall on the lawmakers 
ears. Those of you working for the man ought not to forget that.

-- 
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: FULLSCREEN and DOUBLEBUF

2018-06-09 Thread Mark Lawrence

On 09/06/18 20:31, Paul St George wrote:


     print pygame.display.get_surface()
gives


and
     print screen.get_flags()
gives
-2147483648

The lists of flags at 
 
and 



has nothing remotely like -2147483648. I would expect something more 
like 0x4000


Am I using the wrong code to determine whether I have successfully set 
DOUBLEBUF with


     screen = pygame.display.set_mode((720,480), pygame.FULLSCREEN | 
pygame.DOUBLEBUF)


AND

What does -2147483648 tell me? Does this number need converting?




From the interactive interpreter:-

>>> hex(-2147483648)
'-0x8000'
>>> hex(pygame.FULLSCREEN)
'-0x8000'
>>> hex(pygame.DOUBLEBUF)
'0x4000'

--
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: Why exception from os.path.exists()?

2018-06-09 Thread Ed Kellett
On 2018-06-08 03:42, Chris Angelico wrote:
> Apart from the one odd bug with SimpleHTTPServer not properly sending
> back 500s, I very much doubt that the original concern - namely that
> os.path.exists() and os.stat() raise ValueError if therels a %00 in
> the URL - can be abused effectively.
Dismissing HTTP 500s as "not a vulnerability" sounds reasonable enough
to me. But you're assuming that all other expressions of this bug in
applications will be at least as benign. I'm not sure that that's warranted.



signature.asc
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-09 Thread Marko Rauhamaa
Richard Damon :

> On 6/9/18 6:48 AM, Marko Rauhamaa wrote:
>> It would leak out with developers who move to new jobs. And that would
>> be good.
>
> If you plan on eliminating not only copyright, but trade secret and
> non-disclosure laws, sure, maybe. Yes probably some limited stuff
> would leak. More likely the work conditions at those places would get
> stricter, and likely would make it hard for someone inside to 'make a
> copy'.

Copying some general-purpose frameworks and libraries is not a trade
secret any more than, say, clever HR practices.

> More importantly, if we didn't have copyright laws, we likely didn't
> get windows or even Dos anywhere near as early, and maybe even not
> home computers.

I'm not moved.

> I've had this discussion before, and I think you underestimate how
> much innovation would be inhibited it companies were restricted from
> being able to make a profit off the development of intellectual
> property.
>
> Our current computing environment grew out of the ability for
> companies to make a profit out of the sales of software. Without the
> base of commercial software, the demand for inexpensive hardware to
> run it on wouldn't be there, and computers then would be expensive,
> and a limited base to promote the development of the Free Software
> movement.

No doubt there would be some damage -- I could lose my job, for example.
I believe, though, necessary and useful things will get done even in the
absense of copyright protections. I *may* mean that some of those
necessary and useful things need public funding.

The situation is very analogous to science, which depends on public
funding and is based on open exchange of ideas and discoveries.

Your belief and mine can be put to incremental tests so an immediate
revolution is not needed. For example, set a fixed date when
*everything* will fall into Public Domain (say, year 2100). As the date
approaches, we might start seeing the good and bad societal effects of
the change and can react accordingly. Maybe there *is* a need for
copyright protection, and the optimal duration turns out to be five
years from publication.


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


Re: Problem finding my folder via terminal

2018-06-09 Thread Lee Congdon
On Sat, Jun 9, 2018 at 4:45 PM T Berger  wrote:

> [snip]



> Sorry. That's terrible. But I did run the code a number of times
> correctly. I just did it again and got the same key icon:
>
> Last login: Sat Jun  9 13:26:14 on ttys000
> 192:~ TamaraB$ cd Desktop/mymodules/dist
> 192:dist TamaraB$ dist TamaraB$ sudo python3 -m pip install
> vsearch-1.0.tar.gz
> -bash: dist: command not found
> 192:dist TamaraB$ sudo python3 -m pip install vsearch-1.0.tar.gz
> Password:
>
> What next?
>
> Thanks,
>
> Tamara
> --
> https://mail.python.org/mailman/listinfo/python-list
>

Assuming your account has administrator rights on your Mac, enter the
password you use to sign on. If not, or you don't use a password to sign
on, see https://support.apple.com/en-us/HT202035

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


Re: Stefan's headers [was:Names and identifiers]

2018-06-09 Thread Chris Angelico
On Sun, Jun 10, 2018 at 1:07 PM, Gregory Ewing
 wrote:
> Richard Damon wrote:
>>
>> Our current computing environment grew out of the ability for companies
>> to make a profit out of the sales of software. Without the base of
>> commercial software, the demand for inexpensive hardware to run it on
>> wouldn't be there, and computers then would be expensive, and a limited
>> base to promote the development of the Free Software movement.
>
>
> That's all speculation. It's impossible to say how things
> would have turned out if copyrights didn't apply to software.
> Certainly different, but not necessarily worse.
>
> In the early days, computer manufacturers didn't worry about
> people copying their software, because it was no use without
> the hardware, and selling hardware was how they made their
> money. There's no reason that business model couldn't have
> continued into the PC era.
>

It would have meant that third-party software would not exist.

The nearest comparison we have today is game consoles. You cannot, to
my knowledge, publish a game for the PS4 or Xbox 360 without
permission from Nintendo or Microsoft. Take that just a little bit
further and imagine that the game console you just bought is populated
SOLELY with games by the same publisher. And now imagine that this
applies to every piece of computing hardware: an IBM computer runs
only IBM programs, etc. Nobody can sell software without also selling
hardware, which is an expensive industry to get into. Is that an
improvement over what we now have?

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


Re: Problem finding my folder via terminal

2018-06-09 Thread Cameron Simpson

On 09Jun2018 22:57, Tamara Berger  wrote:

Thanks for the help. I was just following the coding in the workbook
when I inserted sudo.


Fair enough too.

But generally, in future, consider any command prefixed with sudo with some 
suspicion. Sometimes it is the sensible thing to do, but many many people use 
it as a reflex as soon as they get some kind of permission error instead of 
thinking though why something may be forbidden (by default).


In this instance "pip" has support for "personal" python modules, and that is 
usually the better way to go.



What you said about it makes a lot of sense.

Again, thanks for all your help.


No worries, that's what the list is for.

Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


Re: Problem finding my folder via terminal

2018-06-09 Thread Cameron Simpson

On 09Jun2018 22:50, Tamara Berger  wrote:

On Sat, Jun 9, 2018 at 5:05 AM Cameron Simpson  wrote:

A third possibility is that you made a mymodules somewhere else (such as in
your top level home directory), and later decided to put it on your Desktop to
make it easy to find/access.


I did save it in My Documents first and then moved it to my desktop.
But I did not write code. I just dragged and dropped.


So you might have decided to "mv" your "mymodules"
folder into the Desktop like this:

  mv mymodules Desktop/mymodules

which is fine. But mv has some interesting behaviour. If "mymodules" didn't
exist in Desktop, then youre "mymodules" will get moved into the Desktop.
However, if mv's final argument is an _existing_ directory, mv puts things
inside it. So if you went:

  mkdir Desktop/mymodules
  mv mymodules Desktop/mymodules

then mv would put your top level "mymodules" _inside_ the "Desktop/mymodules"
folder that already exists, producing the structure you currently have.


I didn't do any of this. Could dragging and dropping have created the
duplicate folder?


Maybe? If you'd premade an empty "Desktop/mymodules" first, and happened to 
drop the "My Documents/mymodules" onto it instead of "into" the wider "Desktop" 
folder.  Again, just guessing.


We should just get on; just pay close attention next time you move things 
around like this and see if anything suggests itself as an explaination.


BTW, congrats: a fine inline response!

Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-09 Thread Gregory Ewing

Richard Damon wrote:

Our current computing environment grew out of the ability for companies
to make a profit out of the sales of software. Without the base of
commercial software, the demand for inexpensive hardware to run it on
wouldn't be there, and computers then would be expensive, and a limited
base to promote the development of the Free Software movement.


That's all speculation. It's impossible to say how things
would have turned out if copyrights didn't apply to software.
Certainly different, but not necessarily worse.

In the early days, computer manufacturers didn't worry about
people copying their software, because it was no use without
the hardware, and selling hardware was how they made their
money. There's no reason that business model couldn't have
continued into the PC era.

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


Re: Stefan's headers [was:Names and identifiers]

2018-06-09 Thread Gregory Ewing

Richard Damon wrote:

If software providers could no longer depend on Copyright law, then you
would see much more use of the hobbling copy protection technologies,


Maybe so, but that has nothing to do with open source, since,
as you say, the sort of people that don't want their binaries
copied don't release their source anyway.

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


Re: Problem finding my folder via terminal

2018-06-09 Thread Tamara Berger
Hi Cameron,

Thanks for the help. I was just following the coding in the workbook
when I inserted sudo. What you said about it makes a lot of sense.

Again, thanks for all your help.

Tamara
On Sat, Jun 9, 2018 at 5:49 PM Cameron Simpson  wrote:
>
> On 09Jun2018 10:48, Tamara Berger  wrote:
> >I want to read your last two emails in the evening when I have more time to
> >digest the information, but I have a quick question now. I made the 
> >correction
> >you suggested to mymodule and went on to create a source distribution file.
> >Then I got stuck again when trying to install my module into site-packages. I
> >think I got a permission error. How do I fix this? Here is the coding from 
> >the
> >shell:
> >
> >Last login: Sat Jun  9 13:16:15 on ttys000
> >192:~ TamaraB$ cd Desktop/mymodules/dict
> >-bash: cd: Desktop/mymodules/dict: No such file or directory
>
> I think this should be "dist", not "dict".
>
> >192:~ TamaraB$ cd Desktop/mymodules/dist
>
> Ah, yes. Ok then.
>
> >192:dist TamaraB$ sudo python3 -m pop install vsearch-1.0.tar.gz
> >Password:
> >
> >There is a symbol of a key after the word "Password."
>
> There are a few issue here.
>
> First, it should be "pip", not "pop".
>
> Second, this is using the "sudo" command to run "python3 -m pip install
> vsearch-1.0.tar.gz" as root, the system administrator account. "sudo" is 
> asking
> you for your password before proceeding.
>
> Might I suggest that you don't do this step?
>
> The reason here is that it will install your "vsearch" module into the 
> _system_
> site-packages area. That area is under the control of the OS vendor (Apple in
> this case) and they may legitimately put something else of the same name 
> there,
> or have already done so. In the former case they're land on your module and in
> the latter case you will be destroying the vendor supplied module.
>
> As a rule of thumb it is best to avoid putting stuff in the vendor controlled
> places - it leads to maintenance problems and can lead to unexpected 
> behaviour.
>
> Instead, use pip's "--user" option, thus:
>
>   python3 -m pip install --user vsearch-1.0.tar.gz
>
> Note: there is _no_ "sudo" command there. This command runs as you, not root,
> and installs in your home directory in an area for user supplied packages.
>
> Cheers,
> Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem finding my folder via terminal

2018-06-09 Thread Tamara Berger
On Sat, Jun 9, 2018 at 5:05 AM Cameron Simpson  wrote:
>
> A third possibility is that you made a mymodules somewhere else (such as in
> your top level home directory), and later decided to put it on your Desktop to
> make it easy to find/access.

I did save it in My Documents first and then moved it to my desktop.
But I did not write code. I just dragged and dropped.

>So you might have decided to "mv" your "mymodules"
> folder into the Desktop like this:
>
>   mv mymodules Desktop/mymodules
>
> which is fine. But mv has some interesting behaviour. If "mymodules" didn't
> exist in Desktop, then youre "mymodules" will get moved into the Desktop.
> However, if mv's final argument is an _existing_ directory, mv puts things
> inside it. So if you went:
>
>   mkdir Desktop/mymodules
>   mv mymodules Desktop/mymodules
>
> then mv would put your top level "mymodules" _inside_ the "Desktop/mymodules"
> folder that already exists, producing the structure you currently have.

I didn't do any of this. Could dragging and dropping have created the
duplicate folder?

Thanks,

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


Re: user defined modules

2018-06-09 Thread Albert-Jan Roskam



On 5 Jun 2018 09:32, Steven D'Aprano  
wrote:

On Mon, 04 Jun 2018 20:13:32 -0700, Sharan Basappa wrote:

> Is there a specific location where user defined modules need to be kept?
> If not, do we need to specify search location so that Python interpreter
> can find it?

Python modules used as scripts can be run from anywhere, by pointing the
interpreter at the script:

python /path/to/my/script.py


But Python modules uses as libraries, to be imported by other modules,
have to be on the Python search path. You can add extra  paths to the
Python search path from the shell by setting the environment variable
PYTHONPATH to a colon-separated list of paths. On Linux, I do this in
my .bashrc config file:

export PYTHONPATH="paths:to:add"

In the Python interpreter, you can query and modify the search path by
importing sys and looking at sys.path. (But you should not do so unless
you really know what you are doing.)

The default search path is set by the site module:

https://docs.python.org/3/library/site.html

but again, you should not mess with this unless you know what you are
doing.

There are some per-user directories which are automatically added to the
search path. I can't find the existing documentation for them, but a good
place to start is the PEP that introduced the feature:

https://www.python.org/dev/peps/pep-0370/


Apart from setting the PYTHONPATH environment variable, the best way to
add extra paths to is to install a .pth file.

If you run both Python 2 and 3, than .pth might be a better choice. With 
Pythonpath, you run the risk of e.g. importing python3-incompatible code.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-09 Thread Chris Angelico
On Sun, Jun 10, 2018 at 11:52 AM, Steven D'Aprano
 wrote:
> I think the wise thing is to have *just enough* copyright but not too
> much. Zero is not enough, but what we have now is too much.
>

Agreed. If copyright lapsed by default after ten years but could be
extended through paid registration to a hard limit of fifty, I think a
lot of things would be better off. Numbers could be tweaked but
something along those lines.

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


Re: Stefan's headers [was:Names and identifiers]

2018-06-09 Thread Steven D'Aprano
On Sat, 09 Jun 2018 13:02:30 -0400, Richard Damon wrote:

> On 6/9/18 6:48 AM, Marko Rauhamaa wrote:
>> Richard Damon :
>>> Copyright law is not what makes something 'closed source' in the eyes
>>> of the Open Source community. For example, Microsoft doesn't use
>>> Copyright to keep the source code for Windows secret, they just don't
>>> provide it.
>> It would leak out with developers who move to new jobs. And that would
>> be good.
> 
> If you plan on eliminating not only copyright, but trade secret and
> non-disclosure laws, sure, maybe. Yes probably some limited stuff would
> leak. More likely the work conditions at those places would get
> stricter, and likely would make it hard for someone inside to 'make a
> copy'.
> 
> More importantly, if we didn't have copyright laws, we likely didn't get
> windows or even Dos anywhere near as early, and maybe even not home
> computers.

I think that Marko is being awfully naive about copyright, but I think 
that your claim is a gross misrepresentation of the early history of 
computing. The money was in selling the hardware, especially in the home 
computer market, not the software.

Things would have been ... interesting ... if (let's say) IBM had been 
free just take CP/M and use that, but don't underestimate the benefits of 
dealing with the people who actually wrote the software and understand 
it, even if you could just take the software and work on it yourself.

(Richard Stallman makes a pretty penny consulting for GNU software.)

Another factor you failed to account for is that without piracy (in other 
words, despite copyright, not because of copyright) Microsoft's software 
would be unlikely to hold its preeminent position it does today. From 
Word and especially Excel, Windows, MS BASIC and DOS, Microsoft captured 
the market *because of* copyright infringement, not in spite of it.

The bottom line is, the idea that copyright is responsible for innovation 
is more a matter of faith than economic reality. Economists who study 
this sort of thing argue back and forth whether the economic cost of 
copyright outweighs the benefits, but one way or the other it is hardly a 
clear cut win for copyright as conventional wisdom says.

I think the wise thing is to have *just enough* copyright but not too 
much. Zero is not enough, but what we have now is too much.


-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson

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


Re: Stefan's headers [was:Names and identifiers]

2018-06-09 Thread Steven D'Aprano
On Sat, 09 Jun 2018 13:48:17 +0300, Marko Rauhamaa wrote:

> Richard Damon :
>> Copyright law is not what makes something 'closed source' in the eyes
>> of the Open Source community. For example, Microsoft doesn't use
>> Copyright to keep the source code for Windows secret, they just don't
>> provide it.
> 
> It would leak out with developers who move to new jobs. And that would
> be good.

Are you proposing to abolish trade secrets and NDAs as well? Good luck 
with that.

Do your customers and clients know your opinion on releasing code you 
write for them to the rest of the world?


-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson

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


Re: Stefan's headers [was:Names and identifiers]

2018-06-09 Thread Marko Rauhamaa
Richard Damon :
> In the comparison to science, I would say that my guess is that a LOT
> more science is being done by private companies being encouraged by
> the promise of Patent protection than by the support of the general
> public. Admittedly, there are likely significant differences in focus
> of these aspects.

"Proprietary science" seems like an oxymoron to me. At best,
profit-seeking research can produce scientific discoveries as a
side-effect.


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


Re: Problem finding my folder via terminal

2018-06-09 Thread Cameron Simpson

On 09Jun2018 10:48, Tamara Berger  wrote:
I want to read your last two emails in the evening when I have more time to 
digest the information, but I have a quick question now. I made the correction 
you suggested to mymodule and went on to create a source distribution file. 
Then I got stuck again when trying to install my module into site-packages. I 
think I got a permission error. How do I fix this? Here is the coding from the 
shell:


Last login: Sat Jun  9 13:16:15 on ttys000
192:~ TamaraB$ cd Desktop/mymodules/dict
-bash: cd: Desktop/mymodules/dict: No such file or directory


I think this should be "dist", not "dict".


192:~ TamaraB$ cd Desktop/mymodules/dist


Ah, yes. Ok then.


192:dist TamaraB$ sudo python3 -m pop install vsearch-1.0.tar.gz
Password:

There is a symbol of a key after the word "Password."


There are a few issue here.

First, it should be "pip", not "pop".

Second, this is using the "sudo" command to run "python3 -m pip install 
vsearch-1.0.tar.gz" as root, the system administrator account. "sudo" is asking 
you for your password before proceeding.


Might I suggest that you don't do this step?

The reason here is that it will install your "vsearch" module into the _system_ 
site-packages area. That area is under the control of the OS vendor (Apple in 
this case) and they may legitimately put something else of the same name there, 
or have already done so. In the former case they're land on your module and in 
the latter case you will be destroying the vendor supplied module.


As a rule of thumb it is best to avoid putting stuff in the vendor controlled 
places - it leads to maintenance problems and can lead to unexpected behaviour.


Instead, use pip's "--user" option, thus:

 python3 -m pip install --user vsearch-1.0.tar.gz

Note: there is _no_ "sudo" command there. This command runs as you, not root, 
and installs in your home directory in an area for user supplied packages.


Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


Re: Stefan's headers [was:Names and identifiers]

2018-06-09 Thread Richard Damon
On 6/9/18 3:06 PM, Marko Rauhamaa wrote:
> Richard Damon :
> 
>> On 6/9/18 6:48 AM, Marko Rauhamaa wrote:
>>> It would leak out with developers who move to new jobs. And that would
>>> be good.
>>
>> If you plan on eliminating not only copyright, but trade secret and
>> non-disclosure laws, sure, maybe. Yes probably some limited stuff
>> would leak. More likely the work conditions at those places would get
>> stricter, and likely would make it hard for someone inside to 'make a
>> copy'.
> 
> Copying some general-purpose frameworks and libraries is not a trade
> secret any more than, say, clever HR practices.
> 
>> More importantly, if we didn't have copyright laws, we likely didn't
>> get windows or even Dos anywhere near as early, and maybe even not
>> home computers.
> 
> I'm not moved.
> 
>> I've had this discussion before, and I think you underestimate how
>> much innovation would be inhibited it companies were restricted from
>> being able to make a profit off the development of intellectual
>> property.
>>
>> Our current computing environment grew out of the ability for
>> companies to make a profit out of the sales of software. Without the
>> base of commercial software, the demand for inexpensive hardware to
>> run it on wouldn't be there, and computers then would be expensive,
>> and a limited base to promote the development of the Free Software
>> movement.
> 
> No doubt there would be some damage -- I could lose my job, for example.
> I believe, though, necessary and useful things will get done even in the
> absense of copyright protections. I *may* mean that some of those
> necessary and useful things need public funding.
> 
> The situation is very analogous to science, which depends on public
> funding and is based on open exchange of ideas and discoveries.
> 
> Your belief and mine can be put to incremental tests so an immediate
> revolution is not needed. For example, set a fixed date when
> *everything* will fall into Public Domain (say, year 2100). As the date
> approaches, we might start seeing the good and bad societal effects of
> the change and can react accordingly. Maybe there *is* a need for
> copyright protection, and the optimal duration turns out to be five
> years from publication.
> 
> 
> Marko
> 

In the comparison to science, I would say that my guess is that a LOT
more science is being done by private companies being encouraged by the
promise of Patent protection than by the support of the general public.
Admittedly, there are likely significant differences in focus of these
aspects.

I will agree that the current rules may have been pushed out of balance
by greed. Not sure if 5 years for copyright is long enough, but the
life+70 that the House of the Mouse got is too long.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem finding my folder via terminal

2018-06-09 Thread T Berger
On Saturday, June 9, 2018 at 3:30:39 PM UTC-4, MRAB wrote:
> On 2018-06-09 18:48, T Berger wrote:
> [snip]
> 
> > I want to read your last two emails in the evening when I have more time to 
> > digest the information, but I have a quick question now. I made the 
> > correction you suggested to mymodule and went on to create a source 
> > distribution file. Then I got stuck again when trying to install my module 
> > into site-packages. I think I got a permission error. How do I fix this? 
> > Here is the coding from the shell:
> > 
> > Last login: Sat Jun  9 13:16:15 on ttys000
> > 192:~ TamaraB$ cd Desktop/mymodules/dict
> > -bash: cd: Desktop/mymodules/dict: No such file or directory
> > 192:~ TamaraB$ cd Desktop/mymodules/dist
> > 192:dist TamaraB$ sudo python3 -m pop install vsearch-1.0.tar.gz
> > Password:
> > 
> > There is a symbol of a key after the word "Password."
> > 
> Did you really type "pop"? It looks that you're running the wrong code. 
> The module you want is "pip".

Hi Cameron,

Sorry. That's terrible. But I did run the code a number of times correctly. I 
just did it again and got the same key icon:

Last login: Sat Jun  9 13:26:14 on ttys000
192:~ TamaraB$ cd Desktop/mymodules/dist
192:dist TamaraB$ dist TamaraB$ sudo python3 -m pip install vsearch-1.0.tar.gz 
-bash: dist: command not found
192:dist TamaraB$ sudo python3 -m pip install vsearch-1.0.tar.gz
Password:

What next?

Thanks,

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


Re: FULLSCREEN and DOUBLEBUF

2018-06-09 Thread Richard Damon
On 6/9/18 3:31 PM, Paul St George wrote:
> So...
>
>     print pygame.display.get_surface()
> gives
> 
>
> and
>     print screen.get_flags()
> gives
> -2147483648
>
> The lists of flags at
> 
> and
> 
>
> has nothing remotely like -2147483648. I would expect something more
> like 0x4000
>
> Am I using the wrong code to determine whether I have successfully set
> DOUBLEBUF with
>
>     screen = pygame.display.set_mode((720,480), pygame.FULLSCREEN |
> pygame.DOUBLEBUF)
>
> AND
>
> What does -2147483648 tell me? Does this number need converting?

That number is printed in Decimal, the listing gives it in hex. If you
convert the number to hex you get

0x8000

-- 
Richard Damon

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


Re: Problem finding my folder via terminal

2018-06-09 Thread MRAB

On 2018-06-09 18:48, T Berger wrote:
[snip]


I want to read your last two emails in the evening when I have more time to 
digest the information, but I have a quick question now. I made the correction 
you suggested to mymodule and went on to create a source distribution file. 
Then I got stuck again when trying to install my module into site-packages. I 
think I got a permission error. How do I fix this? Here is the coding from the 
shell:

Last login: Sat Jun  9 13:16:15 on ttys000
192:~ TamaraB$ cd Desktop/mymodules/dict
-bash: cd: Desktop/mymodules/dict: No such file or directory
192:~ TamaraB$ cd Desktop/mymodules/dist
192:dist TamaraB$ sudo python3 -m pop install vsearch-1.0.tar.gz
Password:

There is a symbol of a key after the word "Password."

Did you really type "pop"? It looks that you're running the wrong code. 
The module you want is "pip".

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


Re: Re: FULLSCREEN and DOUBLEBUF

2018-06-09 Thread Paul St George



On 08/06/18 09:00, Paul St George wrote:
Excellent. Now I know what to do in this instance and I understand 
the principle.


I hesitantly tried this:

 screen = pygame.display.set_mode((720,480), pygame.FULLSCREEN | 
pygame.DOUBLEBUF)


Hesitantly because I expected the *bitwise or operator* (|) to work 
like a toggle, so FULLSCREEN or DOUBLEBUF.



On 08/06/2018 12:52, Rhodri James wrote:

The bitwise OR operator peforms a bitwise OR, i.e. *both* flags get set.

No errors were reported, but how would I check that DOUBLEBUF had 
been set? Is there a general rule, such as replace 'set_something' 
with 'get_something'?


There's documentation.  The link Chris gave you for 
pygame.display.set_mode() tells you that you get a Surface out of it. 
Reaching for the docs for that, this leaps out:


https://www.pygame.org/docs/ref/surface.html#pygame.Surface.get_flags



So...

    print pygame.display.get_surface()
gives


and
    print screen.get_flags()
gives
-2147483648

The lists of flags at 
 
and 


has nothing remotely like -2147483648. I would expect something more 
like 0x4000


Am I using the wrong code to determine whether I have successfully set 
DOUBLEBUF with


    screen = pygame.display.set_mode((720,480), pygame.FULLSCREEN | 
pygame.DOUBLEBUF)


AND

What does -2147483648 tell me? Does this number need converting?






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


In Pandas, can you do groupby in on two different datasets?

2018-06-09 Thread C W
Dear all,
I want find the average ratings of movies by movieId. Below is
ratings.head() of the dataset.

> ratings.head()

userId  movieId  rating   timestamp parsed_time
0   12 3.5  1112486027 2005-04-02 23:53:47
1   1   29 3.5  1112484676 2005-04-02 23:31:16
2   1   32 3.5  1112484819 2005-04-02 23:33:39
3   1   47 3.5  1112484727 2005-04-02 23:32:07
4   1   50 3.5  1112484580 2005-04-02 23:29:40


I'm trying two methods:

Method 1 (makes sense)
> ratings[['movieId', 'rating']].groupby('rating').mean()
This returns dataframe, it's the most common.

Method 2 (confusing)
> ratings.rating.groupby(ratings.movieId).mean()

movieId
13.921240
23.211977
33.151040
42.861393
53.064592
Name: rating, dtype: float64



What going on in method 2? It's calling ratings dataset twice.
First in ratings.rating, it restricts the working dataset to only rating
column.
Then, it groups by ratings.movieId, but how does it know there is movieId.
Didn't we just restrict the data to rating column only?

Thanks in advance!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem finding my folder via terminal

2018-06-09 Thread T Berger
On Saturday, June 9, 2018 at 5:05:25 AM UTC-4, Cameron Simpson wrote:
> On 09Jun2018 02:37, Gene Heskett  wrote:
> >On Saturday 09 June 2018 01:36:17 Tamara Berger wrote:
> >> Re inline style: When I hit reply, this is the window I get.
> 
> The python-list server strips attachments, so I didn't get the screenshot you 
> may have attached. However...
> 
> >> I don't
> >> get my previous email with the carets appended to the beginning of the
> >> line.
> 
> I've just gone to my GMail and tried a reply. In my reply compose window 
> there 
> is a little button at the bottom left with three dots in it, thus: "[...]", 
> kind of. Click that, it expands to the prior quoted text. Then you can trim 
> it 
> and insert your responses.
> 
> >> Before I look at the rest of your email, I'd like for you to explain
> >> how there is a mymodule folder nested within another mymodule folder.
> >> I don't see this second folder in Finder, and I definitely didn't
> >> create it.
> >
> >Finder, if thats what you are using, I am not familiar with it, is
> >probably showing you that which it has cached, before that folder was
> >created.  Back out one layer and go back in so it actually reads a fresh
> >copy of that directory(folder).
> 
> The Finder uses MacOS' equivalent of Linux' inotify: its folder views are 
> "live" and update as soon as anything changes.
> 
> Tamara, there are things the Finder won't show, particularly "hidden" files, 
> which is an attribute you can assign to folders. Maybe that is what happened. 
>  
> I've got no concrete explaination, and I can't inspect your machine directly. 
>  
> Also, how sure are you that the "mymodules" in the Finder is the upper one 
> and 
> not the lower one? Just guessing here.
> 
> My opinion is that you did create it, but not realised how that happened.
> 
> All you'd need to do is something like this:
> 
>   cd Desktop
>   mkdir mymodules
>   cd mymodules
>   ... get distracted, do something else, come back much later ...
>   mkdir mymodules
>   cd mymodules
>   ... proceed to make the setup.py and so forth ...
> 
> i.e. just do it twice. Alternatively, and this is a common one, you got a 
> template archive, such as a zip file, containing an "empty" module to get you 
> started. And did something like this:
> 
>   cd Desktop
>   mkdir mymodules
>   cd mymodules
>   unzip the-empty-module-template.zip
> 
> If the zip file itself also contained a top level "mymodules" folder in it, 
> it 
> will have made the second "mymodules" inside the one you made.
> 
> Most archive files are set up to have their entire contents inside a single 
> top 
> folder, so this scenario isn't all that unlikely.
> 
> A third possibility is that you made a mymodules somewhere else (such as in 
> your top level home directory), and later decided to put it on your Desktop 
> to 
> make it easy to find/access. So you might have decided to "mv" your 
> "mymodules" 
> folder into the Desktop like this:
> 
>   mv mymodules Desktop/mymodules
> 
> which is fine. But mv has some interesting behaviour. If "mymodules" didn't 
> exist in Desktop, then youre "mymodules" will get moved into the Desktop.  
> However, if mv's final argument is an _existing_ directory, mv puts things 
> inside it. So if you went:
> 
>   mkdir Desktop/mymodules
>   mv mymodules Desktop/mymodules
> 
> then mv would put your top level "mymodules" _inside_ the "Desktop/mymodules" 
> folder that already exists, producing the structure you currently have.
> 
> Cheers,
> Cameron Simpson 

Hi Cameron,

I want to read your last two emails in the evening when I have more time to 
digest the information, but I have a quick question now. I made the correction 
you suggested to mymodule and went on to create a source distribution file. 
Then I got stuck again when trying to install my module into site-packages. I 
think I got a permission error. How do I fix this? Here is the coding from the 
shell:

Last login: Sat Jun  9 13:16:15 on ttys000
192:~ TamaraB$ cd Desktop/mymodules/dict
-bash: cd: Desktop/mymodules/dict: No such file or directory
192:~ TamaraB$ cd Desktop/mymodules/dist
192:dist TamaraB$ sudo python3 -m pop install vsearch-1.0.tar.gz
Password:

There is a symbol of a key after the word "Password."

Thanks, 

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


Re: Python System Error

2018-06-09 Thread Mark Lawrence

On 09/06/18 17:12, deon gordon wrote:

  Greetings,

confirm 1b131414ca21eea0843469f76454389f1e9ceebe

I am using Window 7 Professional (32bit).

I downloaded and installed python-3.6.5.exe and have an error after several
attempts to install and repair.

Python-system error api-mis-win-crt-runtime-l1-1-0.dll is missing from your
computer


Regards


Deon Laubscher



You need this 
https://support.microsoft.com/en-us/help/2999226/update-for-universal-c-runtime-in-windows 
little beastie :)


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


Python System Error

2018-06-09 Thread deon gordon
 Greetings,

confirm 1b131414ca21eea0843469f76454389f1e9ceebe

I am using Window 7 Professional (32bit).

I downloaded and installed python-3.6.5.exe and have an error after several
attempts to install and repair.

Python-system error api-mis-win-crt-runtime-l1-1-0.dll is missing from your
computer


Regards


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


Re: Stefan's headers [was:Names and identifiers]

2018-06-09 Thread Richard Damon
On 6/9/18 6:48 AM, Marko Rauhamaa wrote:
> Richard Damon :
>> Copyright law is not what makes something 'closed source' in the eyes
>> of the Open Source community. For example, Microsoft doesn't use
>> Copyright to keep the source code for Windows secret, they just don't
>> provide it.
> It would leak out with developers who move to new jobs. And that would
> be good.

If you plan on eliminating not only copyright, but trade secret and
non-disclosure laws, sure, maybe. Yes probably some limited stuff would
leak. More likely the work conditions at those places would get
stricter, and likely would make it hard for someone inside to 'make a copy'.

More importantly, if we didn't have copyright laws, we likely didn't get
windows or even Dos anywhere near as early, and maybe even not home
computers.
>> The thing that gives the Open Source licenses the power to force
>> people to share the source code is that their IS a copyright on the
>> source code and the usage license on it demands revealing
>> modifications to others.
> Most open-source licenses don't have that stipulation:
>
>https://en.wikipedia.org/wiki/Comparison_of_free_and_open-sour
>ce_software_licenses>
>
> In particular, CPython's license doesn't seem to require it:
>
>https://github.com/python/cpython/blob/master/LICENSE>
>
>> If software providers could no longer depend on Copyright law, then
>> you would see much more use of the hobbling copy protection
>> technologies, and automatically enforced licensing methods. That, and
>> a lot less software produced.
> The consequences would be hard to estimate precisely. You don't need so
> many reimplementations of ideas if good ideas could be copied freely. I
> believe the society would gain faster progress of software solutions
> with the copyright restrictions gone.
>
>
> Marko

I've had this discussion before, and I think you underestimate how much
innovation would be inhibited it companies were restricted from being
able to make a profit off the development of intellectual property.

Our current computing environment grew out of the ability for companies
to make a profit out of the sales of software. Without the base of
commercial software, the demand for inexpensive hardware to run it on
wouldn't be there, and computers then would be expensive, and a limited
base to promote the development of the Free Software movement.

-- 
Richard Damon

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


Re: Obsolete method in the html module

2018-06-09 Thread Terry Reedy

On 6/9/2018 4:07 AM, Vincent Vande Vyvre wrote:

In Python-3.7.0b5 we can find at the end of html/parser.py:

     def unescape(self, s):
     warnings.warn('The unescape method is deprecated and will be 
removed '

   'in 3.5, use html.unescape() instead.',
   DeprecationWarning, stacklevel=2)
     return unescape(s)


https://bugs.python.org/issue33813

--
Terry Jan Reedy


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


Re: Inverting a conditional function

2018-06-09 Thread Terry Reedy

On 6/9/2018 5:54 AM, Steven D'Aprano wrote:

I frequently have a function which tests some condition, returning True
or False, and want a function which reverses the condition.

If all I wanted was the result of calling the function, I could say

 not condition(x)

and be done with it, but I want a new function. I've been doing this:

 lambda arg: not condition(arg)


def not_condition(arg): return not condition(arg)


which is okay, but its a bit long and adds the cost of an extra function
call. Is there a better way?


If you have access to source, replace each 'return e' with 'return not 
e' or perhaps 'return not (e)'.  Don't replace 'not not e' unless you 
know 'e' evaluates to False or True.


Otherwise, disassemble the function, replace code for return with code 
for invert, return.  Assemble new function.


Better?


--
Terry Jan Reedy

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


plotly / dash export data

2018-06-09 Thread duncan smith
Hello,
  I have been trying to work out how to export data from a dash
application. I know little about html or javascript. I can upload data
into a table as per the example at
https://github.com/plotly/dash-core-components/pull/73. I can edit the
data in the table. But I can't find a way of exporting the edited data.
(Saving the data to file after each edit and providing a link to said
file might do it, but doesn't seem particularly clean). The data are
model parameters, and the user can edit these and run simulations. It
seems unreasonable to allow the user to experiment with different
parameters, but not allow them to export the parameters for future use.
Hopefully someone with better knowledge of dash (or html) can point me
in the right direction. TIA.

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


Re: Stefan's headers [was:Names and identifiers]

2018-06-09 Thread Marko Rauhamaa
Richard Damon :
> Copyright law is not what makes something 'closed source' in the eyes
> of the Open Source community. For example, Microsoft doesn't use
> Copyright to keep the source code for Windows secret, they just don't
> provide it.

It would leak out with developers who move to new jobs. And that would
be good.

> The thing that gives the Open Source licenses the power to force
> people to share the source code is that their IS a copyright on the
> source code and the usage license on it demands revealing
> modifications to others.

Most open-source licenses don't have that stipulation:

   https://en.wikipedia.org/wiki/Comparison_of_free_and_open-sour
   ce_software_licenses>

In particular, CPython's license doesn't seem to require it:

   https://github.com/python/cpython/blob/master/LICENSE>

> If software providers could no longer depend on Copyright law, then
> you would see much more use of the hobbling copy protection
> technologies, and automatically enforced licensing methods. That, and
> a lot less software produced.

The consequences would be hard to estimate precisely. You don't need so
many reimplementations of ideas if good ideas could be copied freely. I
believe the society would gain faster progress of software solutions
with the copyright restrictions gone.


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


Obsolete method in the html module

2018-06-09 Thread Vincent Vande Vyvre

Not really important, just a comment.

In Python-3.7.0b5 we can find at the end of html/parser.py:

    def unescape(self, s):
    warnings.warn('The unescape method is deprecated and will be 
removed '

  'in 3.5, use html.unescape() instead.',
  DeprecationWarning, stacklevel=2)
    return unescape(s)

Vincent

(send at 08:07 GMT)

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


Re: Stefan's headers [was:Names and identifiers]

2018-06-09 Thread Richard Damon
On 6/9/18 1:07 AM, Gregory Ewing wrote:
> Chris Angelico wrote:
>> Open source would not exist without copyright,because it is
>> copyright law that gives license terms their meaning.
>
> That statement doesn't make any sense. If there were no
> copyright laws, there would be no need for licences to
> distribute software.
>
> You seem to be saying that nobody would ever release the
> source of their software unless they could impose some
> kind of restrictions on what people could do with it.
>
> But I don't think that's true at all. Open sharing of
> software was the *default* before people got the idea
> of applying copyright laws to it. If there were no
> copyright laws, people who wanted to share their source
> would still do so, and people who wanted to keep it a
> trade secret would still do so. The only difference is
> there would be less lawyers making money out of it. 
Copyright law is not what makes something 'closed source' in the eyes of
the Open Source community. For example, Microsoft doesn't use Copyright
to keep the source code for Windows secret, they just don't provide it.
The thing that gives the Open Source licenses the power to force people
to share the source code is that their IS a copyright on the source code
and the usage license on it demands revealing modifications to others.

If software providers could no longer depend on Copyright law, then you
would see much more use of the hobbling copy protection technologies,
and automatically enforced licensing methods. That, and a lot less
software produced.

-- 
Richard Damon

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


Inverting a conditional function

2018-06-09 Thread Steven D'Aprano
I frequently have a function which tests some condition, returning True 
or False, and want a function which reverses the condition.

If all I wanted was the result of calling the function, I could say 

not condition(x)

and be done with it, but I want a new function. I've been doing this:

lambda arg: not condition(arg)

which is okay, but its a bit long and adds the cost of an extra function 
call. Is there a better way?




-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson

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


Re: Problem finding my folder via terminal

2018-06-09 Thread Cameron Simpson

On 09Jun2018 02:37, Gene Heskett  wrote:

On Saturday 09 June 2018 01:36:17 Tamara Berger wrote:

Re inline style: When I hit reply, this is the window I get.


The python-list server strips attachments, so I didn't get the screenshot you 
may have attached. However...



I don't
get my previous email with the carets appended to the beginning of the
line.


I've just gone to my GMail and tried a reply. In my reply compose window there 
is a little button at the bottom left with three dots in it, thus: "[...]", 
kind of. Click that, it expands to the prior quoted text. Then you can trim it 
and insert your responses.



Before I look at the rest of your email, I'd like for you to explain
how there is a mymodule folder nested within another mymodule folder.
I don't see this second folder in Finder, and I definitely didn't
create it.


Finder, if thats what you are using, I am not familiar with it, is
probably showing you that which it has cached, before that folder was
created.  Back out one layer and go back in so it actually reads a fresh
copy of that directory(folder).


The Finder uses MacOS' equivalent of Linux' inotify: its folder views are 
"live" and update as soon as anything changes.


Tamara, there are things the Finder won't show, particularly "hidden" files, 
which is an attribute you can assign to folders. Maybe that is what happened.  
I've got no concrete explaination, and I can't inspect your machine directly.  
Also, how sure are you that the "mymodules" in the Finder is the upper one and 
not the lower one? Just guessing here.


My opinion is that you did create it, but not realised how that happened.

All you'd need to do is something like this:

 cd Desktop
 mkdir mymodules
 cd mymodules
 ... get distracted, do something else, come back much later ...
 mkdir mymodules
 cd mymodules
 ... proceed to make the setup.py and so forth ...

i.e. just do it twice. Alternatively, and this is a common one, you got a 
template archive, such as a zip file, containing an "empty" module to get you 
started. And did something like this:


 cd Desktop
 mkdir mymodules
 cd mymodules
 unzip the-empty-module-template.zip

If the zip file itself also contained a top level "mymodules" folder in it, it 
will have made the second "mymodules" inside the one you made.


Most archive files are set up to have their entire contents inside a single top 
folder, so this scenario isn't all that unlikely.


A third possibility is that you made a mymodules somewhere else (such as in 
your top level home directory), and later decided to put it on your Desktop to 
make it easy to find/access. So you might have decided to "mv" your "mymodules" 
folder into the Desktop like this:


 mv mymodules Desktop/mymodules

which is fine. But mv has some interesting behaviour. If "mymodules" didn't 
exist in Desktop, then youre "mymodules" will get moved into the Desktop.  
However, if mv's final argument is an _existing_ directory, mv puts things 
inside it. So if you went:


 mkdir Desktop/mymodules
 mv mymodules Desktop/mymodules

then mv would put your top level "mymodules" _inside_ the "Desktop/mymodules" 
folder that already exists, producing the structure you currently have.


Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


Re: Problem finding my folder via terminal

2018-06-09 Thread Gregory Ewing

Gene Heskett wrote:

Finder, if thats what you are using, I am not familiar with it, is 
probably showing you that which it has cached, before that folder was 
created.


The Finder is usually pretty good at noticing things like that.
I just tried creating a directory using a shell command while
the Finder was displaying the containing folder, and it appeared
immediately.

MacOSX has a "hidden" attribute that stops things showing up
in the Finder. You can check for that using:

ls -ldO /Users/TamaraB/Desktop/mymodules

ls -ldO /Users/TamaraB/Desktop/mymodules/mymodules

(note that's a capital letter O in the options).

If the hidden flag is set on either of those, it will show
up as "hidden" in the ls listing. Here's an example from my
system:

% ls -ldO newfolder2
drwxr-xr-x@ 2 greg  staff  hidden 68  9 Jun 19:32 newfolder2
   ^^

As for *how* you ended up with an extra folder (and how it
came to be hidden, if it really is) there's no way to be sure.

One way you can end up with extra folders is by unpacking zip
files. MacOSX's unzipping utility will create a folder for the
unzipped contents if the zip file contains more than just a
single folder at the top level. So if you created a folder
called "mymodules" and then unzipped a file called
"mymodules.zip" into it, you would get what you have here
(except that nothing would be hidden).

--
Greg

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