installing of python

2019-06-17 Thread jaydip rajpara
this pic of my c drive after installing python 3.7.2. No python folder
generated
-- 
https://mail.python.org/mailman/listinfo/python-list


How to create a RGB color Table

2019-06-17 Thread Jorge Conrado Conforte
HI,

Please someone could help me. How can I create a new color table with the 
values of r g and b that I have. I use the Mataplolib color tables. However, I 
would like to use a new color table with the respective r g b values that I 
have.

Thank you.

[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-green-avg-v1.png]
 Livre de vírus. 
www.avg.com.
-- 
https://mail.python.org/mailman/listinfo/python-list


error 0xc0000374 during installation

2019-06-17 Thread Lokallu Maltorin
Hi there,

I always get a 0xc374 error when I try to install Python on my PC.
I am using a flash installed win 7 Pro x64, with all available win-update
installed including SP1 and convenience-rollup.

I found

   1. python -m pip worked but "python not responding" error always show up
   at last and .exe file never being generated
   2. pip.exe do not appear in the Script folder, and "pip" in command
   prompt return "not recognized"

I am unable to use some packages because there are no .exe generated.
Can you please help? Thanks in advance.

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


there is an errar it is nit opening

2019-06-17 Thread clinchris13
 

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


Please solve my problem

2019-06-17 Thread Karan Aggarwal
Respected Sir,

I am a reserach scholar in image processing.
Sir i started the work on deep learning and machine learning.
For this, i installed many times tensorflow on python.
but it gave me error always.
please resolve my issue sothat i can work further.
Sir, please help me out.

Thanks


-- 


With Regards,

Karan Aggarwal
Ph.: 9466822528, 8059931278
-- 
https://mail.python.org/mailman/listinfo/python-list


Is there an archive of this list with permanent URLs to each message?

2019-06-17 Thread Luciano Ramalho
Hello! When I wrote Fluent Python a few years ago I provided my
readers with hundreds of links to my sources, including several links
to messages in the python-list archive.

Now as I prepare the 2nd edition I notice all my links to this list
are broken. Apparently mailman rebuilds the archives and changes the
ids of the messages.

Is there an archive of python-list that preserves each message with a
permanent URL?

Thanks!

Luciano

PS. For the curious, here is an instance of the problem. The message
currently at:

https://mail.python.org/pipermail/python-list/2009-February/525280.html

Used to be at this URL:

https://mail.python.org/pipermail/python-list/2009-February/538048.html



-- 
Luciano Ramalho
|  Author of Fluent Python (O'Reilly, 2015)
| http://shop.oreilly.com/product/0636920032519.do
|  Technical Principal at ThoughtWorks
|  Twitter: @ramalhoorg
-- 
https://mail.python.org/mailman/listinfo/python-list


problem about the installation

2019-06-17 Thread David Martin
Hello there!


My computer windows is 8 and the operating system is 32-bit operating
system, based upon x64 processor but I got a problem during installation,
could you please assist me about this?
I appreciate your efforts in advance.
Thanks




Yours sincerely
YarDel Daudy



Virus-free.
www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
-- 
https://mail.python.org/mailman/listinfo/python-list


api msi.python .dll missing

2019-06-17 Thread Nisha Kolekar
Hello,
My Python36 library deleted so i cannot reinstal python3.6.8amd64 on my
windows8.1 64bit OS.
Any command to remove complete python from OS through command prompt
-- 
https://mail.python.org/mailman/listinfo/python-list


Issue with the program

2019-06-17 Thread Marselle Grace


Hello, I downloaded the Python program today, as well as the separate IDE 
pyCharm today and on pyCharm I tried setting up Python as the interpreter, as 
the tutorial I am following stated, however it says that it is invalid and 
every time I try to input any code, a window for Python setup appears and tells 
me to Modify, Repair, or Uninstall Python, however none of those are applicable 
in this situation. I’m a beginner programmer and I’m not sure if the issue is 
with Python, pyCharm, or just user error and I would greatly appreciate some 
assistance in figuring this out. Thank you.
Sent from Mail for Windows 10

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


there is an errar it is nit opening

2019-06-17 Thread clinchris13
 

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


how to learn python language

2019-06-17 Thread praveendevan



Sent from Mail for Windows 10

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


Facing an error while install python

2019-06-17 Thread Hassan Hamayun
When i Install python i face an error i attach the screenshot with it.
[image: Untitled.png]

Thanks & Best Regaed

*Hassan Hamayun*
-- 
https://mail.python.org/mailman/listinfo/python-list


Coding problem

2019-06-17 Thread INJAMUL HOQUE


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


Subprocess

2019-06-17 Thread Douglas Beard via Python-list
Error: IDLE's Subprocess didn't make connection. Either IDLE can't start a 
subprocess or personal firewall is blocking the connection.python has been 
working fine until today. I used the python repair but no luck. it does not 
seem my firewall is blocking. please help
-- 
https://mail.python.org/mailman/listinfo/python-list


Understand workflow about reading and writing files in Python

2019-06-17 Thread Windson Yang
I'm trying to understand the workflow of how python read/writes files with
buffer. I drew a diagram for it.  I will be appreciated if someone can
review the diagram :D


[image: 屏幕快照 2019-06-15 下午12.50.57.png]
-- 
https://mail.python.org/mailman/listinfo/python-list


problem encountered

2019-06-17 Thread 宣鸿
Hi,


After installation, in cmd window, I can not run any command successfully. I 
copied screens as below, could you pls help?
Very appreciate for your help!




Could you pls help answering how to fix this issue? Thx again!


Best Regards,
Alan

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


Cannot install python on my system

2019-06-17 Thread EMAX ENGRG SERVICES LTD



Sent from Mail for Windows 10
Sir, 
Please I have  difficulties installing python on my system. After downloading 
the extension, yet it would not take me to sequence of agreeing to license and 
terms. I am looking forward to hearing from you/

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


UG blog's contact [email protected] no longer working?

2019-06-17 Thread Abdur-Rahmaan Janhangeer
Greetings,

here:

https://wiki.python.org/moin/StartingYourUsersGroup it is written:

Also, please consider posting news from your user group on the Python User
Group Blog !

and on that page, the contact email is:

Just drop an email to [email protected] and I'll set you up.

and my mail delivery service returned:

Your message wasn't delivered to *[email protected]*because the address
couldn't be found, or is unable to receive mail.

Any ideas about this issue?

Thanks!
-- 
Abdur-Rahmaan Janhangeer
Mauritius
-- 
https://mail.python.org/mailman/listinfo/python-list


Installing python into Blender 2.79

2019-06-17 Thread [email protected]
Hallo Python,
 
I want to import DWG- or FBX-data from AutoCAD Architecture 2015 into 
Blender.
I downloaded Python 3.7.3 into Windows 10 Prof., but I cannot find the 
python-program and do not know the path to bind python into blender.
 
Please could you help and tell me how to bring python into Blender?
 
Thank you fpr your help in advance.
 
With best regards,
 
Guenter

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


Re: installing of python

2019-06-17 Thread Paul Moore
(a) By default if you're using a user install, Python is installed to
%LOCALAPPDATA%\Programs\Python.
(b) This list is text-only, so the screenshot didn't appear - I'm
therefore only guessing what your issue is here.
(c) Does the command py -V work? That should run Python and give the
version number.
(d) If you did a default install, Python is not added to your user
PATH so you need to use the "py" launcher as I showed in (c) above. If
you want Python adding to PATH, you need to specify that when
installing (or manually add it to your PATH afterwards).

Paul

On Mon, 17 Jun 2019 at 10:31, jaydip rajpara
 wrote:
>
> this pic of my c drive after installing python 3.7.2. No python folder
> generated
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


python 2 to 3 conversion

2019-06-17 Thread Igor Korot
Hi,
Is there a place where there is a full list of incompatibilities between
python 2 and python 3 is available and how to fix them?

I'm looking for a way to fix following code, which runs perfectly with python 2
(and make it work with both python 2 and python 3):

if bytes[0:16].tostring() != '':

I know there are automated tools that can help you do the upgrade, but
automated tools can do only so much

And I am not sure if they can just add python 3 code and include version check.

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


Re: Cannot install python on my system

2019-06-17 Thread Igor Korot
Hi,

On Mon, Jun 17, 2019 at 5:18 AM EMAX ENGRG SERVICES LTD
 wrote:
>
>
>
> Sent from Mail for Windows 10
> Sir,
> Please I have  difficulties installing python on my system. After downloading 
> the extension, yet it would not take me to sequence of agreeing to license 
> and terms. I am looking forward to hearing from you/

Unfortunately I can't log in to you system to help you - I don't have
credentials.
Lucking that - can you give more information?

Thank you.


>
> Best regards.
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: problem encountered

2019-06-17 Thread Igor Korot
Hi,

On Mon, Jun 17, 2019 at 5:14 AM 宣鸿  wrote:
>
> Hi,
>
>
> After installation, in cmd window, I can not run any command successfully. I 
> copied screens as below, could you pls help?
> Very appreciate for your help!

I hope you can read my message.

This list does not support an attachments - it is available for blind
people as well.

Can you copy and paste what is happening in the message body?

Thank you.

>
>
>
>
> Could you pls help answering how to fix this issue? Thx again!
>
>
> Best Regards,
> Alan
>
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Coding problem

2019-06-17 Thread Igor Korot
On Mon, Jun 17, 2019 at 5:03 AM INJAMUL HOQUE  wrote:
>
>

Reading problem...

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


Re: how to learn python language

2019-06-17 Thread Igor Korot
Hi,

On Mon, Jun 17, 2019 at 4:55 AM praveendevan  wrote:
>
>

The best way is to get to class that teaches it.
Then you will learn how to do things proper way.

Thank you.


>
> Sent from Mail for Windows 10
>
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Facing an error while install python

2019-06-17 Thread Igor Korot
Hi,

On Mon, Jun 17, 2019 at 4:59 AM Hassan Hamayun
 wrote:
>
> When i Install python i face an error i attach the screenshot with it.

Sorry attachments not supported - some blind people are reading the
list and provide support.

Can you describe what happened and/or copy'n'paste the error?

Thank you.

> [image: Untitled.png]
>
> Thanks & Best Regaed
>
> *Hassan Hamayun*
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python 2 to 3 conversion

2019-06-17 Thread Chris Angelico
On Mon, Jun 17, 2019 at 10:15 PM Igor Korot  wrote:
>
> Hi,
> Is there a place where there is a full list of incompatibilities between
> python 2 and python 3 is available and how to fix them?
>
> I'm looking for a way to fix following code, which runs perfectly with python 
> 2
> (and make it work with both python 2 and python 3):
>
> if bytes[0:16].tostring() != '':
>
> I know there are automated tools that can help you do the upgrade, but
> automated tools can do only so much
>
> And I am not sure if they can just add python 3 code and include version 
> check.

If "bytes" here refers to a byte string, and not to the actual type
called "bytes" (the same as "str" in Py2), the way I'd do it is:

if bytes[:16] != b"":

However, I have no idea what your .tostring() method is, since it
doesn't seem to be a method on the Py2 str object, nor of the
bytearray object (my next guess). So further details/context would be
needed.

I would strongly recommend requiring either Python 2.7 or Python 3.5+.
There should be no need to support Python 2.6 or older, and if you
restrict your Py3 support to 3.5 and better, you can take advantage of
a number of syntactic compatibilities - u"text" and b"ASCII bytes"
will work on both, and b"x %d y" % 1234 will have equivalent
functionality. Features like that will make it much easier to code to
the common subset.

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


Re: there is an errar it is nit opening

2019-06-17 Thread Igor Korot
Hi,

On Mon, Jun 17, 2019 at 4:51 AM clinchris13  wrote:
>
>

There is an error in you post - I can't see anything...

Thank you.

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


Re: Please solve my problem

2019-06-17 Thread Igor Korot
Hi,

On Mon, Jun 17, 2019 at 4:39 AM Karan Aggarwal  wrote:
>
> Respected Sir,
>
> I am a reserach scholar in image processing.
> Sir i started the work on deep learning and machine learning.
> For this, i installed many times tensorflow on python.
> but it gave me error always.

What error did you receive?

Thank you.

> please resolve my issue sothat i can work further.
> Sir, please help me out.
>
> Thanks
>
>
> --
>
>
> With Regards,
>
> Karan Aggarwal
> Ph.: 9466822528, 8059931278
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Issue with the program

2019-06-17 Thread Igor Korot
Hi,

On Mon, Jun 17, 2019 at 4:47 AM Marselle Grace
 wrote:
>
>
> Hello, I downloaded the Python program today, as well as the separate IDE 
> pyCharm today and on pyCharm I tried setting up Python as the interpreter, as 
> the tutorial I am following stated, however it says that it is invalid and 
> every time I try to input any code, a window for Python setup appears and 
> tells me to Modify, Repair, or Uninstall Python, however none of those are 
> applicable in this situation. I’m a beginner programmer and I’m not sure if 
> the issue is with Python, pyCharm, or just user error and I would greatly 
> appreciate some assistance in figuring this out. Thank you.

Which tutorial you are using?
At what step exactly the error comes up?

Thank you.

> Sent from Mail for Windows 10
>
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: problem about the installation

2019-06-17 Thread Igor Korot
Hi,

On Mon, Jun 17, 2019 at 4:43 AM David Martin  wrote:
>
> Hello there!
>
>
> My computer windows is 8 and the operating system is 32-bit operating
> system, based upon x64 processor but I got a problem during installation,
> could you please assist me about this?
> I appreciate your efforts in advance.

Sorry this is python list and we can't help you with the Windows install.

Please contact you manufacturer.

Thank you.

> Thanks
>
>
>
>
> Yours sincerely
> YarDel Daudy
>
>
> 
> Virus-free.
> www.avast.com
> 
> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: there is an errar it is nit opening

2019-06-17 Thread Igor Korot
Hi,

On Mon, Jun 17, 2019 at 4:35 AM clinchris13  wrote:
>
>

There is an error in this message - I can't read it.

Thank you.

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


Re: api msi.python .dll missing

2019-06-17 Thread Igor Korot
Hi,

On Mon, Jun 17, 2019 at 4:43 AM Nisha Kolekar  wrote:
>
> Hello,
> My Python36 library deleted so i cannot reinstal python3.6.8amd64 on my
> windows8.1 64bit OS.
> Any command to remove complete python from OS through command prompt

Can you remove the python completely and install from scratch?

Thank you.

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


Re: python 2 to 3 conversion

2019-06-17 Thread Igor Korot
Hi, Chris,

On Mon, Jun 17, 2019 at 7:31 AM Chris Angelico  wrote:
>
> On Mon, Jun 17, 2019 at 10:15 PM Igor Korot  wrote:
> >
> > Hi,
> > Is there a place where there is a full list of incompatibilities between
> > python 2 and python 3 is available and how to fix them?
> >
> > I'm looking for a way to fix following code, which runs perfectly with 
> > python 2
> > (and make it work with both python 2 and python 3):
> >
> > if bytes[0:16].tostring() != '':
> >
> > I know there are automated tools that can help you do the upgrade, but
> > automated tools can do only so much
> >
> > And I am not sure if they can just add python 3 code and include version 
> > check.
>
> If "bytes" here refers to a byte string, and not to the actual type
> called "bytes" (the same as "str" in Py2), the way I'd do it is:
>
> if bytes[:16] != b"":
>
> However, I have no idea what your .tostring() method is, since it
> doesn't seem to be a method on the Py2 str object, nor of the
> bytearray object (my next guess). So further details/context would be
> needed.

bytes = array.array('B', open(path, "rb").read())
count = len(bytes)

This is where bytes come from - sorry about that.

So, how do I write the code compatible with both python 2 and python 3
in this case?

Thank you.

>
> I would strongly recommend requiring either Python 2.7 or Python 3.5+.
> There should be no need to support Python 2.6 or older, and if you
> restrict your Py3 support to 3.5 and better, you can take advantage of
> a number of syntactic compatibilities - u"text" and b"ASCII bytes"
> will work on both, and b"x %d y" % 1234 will have equivalent
> functionality. Features like that will make it much easier to code to
> the common subset.
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python 2 to 3 conversion

2019-06-17 Thread Thomas Jollans
On 17/06/2019 15.14, Igor Korot wrote:
> Hi,
> Is there a place where there is a full list of incompatibilities between
> python 2 and python 3 is available and how to fix them?

‘What’s new in Python 3.0’ is a good starting point

https://docs.python.org/3/whatsnew/3.0.html

It doesn’t list all standard library changes, but it has the most
important ones. Obviously it can't include anything that third-party
modules do.

The main incompatibility is obviously strings, and there various modules
have adopted different strategies for the transition.


>
> I'm looking for a way to fix following code, which runs perfectly with python 
> 2
> (and make it work with both python 2 and python 3):
>
> if bytes[0:16].tostring() != '':

No idea what this is supposed to do as you didn't say what ‘bytes’ was.
I could imagine that the tostring() method returns a bytes rather than a
str…

Also, ‘bytes’ is the name of a built-in type in Python3. You don't want
to use that as a variable name any more! (You can, though)

> I know there are automated tools that can help you do the upgrade, but
> automated tools can do only so much

By many accounts, 2to3 doesn't work very well in the real world, at
least not any more.


>
> And I am not sure if they can just add python 3 code and include version 
> check.
>
> Thank you.



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


Re: python 2 to 3 conversion

2019-06-17 Thread Chris Angelico
On Mon, Jun 17, 2019 at 10:45 PM Igor Korot  wrote:
>
> Hi, Chris,
>
> On Mon, Jun 17, 2019 at 7:31 AM Chris Angelico  wrote:
> >
> > On Mon, Jun 17, 2019 at 10:15 PM Igor Korot  wrote:
> > >
> > > Hi,
> > > Is there a place where there is a full list of incompatibilities between
> > > python 2 and python 3 is available and how to fix them?
> > >
> > > I'm looking for a way to fix following code, which runs perfectly with 
> > > python 2
> > > (and make it work with both python 2 and python 3):
> > >
> > > if bytes[0:16].tostring() != '':
> > >
> > > I know there are automated tools that can help you do the upgrade, but
> > > automated tools can do only so much
> > >
> > > And I am not sure if they can just add python 3 code and include version 
> > > check.
> >
> > If "bytes" here refers to a byte string, and not to the actual type
> > called "bytes" (the same as "str" in Py2), the way I'd do it is:
> >
> > if bytes[:16] != b"":
> >
> > However, I have no idea what your .tostring() method is, since it
> > doesn't seem to be a method on the Py2 str object, nor of the
> > bytearray object (my next guess). So further details/context would be
> > needed.
>
> bytes = array.array('B', open(path, "rb").read())
> count = len(bytes)
>
> This is where bytes come from - sorry about that.
>
> So, how do I write the code compatible with both python 2 and python 3
> in this case?

Where's the incompatibility coming from? I tried this very simple
example, and it seems fine.

Python 2.7.13 (default, Sep 26 2018, 18:42:22)
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import array
>>> b = array.array("B", b"asdfqwerzxcv")
>>> b[:4]
array('B', [97, 115, 100, 102])
>>> b[:4].tostring()
'asdf'


Python 3.9.0a0 (heads/master:19a1e1eb86, Jun  5 2019, 09:02:06)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import array
>>> b = array.array("B", b"asdfqwerzxcv")
>>> b[:4]
array('B', [97, 115, 100, 102])
>>> b[:4].tostring()
b'asdf'


Either way, tostring() is giving you back a byte string, which you can
easily compare to any byte string literal eg b"test string".

Can you show more code, and where the actual failure (exception or
wrong result) is coming from?

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


Re: python 2 to 3 conversion

2019-06-17 Thread Chris Angelico
On Mon, Jun 17, 2019 at 10:50 PM Thomas Jollans  wrote:
>
> On 17/06/2019 15.14, Igor Korot wrote:
> > Hi,
> > Is there a place where there is a full list of incompatibilities between
> > python 2 and python 3 is available and how to fix them?
>
> ‘What’s new in Python 3.0’ is a good starting point
>
> https://docs.python.org/3/whatsnew/3.0.html
>
> It doesn’t list all standard library changes, but it has the most
> important ones. Obviously it can't include anything that third-party
> modules do.
>
> The main incompatibility is obviously strings, and there various modules
> have adopted different strategies for the transition.

Unfortunately starting there means ignoring all the compatibilities
that were implemented in more recent versions. Notably, Python 3.3
introduced u"..." literals, and 3.5 allows you to use percent
interpolation with bytes as well as text. So those kinds of
differences are no longer significant.

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


Re: python 2 to 3 conversion

2019-06-17 Thread Igor Korot
Hi, Chris et al,

On Mon, Jun 17, 2019 at 8:00 AM Chris Angelico  wrote:
>
> On Mon, Jun 17, 2019 at 10:50 PM Thomas Jollans  wrote:
> >
> > On 17/06/2019 15.14, Igor Korot wrote:
> > > Hi,
> > > Is there a place where there is a full list of incompatibilities between
> > > python 2 and python 3 is available and how to fix them?
> >
> > ‘What’s new in Python 3.0’ is a good starting point
> >
> > https://docs.python.org/3/whatsnew/3.0.html
> >
> > It doesn’t list all standard library changes, but it has the most
> > important ones. Obviously it can't include anything that third-party
> > modules do.
> >
> > The main incompatibility is obviously strings, and there various modules
> > have adopted different strategies for the transition.
>
> Unfortunately starting there means ignoring all the compatibilities
> that were implemented in more recent versions. Notably, Python 3.3
> introduced u"..." literals, and 3.5 allows you to use percent
> interpolation with bytes as well as text. So those kinds of
> differences are no longer significant.
>
> ChrisA

This is what I have in my script (reproduction steps):

igor@IgorReinCloud ~/dbhandler/libdbwindow/res/gui $ python
Python 3.6.5 (default, Oct  5 2018, 14:32:41)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import array
>>> bytes = array.array('B', open("bold.png", "rb").read())
>>> bytes[0:16].tostring()
b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR'
>>> if bytes[0:16].tostring() != '\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR':
... print("Failed")
...
Failed
>>>

Do I just need to add "b" in front of the string to make it work with both?
Or I need to check version call?

Thank you.

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


Re: Coding problem

2019-06-17 Thread Rhodri James

On 14/06/2019 10:32, INJAMUL HOQUE wrote:


...nothing.  I'm afraid your email had no content when it reached us. 
If you included a screen shot, I'm afraid it was automatically removed 
before it reached us.


--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


Re: Is there an archive of this list with permanent URLs to each message?

2019-06-17 Thread Skip Montanaro
> Hello! When I wrote Fluent Python a few years ago I provided my
> readers with hundreds of links to my sources, including several links
> to messages in the python-list archive.
>
> Now as I prepare the 2nd edition I notice all my links to this list
> are broken. Apparently mailman rebuilds the archives and changes the
> ids of the messages.
>
> Is there an archive of python-list that preserves each message with a
> permanent URL?

This list hasn't yet been moved to Mailman 3. I believe once it is,
permalinks will be more permanent. You might want to drop an email to
[email protected] to see if migration will happen in the near
future. I know several other lists were recently migrated (python-dev
and python-ideas come to mind).

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


Re: python 2 to 3 conversion

2019-06-17 Thread Grant Edwards
On 2019-06-17, Igor Korot  wrote:

> So, how do I write the code compatible with both python 2 and python 3
> in this case?

Writing 2/3 compatible code that deals with bytes is difficult.  For example:

Python 2.7.15 (default, Sep 12 2018, 15:19:18)

>>> bytes(5)
'5'
>>> b'1234'[0]
'1'


Python 3.7.3 (default, May 20 2019, 15:21:07)

>>> bytes(5)
b'\x00\x00\x00\x00\x00'
>>> b'1234'[0]
49

Differences like those mean you can't really use the bytes type/class
or indexing of bytes objects in code that needs to be 2/3 compatible.

I tried writing a bytes class for 2.7, but gave up.

In anything dealing with bytes, trying to be compatible with 2 and 3
is a lot of work, and I usually don't bother.

-- 
Grant Edwards   grant.b.edwardsYow! I guess you guys got
  at   BIG MUSCLES from doing too
  gmail.commuch STUDYING!

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


Re: python 2 to 3 conversion

2019-06-17 Thread Chris Angelico
On Mon, Jun 17, 2019 at 11:15 PM Igor Korot  wrote:
>
> Hi, Chris et al,
>
> On Mon, Jun 17, 2019 at 8:00 AM Chris Angelico  wrote:
> >
> > On Mon, Jun 17, 2019 at 10:50 PM Thomas Jollans  wrote:
> > >
> > > On 17/06/2019 15.14, Igor Korot wrote:
> > > > Hi,
> > > > Is there a place where there is a full list of incompatibilities between
> > > > python 2 and python 3 is available and how to fix them?
> > >
> > > ‘What’s new in Python 3.0’ is a good starting point
> > >
> > > https://docs.python.org/3/whatsnew/3.0.html
> > >
> > > It doesn’t list all standard library changes, but it has the most
> > > important ones. Obviously it can't include anything that third-party
> > > modules do.
> > >
> > > The main incompatibility is obviously strings, and there various modules
> > > have adopted different strategies for the transition.
> >
> > Unfortunately starting there means ignoring all the compatibilities
> > that were implemented in more recent versions. Notably, Python 3.3
> > introduced u"..." literals, and 3.5 allows you to use percent
> > interpolation with bytes as well as text. So those kinds of
> > differences are no longer significant.
> >
> > ChrisA
>
> This is what I have in my script (reproduction steps):
>
> igor@IgorReinCloud ~/dbhandler/libdbwindow/res/gui $ python
> Python 3.6.5 (default, Oct  5 2018, 14:32:41)
> [GCC 7.3.0] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import array
> >>> bytes = array.array('B', open("bold.png", "rb").read())
> >>> bytes[0:16].tostring()
> b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR'
> >>> if bytes[0:16].tostring() != '\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR':
> ... print("Failed")
> ...
> Failed
> >>>
>
> Do I just need to add "b" in front of the string to make it work with both?
> Or I need to check version call?
>

Yep, all you need to do is compare against a byte string. That should
be the only change needed. Currently, you're checking against a byte
string in Py2, and a text string in Py3; but the b"..." prefix will
make them consistent.

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


RE: Python-list Digest, Vol 189, Issue 17

2019-06-17 Thread Schachner, Joseph
Please see https://docs.python.org/2/library/colorsys.html

And follow the links in there, read the FAQ. 

You'll find that python represents RGB values in three numeric values.  Very 
simple.  I believe scale is 0.0 to 1.0.

--- Joseph S.

-Original Message-
From: Python-list 
 On Behalf Of 
[email protected]
Sent: Monday, June 17, 2019 10:28 AM
To: [email protected]
Subject: Python-list Digest, Vol 189, Issue 17

---External Email---

Send Python-list mailing list submissions to
[email protected]

To subscribe or unsubscribe via the World Wide Web, visit
https://mail.python.org/mailman/listinfo/python-list
or, via email, send a message with subject or body 'help' to
[email protected]

You can reach the person managing the list at
[email protected]

When replying, please edit your Subject line so it is more specific than "Re: 
Contents of Python-list digest..."
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python 2 to 3 conversion

2019-06-17 Thread Igor Korot
Hi, Chris,

On Mon, Jun 17, 2019 at 9:55 AM Chris Angelico  wrote:
>
> On Mon, Jun 17, 2019 at 11:15 PM Igor Korot  wrote:
> >
> > Hi, Chris et al,
> >
> > On Mon, Jun 17, 2019 at 8:00 AM Chris Angelico  wrote:
> > >
> > > On Mon, Jun 17, 2019 at 10:50 PM Thomas Jollans  wrote:
> > > >
> > > > On 17/06/2019 15.14, Igor Korot wrote:
> > > > > Hi,
> > > > > Is there a place where there is a full list of incompatibilities 
> > > > > between
> > > > > python 2 and python 3 is available and how to fix them?
> > > >
> > > > ‘What’s new in Python 3.0’ is a good starting point
> > > >
> > > > https://docs.python.org/3/whatsnew/3.0.html
> > > >
> > > > It doesn’t list all standard library changes, but it has the most
> > > > important ones. Obviously it can't include anything that third-party
> > > > modules do.
> > > >
> > > > The main incompatibility is obviously strings, and there various modules
> > > > have adopted different strategies for the transition.
> > >
> > > Unfortunately starting there means ignoring all the compatibilities
> > > that were implemented in more recent versions. Notably, Python 3.3
> > > introduced u"..." literals, and 3.5 allows you to use percent
> > > interpolation with bytes as well as text. So those kinds of
> > > differences are no longer significant.
> > >
> > > ChrisA
> >
> > This is what I have in my script (reproduction steps):
> >
> > igor@IgorReinCloud ~/dbhandler/libdbwindow/res/gui $ python
> > Python 3.6.5 (default, Oct  5 2018, 14:32:41)
> > [GCC 7.3.0] on linux
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> import array
> > >>> bytes = array.array('B', open("bold.png", "rb").read())
> > >>> bytes[0:16].tostring()
> > b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR'
> > >>> if bytes[0:16].tostring() != '\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR':
> > ... print("Failed")
> > ...
> > Failed
> > >>>
> >
> > Do I just need to add "b" in front of the string to make it work with both?
> > Or I need to check version call?
> >
>
> Yep, all you need to do is compare against a byte string. That should
> be the only change needed. Currently, you're checking against a byte
> string in Py2, and a text string in Py3; but the b"..." prefix will
> make them consistent.

Thank you.
I will try to test it tonight pulling my python 2 install.

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


Re: Subprocess

2019-06-17 Thread Terry Reedy

On 6/14/2019 11:09 AM, Douglas Beard via Python-list wrote:

Error: IDLE's Subprocess didn't make connection. Either IDLE can't start a 
subprocess or personal firewall is blocking the connection.python has been 
working fine until today. I used the python repair but no luck. it does not 
seem my firewall is blocking. please help


https://docs.python.org/3/library/idle.html#startup-failure
gives several possible IDLE startup failure reasons and things to check

--
Terry Jan Reedy

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


Re: Understand workflow about reading and writing files in Python

2019-06-17 Thread Terry Reedy

On 6/15/2019 12:52 AM, Windson Yang wrote:

I'm trying to understand the workflow of how python read/writes files with
buffer. I drew a diagram for it.  I will be appreciated if someone can
review the diagram :D

[image: 屏幕快照 2019-06-15 下午12.50.57.png]


Text only list, no attachments.
--
Terry Jan Reedy


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


Re: Cannot install python on my system

2019-06-17 Thread Terry Reedy

On 6/16/2019 6:45 PM, EMAX ENGRG SERVICES LTD wrote:


Please I have  difficulties installing python on my system. After downloading 
the extension, yet it would not take me to sequence of agreeing to license and 
terms.


You need to be much more detailed and specific as to what you did and 
what happened.


--
Terry Jan Reedy

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


Re: Python-list Digest, Vol 189, Issue 17

2019-06-17 Thread אורי
Please don't reply to digest.
אורי
[email protected]


On Mon, Jun 17, 2019 at 6:01 PM Schachner, Joseph <
[email protected]> wrote:

> Please see https://docs.python.org/2/library/colorsys.html
>
> And follow the links in there, read the FAQ.
>
> You'll find that python represents RGB values in three numeric values.
> Very simple.  I believe scale is 0.0 to 1.0.
>
> --- Joseph S.
>
> -Original Message-
> From: Python-list  [email protected]> On Behalf Of [email protected]
> Sent: Monday, June 17, 2019 10:28 AM
> To: [email protected]
> Subject: Python-list Digest, Vol 189, Issue 17
>
> ---External Email---
>
> Send Python-list mailing list submissions to
> [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://mail.python.org/mailman/listinfo/python-list
> or, via email, send a message with subject or body 'help' to
> [email protected]
>
> You can reach the person managing the list at
> [email protected]
>
> When replying, please edit your Subject line so it is more specific than
> "Re: Contents of Python-list digest..."
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to create a RGB color Table

2019-06-17 Thread Vlastimil Brom
po 17. 6. 2019 v 11:30 odesílatel Jorge Conrado Conforte
 napsal:
>
> HI,
>
> Please someone could help me. How can I create a new color table with the 
> values of r g and b that I have. I use the Mataplolib color tables. However, 
> I would like to use a new color table with the respective r g b values that I 
> have.
>
> Thank you.
>
>...

Hi,
I am not sure, this is exactly what you are looking for, but there
seems to be a similar topic covered in matplotlib docs:
https://matplotlib.org/3.1.0/tutorials/colors/colormap-manipulation.html#creating-listed-colormaps

It seems, you can just pass the multidimensional sequence to
ListedColormap from matplotlib.colors
There needs to be an alpha value too - i.e. RGBA

hth,
vbr
-- 
https://mail.python.org/mailman/listinfo/python-list


Which curses version should I use under Windows

2019-06-17 Thread jfong
As many others had encountered, when I import the curses module under Windows, 
I got

ImportError: No module named '_curses'

Search "curses" on the Pypi returns plenty of related packages. Which one 
should I use? Is this package still valid on usage? Any comment will be 
appreciated.

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


Re: Which curses version should I use under Windows

2019-06-17 Thread MRAB

On 2019-06-18 02:39, [email protected] wrote:

As many others had encountered, when I import the curses module under Windows, 
I got

 ImportError: No module named '_curses'

Search "curses" on the Pypi returns plenty of related packages. Which one 
should I use? Is this package still valid on usage? Any comment will be appreciated.


I'd probably go for "windows-curses". Seems to install OK.
--
https://mail.python.org/mailman/listinfo/python-list


Re: Which curses version should I use under Windows

2019-06-17 Thread jfong
MRAB於 2019年6月18日星期二 UTC+8上午10時08分23秒寫道:
> On 2019-06-18 02:39, [email protected] wrote:
> > As many others had encountered, when I import the curses module under 
> > Windows, I got
> > 
> >  ImportError: No module named '_curses'
> > 
> > Search "curses" on the Pypi returns plenty of related packages. Which one 
> > should I use? Is this package still valid on usage? Any comment will be 
> > appreciated.
> > 
> I'd probably go for "windows-curses". Seems to install OK.

Thank you for your prompt reply.

I got the following error:

c:\Works\Python34>pip install windows-curses
DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the last 
one supporting it. Please upgrade your Python as Python 3.4 w
on't be maintained after March 2019 (cf PEP 429).
Collecting windows-curses
  ERROR: Could not find a version that satisfies the requirement windows-curses 
(from versions: none)
ERROR: No matching distribution found for windows-curses

What to do?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Which curses version should I use under Windows

2019-06-17 Thread Terry Reedy

On 6/17/2019 10:54 PM, [email protected] wrote:


c:\Works\Python34>pip install windows-curses
DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the last 
one supporting it. Please upgrade your Python as Python 3.4 w
on't be maintained after March 2019 (cf PEP 429).
Collecting windows-curses
   ERROR: Could not find a version that satisfies the requirement 
windows-curses (from versions: none)
ERROR: No matching distribution found for windows-curses

What to do?


What is says, use a newer python.

It is quite possible that there is not 3.4 package for windows-curses. 
Look it up on pypi.org.


--
Terry Jan Reedy

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


Re: Subprocess

2019-06-17 Thread Terry Reedy

On 6/17/2019 11:36 AM, Terry Reedy wrote:

On 6/14/2019 11:09 AM, Douglas Beard via Python-list wrote:
Error: IDLE's Subprocess didn't make connection. Either IDLE can't 
start a subprocess or personal firewall is blocking the 
connection.python has been working fine until today. I used the python 
repair but no luck. it does not seem my firewall is blocking. please help


https://docs.python.org/3/library/idle.html#startup-failure
gives several possible IDLE startup failure reasons and things to check


I added this reverence to the error message.


--
Terry Jan Reedy

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


Re: Please solve my problem

2019-06-17 Thread Abdur-Rahmaan Janhangeer
If you have a 32bit pc it won't install.

Abdur-Rahmaan Janhangeer
https://github.com/Abdur-rahmaanJ
Mauritius
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Which curses version should I use under Windows

2019-06-17 Thread jfong
Terry Reedy於 2019年6月18日星期二 UTC+8上午11時03分00秒寫道:
> On 6/17/2019 10:54 PM, [email protected] wrote:
> 
> > c:\Works\Python34>pip install windows-curses
> > DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the 
> > last one supporting it. Please upgrade your Python as Python 3.4 w
> > on't be maintained after March 2019 (cf PEP 429).
> > Collecting windows-curses
> >ERROR: Could not find a version that satisfies the requirement 
> > windows-curses (from versions: none)
> > ERROR: No matching distribution found for windows-curses
> > 
> > What to do?
> 
> What is says, use a newer python.
> 
> It is quite possible that there is not 3.4 package for windows-curses. 
> Look it up on pypi.org.
> 
> -- 
> Terry Jan Reedy

You are right, there is no package for Python 3.4.

In the project description:

'''Adds support for the standard Python curses module on Windows. Based on 
https://www.lfd.uci.edu/~gohlke/pythonlibs/#curses. Uses the PDCurses curses 
implementation.'''

Do I have to install the curses package mentioned there before install/use 
windows-curses? How to use this windows-curses? still "import curses"? I am so 
confused!


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