Re: Python 3.8.5 Not Launching

2020-10-02 Thread Gertjan Klein

Eryk Sun wrote:


If .py files are associated with py.exe or python.exe, then running a
.py script either inherits or allocates a console and attaches to it.


Is it possible to determine, from within Python, whether Python 
allocated or inherited the console? This could be useful to know in a 
(global) error trap: to be able to see a traceback, the console must 
remain open, which won't happen if Python allocated the console itself.


Regards,
Gertjan.
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3.8.5 Not Launching

2020-10-02 Thread Chris Angelico
On Fri, Oct 2, 2020 at 7:51 PM Gertjan Klein  wrote:
>
> Eryk Sun wrote:
>
> > If .py files are associated with py.exe or python.exe, then running a
> > .py script either inherits or allocates a console and attaches to it.
>
> Is it possible to determine, from within Python, whether Python
> allocated or inherited the console? This could be useful to know in a
> (global) error trap: to be able to see a traceback, the console must
> remain open, which won't happen if Python allocated the console itself.
>

It might be possible, but then there'd have to be lots of magic and
the result would be a different set of complaints ("sometimes I get a
black window, other times it just disappears"). Instead of trying to
detect and such, maybe there needs to be a standard recommendation for
an atexit or something - advise people to "stick this line at the top
of your program so the black window stays around". No magic, and
completely consistent.

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


Re: Python 3.8.5 Not Launching

2020-10-02 Thread Eryk Sun
On 10/2/20, Gertjan Klein  wrote:
> Eryk Sun wrote:
>
>> If .py files are associated with py.exe or python.exe, then running a
>> .py script either inherits or allocates a console and attaches to it.
>
> Is it possible to determine, from within Python, whether Python
> allocated or inherited the console?

If a console session isn't headless (i.e. it's not a pseudoconsole)
and has a window (i.e. not allocated with CREATE_NO_WINDOW), then the
effective owner of the window is initially the process that allocated
the console session, as long as it's still running and attached. For
example, with "python.exe" (not a launcher) executed from Explorer:

>>> hwnd = win32console.GetConsoleWindow()
>>> tid, pid = win32process.GetWindowThreadProcessId(hwnd)
>>> pid == os.getpid()
True

A problem is the case of a launcher such as "py.exe", or the
"python.exe" launcher used by venv virtual environments. A venv
launcher can be detected by comparing sys.executable with
sys._base_executable. For example, with a venv launcher executed from
Explorer:

>>> hwnd = win32console.GetConsoleWindow()
>>> tid, pid = win32process.GetWindowThreadProcessId(hwnd)

The current process doesn't own the console, but the parent does:

>>> pid == os.getpid()
False
>>> pid == os.getppid()
True

Check whether the parent is a venv launcher:

>>> print(sys.executable)
C:\Temp\env\test38\Scripts\python.exe
>>> print(sys._base_executable)
C:\Program Files\Python38\python.exe

Double check that the parent is the venv launcher:

>>> access = win32con.PROCESS_QUERY_LIMITED_INFORMATION
>>> hproc = win32api.OpenProcess(access, False, pid)
>>> executable = win32process.GetModuleFileNameEx(hproc, None)
>>> os.path.samefile(executable, sys.executable)
True
-- 
https://mail.python.org/mailman/listinfo/python-list


ValueError: arrays must all be same length

2020-10-02 Thread Shaozhong SHI
Hello,

I got a json response from an API and tried to use pandas to put data into
a dataframe.

However, I kept getting this ValueError: arrays must all be same length.

Can anyone help?

The following is the json text.  Regards, Shao

{
  "locationId": "1-1004508435",
  "providerId": "1-101641521",
  "organisationType": "Location",
  "type": "Social Care Org",
  "name": "Meadow Rose Nursing Home",
  "brandId": "BD510",
  "brandName": "BRAND MACC Care",
  "onspdCcgCode": "E38000220",
  "onspdCcgName": "NHS Birmingham and Solihull CCG",
  "odsCode": "VM4G9",
  "uprn": "100070537642",
  "registrationStatus": "Registered",
  "registrationDate": "2013-12-16",
  "dormancy": "N",
  "numberOfBeds": 56,
  "postalAddressLine1": "96 The Roundabout",
  "postalAddressTownCity": "Birmingham",
  "postalAddressCounty": "West Midlands",
  "region": "West Midlands",
  "postalCode": "B31 2TX",
  "onspdLatitude": 52.399843,
  "onspdLongitude": -1.989241,
  "careHome": "Y",
  "inspectionDirectorate": "Adult social care",
  "mainPhoneNumber": "01214769808",
  "constituency": "Birmingham, Northfield",
  "localAuthority": "Birmingham",
  "lastInspection": {
"date": "2020-06-24"
  },
  "lastReport": {
"publicationDate": "2020-10-01"
  },
  "relationships": [

  ],
  "locationTypes": [

  ],
  "regulatedActivities": [
{
  "name": "Accommodation for persons who require nursing or personal care",
  "code": "RA2",
  "contacts": [
{
  "personTitle": "Mr",
  "personGivenName": "Steven",
  "personFamilyName": "Kazembe",
  "personRoles": [
"Registered Manager"
  ]
}
  ]
},
{
  "name": "Treatment of disease, disorder or injury",
  "code": "RA5",
  "contacts": [
{
  "personTitle": "Mr",
  "personGivenName": "Steven",
  "personFamilyName": "Kazembe",
  "personRoles": [
"Registered Manager"
  ]
}
  ]
}
  ],
  "gacServiceTypes": [
{
  "name": "Nursing homes",
  "description": "Care home service with nursing"
}
  ],
  "inspectionCategories": [
{
  "code": "S1",
  "primary": "true",
  "name": "Residential social care"
}
  ],
  "specialisms": [
{
  "name": "Caring for adults over 65 yrs"
},
{
  "name": "Caring for adults under 65 yrs"
},
{
  "name": "Dementia"
},
{
  "name": "Physical disabilities"
}
  ],
  "inspectionAreas": [

  ],
  "currentRatings": {
"overall": {
  "rating": "Requires improvement",
  "reportDate": "2020-10-01",
  "reportLinkId": "1157c975-c2f1-423e-a2b4-66901779e014",
  "useOfResources": {

  },
  "keyQuestionRatings": [
{
  "name": "Safe",
  "rating": "Requires improvement",
  "reportDate": "2020-10-01",
  "reportLinkId": "1157c975-c2f1-423e-a2b4-66901779e014"
},
{
  "name": "Well-led",
  "rating": "Requires improvement",
  "reportDate": "2020-10-01",
  "reportLinkId": "1157c975-c2f1-423e-a2b4-66901779e014"
},
{
  "name": "Caring",
  "rating": "Good",
  "reportDate": "2019-10-04",
  "reportLinkId": "63ff05ec-4d31-406e-83de-49a271cfdc43"
},
{
  "name": "Responsive",
  "rating": "Good",
  "reportDate": "2019-10-04",
  "reportLinkId": "63ff05ec-4d31-406e-83de-49a271cfdc43"
},
{
  "name": "Effective",
  "rating": "Requires improvement",
  "reportDate": "2019-10-04",
  "reportLinkId": "63ff05ec-4d31-406e-83de-49a271cfdc43"
}
  ]
},
"reportDate": "2020-10-01"
  },
  "historicRatings": [
{
  "reportLinkId": "63ff05ec-4d31-406e-83de-49a271cfdc43",
  "reportDate": "2019-10-04",
  "overall": {
"rating": "Requires improvement",
"keyQuestionRatings": [
  {
"name": "Safe",
"rating": "Requires improvement"
  },
  {
"name": "Well-led",
"rating": "Requires improvement"
  }
]
  }
},
{
  "reportLinkId": "4f20da40-89a4-4c45-a7f9-bfd52b48f286",
  "reportDate": "2017-09-08",
  "overall": {
"rating": "Good",
"keyQuestionRatings": [
  {
"name": "Safe",
"rating": "Good"
  },
  {
"name": "Well-led",
"rating": "Good"
  },
  {
"name": "Caring",
"rating": "Good"
  },
  {
"name": "Responsive",
"rating": "Good"
  },
  {
"name": "Effective",
"rating": "Requires improvement"
  }
]
  }
},
{
  "reportLinkId": "0cc4226b-401e-4f0f-ba35-062cbadffa8f",
  "reportDate": "2016-06-11",
  "overall": {
"rating": "Requires impro

Re: Problem

2020-10-02 Thread Terry Reedy

On 10/1/2020 4:09 PM, Mirko via Python-list wrote:


Renaming "IDLE" to "Python IDE" (or similar) might also.
"IDLE" intentionally echoes 'Idle', as in Eric Idle of Monty Python.  It 
stands for "Integrated Development and Learning Environment".  It is *a* 
Python IDE aimed especially at beginners (the 'Learning' part).  (I 
should probably revised the doc a bit.)


Changing a name in use around the world, in books and web sites and 
discussion posts and a Stackoverflow tag ('python-idle') is a bad idea. 
And, as Chris said, implying that it is *the* Python IDE is not a good 
idea either.


I think changing the start menu entry
"IDLE (Python 3.9 64 bit)"
to something more descriptive, as suggested by Mirko, *is* a good idea.

The current longest entry under "Python 3.9" is
"Python 3.9 Module Docs (64-bit)"
So
"IDLE Shell/Editor (3.9 64-bit)"
would fit.  I opened a bpo issue with more discussion.
https://bugs.python.org/issue41908
Bpo users with an opinion should express it there.

Terry Jan Reedy

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


Error 0xc000007b on opening python

2020-10-02 Thread Nipur Gupta
I've downloaded python 3.6.0 64 bits but whenever I try to open idle, it
doesn't open and displays error 0xc07b. I've tried everything from
reinstalling to updating windows and visual c++ but it's still the same. I
downloaded python earlier also it worked that time but opening after few
days it showed this error, since then it's not working. I'm using windows
8.1 64 bit...Please help me in this regard
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Error 0xc000007b on opening python

2020-10-02 Thread J.O. Aho

On 02/10/2020 12:15, Nipur Gupta wrote:

I've downloaded python 3.6.0 64 bits but whenever I try to open idle, it
doesn't open and displays error 0xc07b. I've tried everything from
reinstalling to updating windows and visual c++ but it's still the same.


There seems to be quite many things that can cause this, you can try to 
reinstall driectx and .net frameworks, just see to install the right 
version, don't use a 32bit version of the packages on your 64bit 
microsoft windows installation.





I'm using windows 8.1 64 bit...Please help me in this regard


There is always the option of upgrading, go and visit 
https://distrowatch.com and install the flavor you thinks fit your best.



--

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


Re: Error 0xc000007b on opening python

2020-10-02 Thread Mats Wichmann
On 10/2/20 4:15 AM, Nipur Gupta wrote:
> I've downloaded python 3.6.0 64 bits but whenever I try to open idle, it
> doesn't open and displays error 0xc07b. I've tried everything from
> reinstalling to updating windows and visual c++ but it's still the same. I
> downloaded python earlier also it worked that time but opening after few
> days it showed this error, since then it's not working. I'm using windows
> 8.1 64 bit...Please help me in this regard
> 

Something like this, when a program worked, and then stops working,
usually indicates some kind of corruption - or some change you made. Did
you install another version of Python later?  Try using Microsoft's
tools for validating and repairing the system and the image that backs
it up.  Beyond the scope of this list to describe that, but you can look
for articles that describe that. For example:

https://support.microsoft.com/en-us/help/929833/use-the-system-file-checker-tool-to-repair-missing-or-corrupted-system

Are you able to open Python itself, or does it show the same issue?

You should not be using Python 3.6.0.  If you have something that tells
you you must use 3.6.0 (which probably is not a real requirement
anyway), then at the very least select the latest installer in the 3.6
series, which has all the released bugfixes - I believe that is 3.6.8.
That's unlikely to have an effect on your problem, but don't continue
trying to use 3.6.0.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: List of All Error Menssages

2020-10-02 Thread Dieter Maurer
Luis Gustavo Araujo wrote at 2020-10-1 16:06 -0300:
>Is it possible to get the list of all error messages that display in
>Python? I want the full message -> type error: additional message.
>
>Examples:
>NameError: name 'x' is not defined
>IndentationError: unindent does not match any outer indentation level

Some systems indicates errors with an error code (often a number).
If they in addition do not include an error description, you
need a list mapping codes to description.

Python indicates errors via exceptions, documented in the Python
documentation (as far as used by Python; applications may define/derive
further exceptions). In addition, error reports are usually
made descriptive.
An example is `NameError: name 'x' is not defined`: it informs
you about a problem with the name `x`. In addition, you usually
get a traceback - which tells you where in the code the problem
was detected and the (function call) context that led to the problem.
This wealth of direct information removes the need to have
an error list.

In addition: the additional information (beside the exception type)
depends on the concrete situation: it is impossible to list
it beforehand.

>In this webpage (https://docs.python.org/3/library/exceptions.html) I only
>can check the type error.

`exceptions.html` describes Python's exception type hierarchy
(note: Python is object oriented and exceptions are organized into
a class hierarchy) and the exception types used by Python itself.

As you have found out, this describes only the exception types.
When an exception occurs, the type is usally enhanced by
a speaking error description, often including information
about your application entities involved in the exception,
e.g.
>>> open("abc")
Traceback (most recent call last):
  File "", line 1, in 
FileNotFoundError: [Errno 2] No such file or directory: 'abc'
```
It tells you clearly (and without the need for any list):
the problem was that a file could not have been opened
and that this file was named 'abc'.

Read error messages carefully -- they are usually "speaking".
Should you get a message you do not understand, ask here.
Otherwise, forget about lists of error messages.


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


Re: Problem

2020-10-02 Thread Hexamorph
Am 02.10.2020 um 11:58 schrieb Terry Reedy:
> On 10/1/2020 4:09 PM, Mirko via Python-list wrote:
>
>> Renaming "IDLE" to "Python IDE" (or similar) might also.
> "IDLE" intentionally echoes 'Idle', as in Eric Idle of Monty
> Python.  It stands for "Integrated Development and Learning
> Environment".  It is *a* Python IDE aimed especially at beginners
> (the 'Learning' part).  (I should probably revised the doc a bit.)
>
> Changing a name in use around the world, in books and web sites and
> discussion posts and a Stackoverflow tag ('python-idle') is a bad
> idea. And, as Chris said, implying that it is *the* Python IDE is
> not a good idea either.
>
> I think changing the start menu entry
> "IDLE (Python 3.9 64 bit)"
> to something more descriptive, as suggested by Mirko, *is* a good idea.
>
> The current longest entry under "Python 3.9" is
> "Python 3.9 Module Docs (64-bit)"
> So
> "IDLE Shell/Editor (3.9 64-bit)"
> would fit.  I opened a bpo issue with more discussion.
> https://bugs.python.org/issue41908
> Bpo users with an opinion should express it there.
>
> Terry Jan Reedy
>

Thanks!

Sorry, I have been a bit unclear in my second post. I never meant to
rename IDLE itself. Only the entries in the Startmenu, the possible
desktop icons and such.

If I had a say in all this, I would do:

- Rename the MSI as suggested by Eryk Sun.

- Add a folder named "Python.org " (or similar) to the
desktop with shortcuts to Python, IDLE and the CHM.

- Add a checkbox (default enabled) like "Start the IDLE Python
Editor/Shell" at the end of the installation procedure.

- Add a button like "Start the IDLE Python Editor/Shell" to the
Repair/Modify/Remove Dialog.


For all I know, the points 2 and 3 are very common with installation
procedures on Windows (and therefore likely expected by the users).

And no, this will not solve all problems. There will always be some
people who just don't get it. But I would be very surprised, if that
doesn't cut down the number of these beginner troubles by one or two
orders of magnitude.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem

2020-10-02 Thread Mirko via Python-list
Am 02.10.2020 um 11:58 schrieb Terry Reedy:
> On 10/1/2020 4:09 PM, Mirko via Python-list wrote:
> 
>> Renaming "IDLE" to "Python IDE" (or similar) might also.
> "IDLE" intentionally echoes 'Idle', as in Eric Idle of Monty
> Python.  It stands for "Integrated Development and Learning
> Environment".  It is *a* Python IDE aimed especially at beginners
> (the 'Learning' part).  (I should probably revised the doc a bit.)
> 
> Changing a name in use around the world, in books and web sites and
> discussion posts and a Stackoverflow tag ('python-idle') is a bad
> idea. And, as Chris said, implying that it is *the* Python IDE is
> not a good idea either.
> 
> I think changing the start menu entry
> "IDLE (Python 3.9 64 bit)"
> to something more descriptive, as suggested by Mirko, *is* a good idea.
> 
> The current longest entry under "Python 3.9" is
> "Python 3.9 Module Docs (64-bit)"
> So
> "IDLE Shell/Editor (3.9 64-bit)"
> would fit.  I opened a bpo issue with more discussion.
> https://bugs.python.org/issue41908
> Bpo users with an opinion should express it there.
> 
> Terry Jan Reedy
> 

(Sorry for the mail from the other wrong account again, need to
change that)

Thanks!

Sorry, I have been a bit unclear in my second post. I never meant to
rename IDLE itself. Only the entries in the Startmenu, the possible
desktop icons and such.

If I had a say in all this, I would do:

- Rename the MSI as suggested by Eryk Sun.

- Add a folder named "Python.org " (or similar) to the
desktop with shortcuts to Python, IDLE and the CHM.

- Add a checkbox (default enabled) like "Start the IDLE Python
Editor/Shell" at the end of the installation procedure.

- Add a button like "Start the IDLE Python Editor/Shell" to the
Repair/Modify/Remove Dialog.


For all I know, the points 2 and 3 are very common with installation
procedures on Windows (and therefore likely expected by the users).

And no, this will not solve all problems. There will always be some
people who just don't get it. But I would be very surprised, if that
doesn't cut down the number of these beginner troubles by one or two
orders of magnitude.
-- 
https://mail.python.org/mailman/listinfo/python-list


How to handle a dictionary value that is a list

2020-10-02 Thread Shaozhong SHI
Hi, All,

I was trying to handle the value of  "personRoles" in a part of json
dictionary.

Can anyone tell me various ways to handle this?

Regards,

Shao

"regulatedActivities": [
{
  "name": "Accommodation for persons who require nursing or personal
care",
  "code": "RA2",
  "contacts": [
{
  "personTitle": "Mr",
  "personGivenName": "Steven",
  "personFamilyName": "Great",
  "personRoles": [
"Registered Manager"
  ]

e,f = [],[]
for result in d['regulatedActivities']:
e.append(result['name'])
    for s in result['contacts']['personRoles']:
    t = (list)
  print s ###f.append(s)
f = d['regulatedActivities']['contacts']['personRoles']
df1 = pd.DataFrame([e,f]).T
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: List of All Error Menssages

2020-10-02 Thread Kyle Stanley
Hi Luis,

There is not a maintained list of every possible combination of exception
type and message because they're continuously being added within the Python
standard library, and exception messages are considered an implementation
detail that are subject to change. While there are many that have remained
the same for many years and likely will continue to, we do periodically
adjust some to add additional information, make formatting fixes, and/or
improve grammar. Documenting exception messages formally would essentially
remove them from being implementation details (meaning that they can't as
easily be adjusted); not to mention the long term cost of continuously
updating that list each time a new exception message is written somewhere
within the standard library. It would not be very sustainable, even more so
if you consider that CPython development is mostly volunteer-driven efforts.

Regards,
Kyle Stanley

On Thu, Oct 1, 2020 at 3:18 PM Luis Gustavo Araujo <
[email protected]> wrote:

>   Hi,
> Is it possible to get the list of all error messages that display in
> Python? I want the full message -> type error: additional message.
>
> Examples:
> NameError: name 'x' is not defined
> IndentationError: unindent does not match any outer indentation level
>
> In this webpage (ttps://docs.python.org/3/library/exceptions.html) I only
> can check the type error.
>
> []s
>
>
> Em qui., 1 de out. de 2020 às 15:59, Luis Gustavo Araujo <
> [email protected]> escreveu:
>
> > Hi,
> > Is it possible to get the list of all error messages that display in
> > Python? I want the full message -> type error: additional message.
> >
> > Examples:
> > NameError: name 'x' is not defined
> > IndentationError: unindent does not match any outer indentation level
> >
> > In this webpage (ttps://docs.python.org/3/library/exceptions.html) I
> only
> > can check the type error.
> >
> > []s
> >
> >
> > --
> >
> > [image: Prefeitura Municipal de Amélia Rodrigues]
> > 
> >
> > LUIS GUSTAVO ARAUJO
> > *Amélia Rodrigues Prefecture - Brazil  (*
> >
> > *Teacher of Computer Science) UNIFACS - Laureate International
> > Universities (Professor Assistant I)*
> >
> > Degree in Computer Science (IFBA) - 2015
> > Master Degrees in Computer Applied (UEFS) - 2018
> > PhD  Student in Computer Science (UFBA)
> > *http://dgp.cnpq.br/dgp/espelhorh/8431672735528634
> > *
> >
> > [image: Twitter]   [image: Facebook]
> >  [image: Github]
> > 
> >
> >
> >
> >
> > <
> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
> Livre
> > de vírus. www.avast.com
> > <
> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
> >.
> > <#m_-2814426795322638799_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> >
>
>
> --
>
> [image: Prefeitura Municipal de Amélia Rodrigues]
> 
>
> LUIS GUSTAVO ARAUJO
> *Amélia Rodrigues Prefecture - Brazil  (*
>
> *Teacher of Computer Science) UNIFACS - Laureate International Universities
> (Professor Assistant I)*
>
> Degree in Computer Science (IFBA) - 2015
> Master Degrees in Computer Applied (UEFS) - 2018
> PhD  Student in Computer Science (UFBA)
> *http://dgp.cnpq.br/dgp/espelhorh/8431672735528634
> *
>
> [image: Twitter]   [image: Facebook]
>  [image: Github]
> 
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: List of All Error Menssages

2020-10-02 Thread Luis Gustavo Araujo
Hi Kyle,

Thanks!

Att,


Livre
de vírus. www.avast.com
.
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Em sex., 2 de out. de 2020 às 18:03, Kyle Stanley 
escreveu:

> Hi Luis,
>
> There is not a maintained list of every possible combination of exception
> type and message because they're continuously being added within the Python
> standard library, and exception messages are considered an implementation
> detail that are subject to change. While there are many that have remained
> the same for many years and likely will continue to, we do periodically
> adjust some to add additional information, make formatting fixes, and/or
> improve grammar. Documenting exception messages formally would essentially
> remove them from being implementation details (meaning that they can't as
> easily be adjusted); not to mention the long term cost of continuously
> updating that list each time a new exception message is written somewhere
> within the standard library. It would not be very sustainable, even more so
> if you consider that CPython development is mostly volunteer-driven efforts.
>
> Regards,
> Kyle Stanley
>
> On Thu, Oct 1, 2020 at 3:18 PM Luis Gustavo Araujo <
> [email protected]> wrote:
>
>>   Hi,
>> Is it possible to get the list of all error messages that display in
>> Python? I want the full message -> type error: additional message.
>>
>> Examples:
>> NameError: name 'x' is not defined
>> IndentationError: unindent does not match any outer indentation level
>>
>> In this webpage (ttps://docs.python.org/3/library/exceptions.html) I only
>> can check the type error.
>>
>> []s
>>
>>
>> Em qui., 1 de out. de 2020 às 15:59, Luis Gustavo Araujo <
>> [email protected]> escreveu:
>>
>> > Hi,
>> > Is it possible to get the list of all error messages that display in
>> > Python? I want the full message -> type error: additional message.
>> >
>> > Examples:
>> > NameError: name 'x' is not defined
>> > IndentationError: unindent does not match any outer indentation level
>> >
>> > In this webpage (ttps://docs.python.org/3/library/exceptions.html) I
>> only
>> > can check the type error.
>> >
>> > []s
>> >
>> >
>> > --
>> >
>> > [image: Prefeitura Municipal de Amélia Rodrigues]
>> > 
>> >
>> > LUIS GUSTAVO ARAUJO
>> > *Amélia Rodrigues Prefecture - Brazil  (*
>> >
>> > *Teacher of Computer Science) UNIFACS - Laureate International
>> > Universities (Professor Assistant I)*
>> >
>> > Degree in Computer Science (IFBA) - 2015
>> > Master Degrees in Computer Applied (UEFS) - 2018
>> > PhD  Student in Computer Science (UFBA)
>> > *http://dgp.cnpq.br/dgp/espelhorh/8431672735528634
>> > *
>> >
>> > [image: Twitter]   [image:
>> Facebook]
>> >  [image: Github]
>> > 
>> >
>> >
>> >
>> >
>> > <
>> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
>> Livre
>> > de vírus. www.avast.com
>> > <
>> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
>> >.
>> > <#m_-2814426795322638799_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>> >
>>
>>
>> --
>>
>> [image: Prefeitura Municipal de Amélia Rodrigues]
>> 
>>
>> LUIS GUSTAVO ARAUJO
>> *Amélia Rodrigues Prefecture - Brazil  (*
>>
>> *Teacher of Computer Science) UNIFACS - Laureate International
>> Universities
>> (Professor Assistant I)*
>>
>> Degree in Computer Science (IFBA) - 2015
>> Master Degrees in Computer Applied (UEFS) - 2018
>> PhD  Student in Computer Science (UFBA)
>> *http://dgp.cnpq.br/dgp/espelhorh/8431672735528634
>> *
>>
>> [image: Twitter]   [image: Facebook]
>>  [image: Github]
>> 
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>

-- 

[image: Prefeitura Municipal de Amélia Rodrigues]


LUIS GUSTAVO ARAUJO
*Amélia Rodrigues Prefecture - Brazil  (*

*Teacher of Computer Science) UNIFACS - Laureate International Universities
(Professor Assistant I)*

Degree in Computer Science (IFBA) - 2015
Master Degrees in Computer Applied (UEFS) - 2018
PhD  Student in Computer Science (UFBA)
*http://dgp.cnpq.br/dgp/espelhorh/8431672735528634
*

[image: Twitter]   [image: Facebook]
 [image: Github]






Re: Error 0xc000007b on opening python

2020-10-02 Thread Eryk Sun
On 10/2/20, Nipur Gupta  wrote:
> I've downloaded python 3.6.0 64 bits but whenever I try to open idle, it

Python 3.8 supports Windows 8.1, so, unless otherwise required, you
should install the latest release of 64-bit Python 3.8, which is
currently 3.8.6:

https://www.python.org/ftp/python/3.8.6/python-3.8.6-amd64.exe

The 3.6 branch is no longer maintained. If 3.6 is required, you should
install 3.6.8, the last build that was released for Windows about two
years ago:

https://www.python.org/ftp/python/3.6.8/python-3.6.8-amd64.exe

> doesn't open and displays error 0xc07b.

STATUS_INVALID_IMAGE_FORMAT (0xC07B or -1073741701) is an NTSTATUS
code from the native NT system beneath the Windows (Win32) API.
Low-level status codes are observed for critical failures such as
failing to initialize a process or an unhandled OS exception.

STATUS_INVALID_IMAGE_FORMAT is from the system loader during process
initialization. The executable file or a dependent DLL could be
corrupt. Or the loader might be trying to load a 32-bit DLL in a
64-bit process, or vice versa.

If the error persists after removing 3.6.0 and installing a newer
release, then I would resolve the problem by running python.exe under
a debugger with "loader snaps" enabled, which will show detailed debug
messages from the loader.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to handle a dictionary value that is a list

2020-10-02 Thread Python
On Fri, Oct 02, 2020 at 09:25:58PM +0100, Shaozhong SHI wrote:
> Hi, All,
> 
> I was trying to handle the value of  "personRoles" in a part of json
> dictionary.
> 
> Can anyone tell me various ways to handle this?

I'm not sure if I understand what you're asking, but if I do, then...
you handle it just as you would handle any other list.  The only
difference is that instead of something like "my_list", the name of
the list is d['regulatedActivities']['contacts']['personRoles'].

  https://docs.python.org/3/tutorial/datastructures.html
 
Then:

> f = d['regulatedActivities']['contacts']['personRoles']

After this executes, you have an alias for that list called "f" that
refers to the same list object instance...  So you can do all the
things you can do to a list, and refer to it either as f or as
d['regulatedActivities']['contacts']['personRoles'] when you do so.
It is an alias, not a copy, so if you change one, you change the
other.

HTH.

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


Debugging technique

2020-10-02 Thread Frank Millman

Hi all

When debugging, I sometimes add a 'breakpoint()' to my code to examine 
various objects.


However, I often want to know how I got there, so I replace the 
'breakpoint()' with a '1/0', to force a traceback at that point. Then I 
can rerun the previous step using the extra info from the traceback.


Is there a way to combine these into one step, so that, while in the 
debugger, I can find out how I got there?


Frank Millman

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