Re: What's up with Activestate Python?

2019-02-18 Thread Thomas Jollans
On 14/02/2019 19:10, Grant Edwards wrote:
> On 2019-02-14, Liste guru  wrote:
>> Il 14/02/2019 00:06, Grant Edwards ha scritto:
>>> For many, many years I've always installed ActiveState's ActivePython
>>> Community edition when forced to use Windows.  It has always included
>>> ...
>>> I guess it's time to switch to Anaconda or ???
>>
>> I've also used the ActiveState python, expecially for the 2.7.x
>> series, mainly for the oflline docs and the pywin32 libraries.
>>
>> Now the situation is better and with pip is really easy to have an 
>> updated python with a lot of libs so there is less need for the 
>> ActiveState distribution.
> 
> How does that work for libraries that require a C compiler?  Does pip
> know how to download and install any required C/C++ toolchains?
> 

Most extension modules on PyPI are distributed with binary wheels these
days, so there's no need for a C compiler. This is certainly the case
for the usual suspects (numpy etc). You probably won't have any trouble
using the python.org version. In a pinch, the Microsoft compiler isn't
hard to install (and free to download).

Anaconda also has its moments, and has some packages that PyPI doesn't
(for my use case, this is primarily PyQt5).

I don't think I've used ActiveState since the Python 2.3 days, so I
can't speak for that.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What's up with Activestate Python?

2019-02-18 Thread Barry Scott



> On 18 Feb 2019, at 08:49, Thomas Jollans  wrote:
> 
> Anaconda also has its moments, and has some packages that PyPI doesn't
> (for my use case, this is primarily PyQt5).

Odd I use PyQt5 from PyPI all the time and have for a few years now.

Barry

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


Re: What's up with Activestate Python?

2019-02-18 Thread Thomas Jollans
On 18/02/2019 10.21, Barry Scott wrote:
> 
> 
>> On 18 Feb 2019, at 08:49, Thomas Jollans  wrote:
>>
>> Anaconda also has its moments, and has some packages that PyPI doesn't
>> (for my use case, this is primarily PyQt5).
> 
> Odd I use PyQt5 from PyPI all the time and have for a few years now.

It would appear that my information is outdated!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What's up with Activestate Python?

2019-02-18 Thread Thomas Jollans
On 18/02/2019 10.21, Barry Scott wrote:
> 
> 
>> On 18 Feb 2019, at 08:49, Thomas Jollans  wrote:
>>
>> Anaconda also has its moments, and has some packages that PyPI doesn't
>> (for my use case, this is primarily PyQt5).
> 
> Odd I use PyQt5 from PyPI all the time and have for a few years now.

It would appear that my information is outdated!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What's the address for?

2019-02-18 Thread Alister via Python-list
On Mon, 18 Feb 2019 11:59:18 +, Stefan Ram wrote:

> When one prints a function, one might get something like:
> 
> 
> 
>   . The participants of my basic course asked me what the address is
>   for. I did not know.
> 
>   What's so important about the (presumed) address of a function that it
>   is shown on every stringification of each function?

it is the internal id of the function - Not necessarily an address, that 
is an implementation detail.

it is not intended for use within a program & has (almost) no practical 
use.



-- 
Microsoft Zen - Become one with the blue screen. 

   -- From a Slashdot.org post
-- 
https://mail.python.org/mailman/listinfo/python-list


New rules for scope in a function?

2019-02-18 Thread Steve
I have been programming for more years than I want to admit and believe that I 
have a good understanding when it comes to the Scope of Variables when using 
functions. Are the rules different when using python?

It looks as if I have to pass all variables to and from the function before it 
works.  Are variables used in the main program not also visible for use within 
the function?  Do these variables have to be declared as global?

Steve


Footnote:
Ultrasound Technician Asks Pregnant Woman If She’d Like To Know Baby’s Name
 

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


Re: New rules for scope in a function?

2019-02-18 Thread Chris Angelico
On Tue, Feb 19, 2019 at 4:36 AM Steve  wrote:
>
> I have been programming for more years than I want to admit and believe that 
> I have a good understanding when it comes to the Scope of Variables when 
> using functions. Are the rules different when using python?
>
> It looks as if I have to pass all variables to and from the function before 
> it works.  Are variables used in the main program not also visible for use 
> within the function?  Do these variables have to be declared as global?
>
> Steve
>

Functions in Python have access to everything in the surrounding
scopes, usually a module. Any name that's ever *assigned to* in the
function (including its parameters) is local to that function, and
anything that you look up without assigning comes from the outer
scope.

x = 1
def f(y):
print(x, y)

This function is happily able to see its own parameter (a local) and
the name from outside it (a global). It's also able to see the "print"
function, which comes from the builtins - that's just another scope.

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


RE: New rules for scope in a function?

2019-02-18 Thread Steve


OK, I wrote:

x = "A"
print("x = " + x)

def f(y):
print("x= " + x + "  y= "+ y)

f(x)

and it worked, inspite of what I was seeing in my own program.  
How quick I am to blame Python. (:
When I isolate my function that stumped me, I will post it.
Thanks.
Steve


Footnote:
Ultrasound Technician Asks Pregnant Woman If She'd Like To Know Baby's Name

-Original Message-
From: Python-list  On
Behalf Of Chris Angelico
Sent: Monday, February 18, 2019 12:40 PM
To: Python 
Subject: Re: New rules for scope in a function?

On Tue, Feb 19, 2019 at 4:36 AM Steve  wrote:
>
> I have been programming for more years than I want to admit and believe
that I have a good understanding when it comes to the Scope of Variables
when using functions. Are the rules different when using python?
>
> It looks as if I have to pass all variables to and from the function
before it works.  Are variables used in the main program not also visible
for use within the function?  Do these variables have to be declared as
global?
>
> Steve
>

Functions in Python have access to everything in the surrounding scopes,
usually a module. Any name that's ever *assigned to* in the function
(including its parameters) is local to that function, and anything that you
look up without assigning comes from the outer scope.

x = 1
def f(y):
print(x, y)

This function is happily able to see its own parameter (a local) and the
name from outside it (a global). It's also able to see the "print"
function, which comes from the builtins - that's just another scope.

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

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


Scraping multiple web pages help

2019-02-18 Thread Drake Gossi
Hello everyone,

For a research project, I need to scrape a lot of comments from
regulations.gov

https://www.regulations.gov/docketBrowser?rpp=25&so=DESC&sb=commentDueDate&po=0&dct=PS&D=ED-2018-OCR-0064

But partly what's throwing me is the url addresses of the comments. They
aren't consistent. I mean, there's some consistency insofar as the numbers
that differentiate the pages all begin after that 0064 number in the url
listed above. But the differnetiating numbers aren't even all the same
amount of numbers. Some are 4 (say, 4019) whereas others are 5 (say,
50343). But I dont think they go over 5. So this is a problem. I dont know
how to write the code to access the multiple pages.

I should also mention I'm new to programing, so that's also a problem (if
you cant already tell by the way I'm describing my problem).


I should also mention that, I think, there's an API on regulations.gov, but
I'm such a beginner that I dont evem really know where to find it, or even
what to do with it once I do. That's how helpless am right now.

Any help anyone could offer would be much appreciated.

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


Trying to compile Python 3.5 on Linux Mint 19, getting compiler warnings and failing tests

2019-02-18 Thread Marcin G
My boss wants my code to run on Python 3.5, so I thought I'd install 3.5 to be 
able to ascertain this.

But Linux Mint 19 ships with Python 3.6 and python.org only provides source 
code for 3.5.6. So I 
thought I'd try compiling 3.5.6 myself.

This produced compiler warnings about: comparison between signed and unsigned, 
switches falling though, use of deprecated macros in glibc headers and too big 
object sizes leading to overflows in memcpy. This worries me the most, because 
it looks like undefined behavior to my untrained eye. I wonder if my system is 
misconfigured? Or if the configure script picks wrong sizes for some reason? Is 
there incompatibility between Python 3.5 and newer glibc headers?

In addition, make test shows up one failing test: test_ssl.

All I want is to have an installation that is not broken. If the above failures 
are false positives, I can gladly ignore them; however, since (unsupressed) 
warnings and failing tests are usually a sign of serious problems, I wonder 
what should I do get a functional installation?

I do believe I should have all dependencies installed. First, I kept installing 
libraries until `make` stopped showing me info about missing bits for optional 
modules. Then, just to make sure, I did sudo apt-get build-dep python3. Problem 
is still not solved, however.

Pastes:

Full log. Just 
warnings. Just 
failing tests.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: (yet another) PEP idea to tackle binary wheels problem efficiently

2019-02-18 Thread Alexander Revin
Two minor typos: platform tag should be separated by "-", not "_".
Also it makes sense to use "amd64" instead of "x86_64", so platform
can be just split by "_"

On Sat, Feb 16, 2019 at 9:29 PM Alexander Revin  wrote:
>
> Hi all,
>
> I've been thoroughly reading various discussions, such as [1], [2] and
> related ones regarding PEP 425, PEP 491 and PEP 513. I also happen to
> use musl sometimes, so as discussed here [3] I thought it would be a
> good idea to submit a new PEP regarding musl compatibility.
>
> It's not a secret that everyday wheel usage on Linux is far from
> perfect. Some packages are trying to compile when there's no compiler
> on the system available, some rely on 3rd-party deps and explode when
> they cannot find required headers installed and so on. Add to this
> cross-compilation support (quite complicated) and distros like Alpine
> or just something not using x86 (how many piwheels.org-like should
> emerge for each non-x86 platform?). For example, I would like to
> seamlessly install numpy, pandas and scikit onto ppc machine running
> Gentoo musl and not waste 1 hour for compilation, or "just" use them
> in x86 standard alpine-based docker image (basically what [3] is all
> about).
>
> Long story short, current wheel filename format:
>
> {distribution}-{version}(-{build tag})?-{python tag}-{abi
> tag}-{platform tag}.whl.
>
> Doesn't not properly express package expectation. Let's take a look at
> pandas wheels ([4]):
>
> pandas-0.24.1-cp36-cp36m-manylinux1_x86_64.whl
> pandas-0.24.1-cp36-cp36m-win_amd64.whl
> pandas-0.24.1-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
>
> I see issues with each of them:
> 1. First one won't work on Alpine or any musl-based distro;
> 2. Second – how amd64 is different from x86_64?
> 3. Third's platform tag is just a nightmare.
>
> More of that, if you open the last one and inspect one of the
> libraries, you'll find that:
> $ file _libs/algos.cpython-36m-darwin.so
> _libs/algos.cpython-36m-darwin.so: Mach-O universal binary with 2
> architectures: [i386:Mach-O bundle i386] [x86_64]
> _libs/algos.cpython-36m-darwin.so (for architecture i386): Mach-O bundle i386
> _libs/algos.cpython-36m-darwin.so (for architecture x86_64): Mach-O
> 64-bit bundle x86_64
>
> It's universal library! So not x86_64 only, as mentioned in the quite
> long macosx_10_various platform tag.
>
> TL;DR What my solution? To use something widely called "Target
> Triplet" [5], omitting usual "vendor" field, so
> {platform tag} from PEP 435 will have the format of _[_]:
>
> pandas-0.24.1-cp36-cp36m-x86_64_linux_gnu.whl
> pandas-0.24.1-cp36-cp36m-x86_64_linux_musl.whl
> pandas-0.24.1-cp36-cp36m-x86_windows.whl
> pandas-0.24.1-cp36-cp36m-x86_64_windows_msvs2010.whl
> pandas-0.24.1-cp36-cp36m-x86_macosx_10_6.whl <-- won't be used for
> anything Mojave+, see [6]
> pandas-0.24.1-cp36-cp36m_aarch64_netbsd.whl
>
> Primary concerns here:
> - Arch and os are specified more consistently;
> - Environment is specified only when needed;
> - Lots of possible combinations of os and env are possible :)
>
> Since most runtimes are hardcoded during build time anyway and changed
> for each Python release, explicit versioning shouldn't be a problem.
>
> JavaScript and Rustlang [7] use similar naming scheme. Though I don't
> like both of them, at least portability of extensions looks less
> broken than of Python (I've worked on native Nodejs extension in the
> past).
>
>
> What do you think?
>
> Thanks,
> Alex
>
> [1] 
> https://mail.python.org/archives/list/[email protected]/thread/KCLRIN4PTUGZLLL7GOUM23S46ZZ2D4FU/
> [2] https://github.com/pypa/packaging-problems/issues/69
> [3] https://github.com/pypa/manylinux/issues/37
> [4] https://pypi.org/project/pandas/#files
> [5] https://wiki.osdev.org/Target_Triplet
> [6] https://support.apple.com/en-us/HT208436
> [7] https://doc.rust-lang.org/reference/conditional-compilation.html
-- 
https://mail.python.org/mailman/listinfo/python-list


(yet another) PEP idea to tackle binary wheels problem efficiently

2019-02-18 Thread Alexander Revin
Hi all,

I've been thoroughly reading various discussions, such as [1], [2] and
related ones regarding PEP 425, PEP 491 and PEP 513. I also happen to
use musl sometimes, so as discussed here [3] I thought it would be a
good idea to submit a new PEP regarding musl compatibility.

It's not a secret that everyday wheel usage on Linux is far from
perfect. Some packages are trying to compile when there's no compiler
on the system available, some rely on 3rd-party deps and explode when
they cannot find required headers installed and so on. Add to this
cross-compilation support (quite complicated) and distros like Alpine
or just something not using x86 (how many piwheels.org-like should
emerge for each non-x86 platform?). For example, I would like to
seamlessly install numpy, pandas and scikit onto ppc machine running
Gentoo musl and not waste 1 hour for compilation, or "just" use them
in x86 standard alpine-based docker image (basically what [3] is all
about).

Long story short, current wheel filename format:

{distribution}-{version}(-{build tag})?-{python tag}-{abi
tag}-{platform tag}.whl.

Doesn't not properly express package expectation. Let's take a look at
pandas wheels ([4]):

pandas-0.24.1-cp36-cp36m-manylinux1_x86_64.whl
pandas-0.24.1-cp36-cp36m-win_amd64.whl
pandas-0.24.1-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl

I see issues with each of them:
1. First one won't work on Alpine or any musl-based distro;
2. Second – how amd64 is different from x86_64?
3. Third's platform tag is just a nightmare.

More of that, if you open the last one and inspect one of the
libraries, you'll find that:
$ file _libs/algos.cpython-36m-darwin.so
_libs/algos.cpython-36m-darwin.so: Mach-O universal binary with 2
architectures: [i386:Mach-O bundle i386] [x86_64]
_libs/algos.cpython-36m-darwin.so (for architecture i386): Mach-O bundle i386
_libs/algos.cpython-36m-darwin.so (for architecture x86_64): Mach-O
64-bit bundle x86_64

It's universal library! So not x86_64 only, as mentioned in the quite
long macosx_10_various platform tag.

TL;DR What my solution? To use something widely called "Target
Triplet" [5], omitting usual "vendor" field, so
{platform tag} from PEP 435 will have the format of _[_]:

pandas-0.24.1-cp36-cp36m-x86_64_linux_gnu.whl
pandas-0.24.1-cp36-cp36m-x86_64_linux_musl.whl
pandas-0.24.1-cp36-cp36m-x86_windows.whl
pandas-0.24.1-cp36-cp36m-x86_64_windows_msvs2010.whl
pandas-0.24.1-cp36-cp36m-x86_macosx_10_6.whl <-- won't be used for
anything Mojave+, see [6]
pandas-0.24.1-cp36-cp36m_aarch64_netbsd.whl

Primary concerns here:
- Arch and os are specified more consistently;
- Environment is specified only when needed;
- Lots of possible combinations of os and env are possible :)

Since most runtimes are hardcoded during build time anyway and changed
for each Python release, explicit versioning shouldn't be a problem.

JavaScript and Rustlang [7] use similar naming scheme. Though I don't
like both of them, at least portability of extensions looks less
broken than of Python (I've worked on native Nodejs extension in the
past).


What do you think?

Thanks,
Alex

[1] 
https://mail.python.org/archives/list/[email protected]/thread/KCLRIN4PTUGZLLL7GOUM23S46ZZ2D4FU/
[2] https://github.com/pypa/packaging-problems/issues/69
[3] https://github.com/pypa/manylinux/issues/37
[4] https://pypi.org/project/pandas/#files
[5] https://wiki.osdev.org/Target_Triplet
[6] https://support.apple.com/en-us/HT208436
[7] https://doc.rust-lang.org/reference/conditional-compilation.html
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Trying to compile Python 3.5 on Linux Mint 19, getting compiler warnings and failing tests

2019-02-18 Thread Chris Angelico
On Tue, Feb 19, 2019 at 5:23 AM Marcin G  wrote:
>
> My boss wants my code to run on Python 3.5, so I thought I'd install 3.5 to 
> be able to ascertain this.
>
> But Linux Mint 19 ships with Python 3.6 and python.org only provides source 
> code for 3.5.6. So I 
> thought I'd try compiling 3.5.6 myself.
>

TBH it's highly unlikely that the difference between 3.5.x and 3.5.y
will be significant here. To test that your code will run on 3.5, you
can almost certainly just grab any 3.5.

> This produced compiler warnings about: comparison between signed and 
> unsigned, switches falling though, use of deprecated macros in glibc headers 
> and too big object sizes leading to overflows in memcpy. This worries me the 
> most, because it looks like undefined behavior to my untrained eye. I wonder 
> if my system is misconfigured? Or if the configure script picks wrong sizes 
> for some reason? Is there incompatibility between Python 3.5 and newer glibc 
> headers?
>

Unfortunately a LOT of large projects spew warnings. :( It would be
awesome if we could confidently expect that a correctly-configured
system would build any released Python without warnings, but we can't,
so I would just look for actual errors.

> In addition, make test shows up one failing test: test_ssl.
>

Hmm. From looking at your full log (THANK YOU for posting that, btw -
so many people don't), it looks like an issue with certificate
checking. Might be a bug in the test itself. Does the same thing
happen with a more recent Python build? It could be a weirdness with
specific versions of OpenSSL.

I don't think it's going to be a killer problem. It's a failure in a
narrow part of SSL handling, one that most code won't hit.

> All I want is to have an installation that is not broken. If the above 
> failures are false positives, I can gladly ignore them; however, since 
> (unsupressed) warnings and failing tests are usually a sign of serious 
> problems, I wonder what should I do get a functional installation?
>
> I do believe I should have all dependencies installed. First, I kept 
> installing libraries until `make` stopped showing me info about missing bits 
> for optional modules. Then, just to make sure, I did sudo apt-get build-dep 
> python3. Problem is still not solved, however.
>

TBH I wouldn't use that as a final step - I'd use it as the first
step. It's usually going to get all, or at least nearly all, the
libraries you need; way easier than manually grabbing libraries until
make stops complaining.

Summary: I'd say you do currently have a 3.5.6 build that's viable for
testing, but you could also have picked up any other 3.5.x that might
be available in packaged form, and it would also have been
test-worthy. The test failure might be something to dive into
separately, but I believe it's okay to ignore it here.

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


The NaNny State

2019-02-18 Thread Avi Gross
This is not a complaint about python.

 

It is about the recent discussion about the concept and word "nan" as used
in python and elsewhere. As noted, the correct spelling in python is all
lower case as in "nan" with a minor exception that creating a nan using
float(string) allows any combination of cases such as string="nAN".

 

I like to learn and contrast languages to try to make some sense of things
and see different ways to conceptualize things. As discussed, there are
subtle uses of concepts such as NOT A NUMBER versus NOT AVAILABLE that often
get conflated. In Python, the math and numpy modules also include a nan
constant as in math.nan.

 

What is bothersome is the ways other places in a language spell the same or
related concept leading to confusion. If you read a CSV file using the
pandas module with pandas.read_csv() it shows empty items as "NaN". The
programming language JAVA spells it the same way to mean the result of
dividing zero by zero as Not a Number. The programming language R uses NA
for Not Available and uses NaN for Not a Number but also has constants that
test more specifically such as NA_integer_ and NA_character_ and you have
test functions like is.na() and is.nan() but just to be confusing is.na()
also returns TRUE when looking at a NaN!

 

I am sure we can look at other languages and get even more confused!

 

Now I am not saying which implementation is in some ways better, just
admiring the diversity of ways of looking at things that seem to happen as
many languages develop. I see other anomalies such as languages that have a
concept of both a negative and positive zero or different infinity types for
float versus double. There are so many themes you can look at across
languages that indicate there is no one totally obvious way.

 

So when people wonder why python does things in a way they are not seeing as
right, they need to wonder if dropping some preconceptions may let them
learn what the language DOES and adjust rather than fight it. Don't let the
NaNny state dictate what must be.

 

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


Re: Scraping multiple web pages help

2019-02-18 Thread Sivan Grünberg
Hi there Drake,

 A quick google search revealed:
 - https://regulationsgov.github.io/developers/

 This seems particulriy useful:
 - https://regulationsgov.github.io/developers/console/

 And to fetch stuff from the API, there's Python requests that has a rather
wonderful doc:
 - http://docs.python-requests.org/en/master/

HTH,

-Sivan

On Mon, Feb 18, 2019 at 8:22 PM Drake Gossi  wrote:

> Hello everyone,
>
> For a research project, I need to scrape a lot of comments from
> regulations.gov
>
>
> https://www.regulations.gov/docketBrowser?rpp=25&so=DESC&sb=commentDueDate&po=0&dct=PS&D=ED-2018-OCR-0064
>
> But partly what's throwing me is the url addresses of the comments. They
> aren't consistent. I mean, there's some consistency insofar as the numbers
> that differentiate the pages all begin after that 0064 number in the url
> listed above. But the differnetiating numbers aren't even all the same
> amount of numbers. Some are 4 (say, 4019) whereas others are 5 (say,
> 50343). But I dont think they go over 5. So this is a problem. I dont know
> how to write the code to access the multiple pages.
>
> I should also mention I'm new to programing, so that's also a problem (if
> you cant already tell by the way I'm describing my problem).
>
>
> I should also mention that, I think, there's an API on regulations.gov,
> but
> I'm such a beginner that I dont evem really know where to find it, or even
> what to do with it once I do. That's how helpless am right now.
>
> Any help anyone could offer would be much appreciated.
>
> D
> --
> https://mail.python.org/mailman/listinfo/python-list
>


-- 
Sivan Greenberg
Co founder & CTO
Vitakka Consulting
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: What's the address for?

2019-02-18 Thread Avi Gross
Alister wrote about the meaning of the id number often displayed about a
python object:

> it is the internal id of the function - Not necessarily an address, that
is an implementation detail.

> it is not intended for use within a program & has (almost) no practical
use.

I hear that it is implementation dependent. But are there any requirements
on the implementation that allow it to have meaning? I mean is the ID
guaranteed to be unique and not reused within a session? If two things
concurrently show the same ID, are they the same in some way?

On the implementation I am using, the ID changes if I do this:

>>> a = 1
>>> id(a)
271178896
>>> a = 2
>>> id(a)
271178912
>>> a = 1
>>> id(a)
271178896

It looks like the ID of "a" can change depending on its contents. But when I
set it back to the first content, I get the same ID.

Again, on MY IMPLEMENTATION, I did an experiment to see if the constants 1
and 2 share that ID.

>>> id(1)
271178896
>>> id(2)
271178912

It seems they do. So I tried setting variable b several ways:

>>> b = 1
>>> id(b)
271178896
>>> b = a
>>> id(b), id(a)
(271178896, 271178896)
>>> a = 2
>>> (271178896, 271178896)
(271178896, 271178896)

So it does seem in this artificial case of looking at something easily
cached like an integer, that ID has these qualities.

I tried using complex and the results are a bit complex:

>>> import math
>>> a = complex("1+2j")
>>> a
(1+2j)
>>> id(a)
48066432
>>> id(complex("1+2j"))
55084360
>>> b = complex("1+2j")
>>> id(b)
55084360
>>> a = b
>>> id(a)
55084360
>>> a = complex("1+2j")
>>> id(a)
48066432
>>> c = complex(1,2)
>>> id(c)
55086880

We seem to go between two values although I am not sure why.

How about functions?

Even more confusing:

>>> def a(): pass

>>> def b(): pass

>>> id(a), id(b)
(13123280, 13201816)
>>> b=a
>>> id(a), id(b)
(13123280, 13123280)
>>> def a(): return True

>>> id(a), id(b)
(13201816, 13123280)

The above shows that making two independent (albeit otherwise minimally
identical) functions makes two different id and copying one to the other
makes them the same but then changing one gets back the same ID reused!

So, I would be hesitant about assigning much meaning to an ID. It might be
useful within an implementation when using a debugger but perhaps not much
more.

So I decided to do what maybe should be done first. Find some documentation!

If what I read is accurate, given the source, it sounds like for Cpython an
ID may be a memory address and the guarantee is that once an ID is assigned
to something it will not be reassigned to something else as long as the
object remains in effect. Well, I assume that means that anything else set
to be the same as the original as in "a = b" will share that ID. Once an
object is gone, the ID can be reused.

This may help understand some of the above results especially since memory
management may not rapidly get rid of something. I concur that there is
often not much point in using id() or even its cousin is.

-Original Message-
From: Python-list  On
Behalf Of Alister via Python-list
Sent: Monday, February 18, 2019 8:29 AM
To: [email protected]
Subject: Re: What's the address for?

On Mon, 18 Feb 2019 11:59:18 +, Stefan Ram wrote:

> When one prints a function, one might get something like:
> 
> 
> 
>   . The participants of my basic course asked me what the address is
>   for. I did not know.
> 
>   What's so important about the (presumed) address of a function that it
>   is shown on every stringification of each function?

it is the internal id of the function - Not necessarily an address, that is
an implementation detail.

it is not intended for use within a program & has (almost) no practical use.



-- 
Microsoft Zen - Become one with the blue screen. 

   -- From a Slashdot.org post
-- 
https://mail.python.org/mailman/listinfo/python-list

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


Re: What's the address for?

2019-02-18 Thread Chris Angelico
On Tue, Feb 19, 2019 at 7:04 AM Avi Gross  wrote:
>
> Alister wrote about the meaning of the id number often displayed about a
> python object:
>
> > it is the internal id of the function - Not necessarily an address, that
> is an implementation detail.
>
> > it is not intended for use within a program & has (almost) no practical
> use.
>
> I hear that it is implementation dependent. But are there any requirements
> on the implementation that allow it to have meaning? I mean is the ID
> guaranteed to be unique and not reused within a session? If two things
> concurrently show the same ID, are they the same in some way?

Have you considered reading the docs?

https://docs.python.org/3/library/functions.html#id

"""Return the “identity” of an object. This is an integer which is
guaranteed to be unique and constant for this object during its
lifetime. Two objects with non-overlapping lifetimes may have the same
id() value."""

I'm fairly sure that answers all your questions.

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


Re: What's the address for?

2019-02-18 Thread Chris Angelico
On Tue, Feb 19, 2019 at 7:04 AM Avi Gross  wrote:
> How about functions?
>
> Even more confusing:
>
> >>> def a(): pass
>
> >>> def b(): pass
>
> >>> id(a), id(b)
> (13123280, 13201816)
> >>> b=a
> >>> id(a), id(b)
> (13123280, 13123280)
> >>> def a(): return True
>
> >>> id(a), id(b)
> (13201816, 13123280)
>
> The above shows that making two independent (albeit otherwise minimally
> identical) functions makes two different id and copying one to the other
> makes them the same but then changing one gets back the same ID reused!

Actually, this part isn't explained by the id() docs. To understand
this, you need to go back to something even more basic: the meaning of
assignment. You did not copy one to the other. You simply changed name
bindings. Here. Read.

https://nedbatchelder.com/text/names1.html

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


RE: Trying to compile Python 3.5 on Linux Mint 19, getting compiler warnings and failing tests

2019-02-18 Thread Marcin G
Hmm. From looking at your full log (THANK YOU for posting that, btw -
so many people don't), it looks like an issue with certificate
checking. Might be a bug in the test itself. Does the same thing
happen with a more recent Python build? It could be a weirdness with
specific versions of OpenSSL.

Hmm, my Googling brought me this:

https://bugs.python.org/issue30714

Apparently, the test fails with newer versions of openssl and the test was 
fixed in 3.7, 3.6 and 2.7, but for some reason 3.5 was removed from the 
versions field of this bug report.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Trying to compile Python 3.5 on Linux Mint 19, getting compiler warnings and failing tests

2019-02-18 Thread Chris Angelico
On Tue, Feb 19, 2019 at 7:36 AM Marcin G  wrote:
>
> Hmm. From looking at your full log (THANK YOU for posting that, btw -
> so many people don't), it looks like an issue with certificate
> checking. Might be a bug in the test itself. Does the same thing
> happen with a more recent Python build? It could be a weirdness with
> specific versions of OpenSSL.
>
> Hmm, my Googling brought me this:
>
> https://bugs.python.org/issue30714
>
> Apparently, the test fails with newer versions of openssl and the test was 
> fixed in 3.7, 3.6 and 2.7, but for some reason 3.5 was removed from the 
> versions field of this bug report.
>

Good find! Yep, looks like it's just a test failure, so you can
proceed to use your built Python. Not sure why 3.5 was removed;
presumably the release manager (Larry Hastings, in this case) decided
against it, but I didn't see any explanation of why.

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


Re: Trying to compile Python 3.5 on Linux Mint 19, getting compiler warnings and failing tests

2019-02-18 Thread Grant Edwards
On 2019-02-18, Chris Angelico  wrote:

> Hmm. From looking at your full log (THANK YOU for posting that, btw -
> so many people don't), it looks like an issue with certificate
> checking. Might be a bug in the test itself. Does the same thing
> happen with a more recent Python build? It could be a weirdness with
> specific versions of OpenSSL.

If your app involves SSL and certificates, it's never going to work
right anyway.  Even if it does, nobody will ever use it correctly.
Even if they do, whoever created the certificates will have screwed
them up.  Even if they didn't, they'll forget to renew/replace them
before they expire.  Even if your app and certificates are OK, the app
on the other end of the network connection won't work right.

I'm only half joking...

-- 
Grant Edwards   grant.b.edwardsYow! They collapsed
  at   ... like nuns in the
  gmail.comstreet ... they had no
   teen appeal!

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


Re: Trying to compile Python 3.5 on Linux Mint 19, getting compiler warnings and failing tests

2019-02-18 Thread Chris Angelico
On Tue, Feb 19, 2019 at 7:55 AM Grant Edwards  wrote:
>
> On 2019-02-18, Chris Angelico  wrote:
>
> > Hmm. From looking at your full log (THANK YOU for posting that, btw -
> > so many people don't), it looks like an issue with certificate
> > checking. Might be a bug in the test itself. Does the same thing
> > happen with a more recent Python build? It could be a weirdness with
> > specific versions of OpenSSL.
>
> If your app involves SSL and certificates, it's never going to work
> right anyway.  Even if it does, nobody will ever use it correctly.
> Even if they do, whoever created the certificates will have screwed
> them up.  Even if they didn't, they'll forget to renew/replace them
> before they expire.  Even if your app and certificates are OK, the app
> on the other end of the network connection won't work right.
>
> I'm only half joking...
>

No, I think you've accurately described internet security. With one omission:

Nobody knows that it isn't working correctly.

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


Re: New rules for scope in a function?

2019-02-18 Thread Ben Bacarisse
"Steve"  writes:

> OK, I wrote:
>
> x = "A"
> print("x = " + x)
>
> def f(y):
> print("x= " + x + "  y= "+ y)
> 
> f(x)
>
> and it worked, inspite of what I was seeing in my own program.  
> How quick I am to blame Python. (:
> When I isolate my function that stumped me, I will post it.

This small variation might point the way.  If you can explain it, you'll
be most of the way there.

x = "A"
print("x = " + x)

def f(y):
x = "B"
print("In f, x = " + x + "  y = "+ y)

f(x)
print("x = " + x)



The material I cut did include the explanation so go back and read the
message you replied to here if you don't follow.

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


Re: The NaNny State

2019-02-18 Thread Ben Finney
"Avi Gross"  writes:

> It is about the recent discussion about the concept and word "nan" as used
> in python and elsewhere. As noted, the correct spelling in python is all
> lower case as in "nan" with a minor exception that creating a nan using
> float(string) allows any combination of cases such as string="nAN".

Who says that the “correct spelling in python is all lower case "nan"”?

The text representation of a Python ‘float’ NaN object is 'nan'. That is
what the object emits as its text representation; it is not the same
thing as "the correct spelling".

As you note, the ‘float’ type accepts several spellings as input to
create a NaN object, all of them correct spelling.

Similarly, I can spell the number one thousand ‘1000.0’, ‘1.0e+3’
‘1.000e+3’, ‘1000.0’, and so on. Those are all correct (and, as it
happens, they all result in equal ‘float’ values).

The resulting object will, when I interrogate it, represent itself *by
default* as ‘1000.0’; Python is not showing *the* correct spelling, just
one possible correct spelling.

-- 
 \ “I wrote a song, but I can't read music so I don't know what it |
  `\is. Every once in a while I'll be listening to the radio and I |
_o__)say, ‘I think I might have written that.’” —Steven Wright |
Ben Finney

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


RE: The NaNny State

2019-02-18 Thread Avi Gross
[DISCLAIMER: I can read documentation and have. The following is more of a demo 
showing step by step what I find experimentally along with some discussion.]

Ben asked:

> Who says that the “correct spelling in python is all lower case "nan"”?

Fair enough. Except for reserved words in the language, all we have is hints of 
what the designers used. The reality is that whoever codes the __str__ and/or 
__repr__ chose lower case and so did the persons who made math.nan and 
numpy.nan and obviously we can over-ride these decisions in our own derived 
customized classes.

>>> import math, numpy
>>> nantucket, nanometer, nanoseconds = float("NAN"), math.nan, 
numpy.nan
>>> nantucket, nanometer, nanoseconds
(nan, nan, nan)
>>> [ spelled.__str__() for spelled in [nantucket, nanometer, 
nanoseconds]]
['nan', 'nan', 'nan']
>>> [ spelled.__repr__() for spelled in [nantucket, nanometer, 
nanoseconds]]
['nan', 'nan', 'nan']

I have a hard time in thinking of anywhere else you normally would type "nan" 
or a variant in native python other than the float example and a similar one 
such as complex("NAN", 5).

>>> math.isnan(nanometer)
True
>>> numpy.isnan(nanoseconds)
True

So I decided to look and see what some python extensions (modules) that I am 
aware of choose to display. I assume many of them rely on the str/repr of the 
underlying "float" and I see numpy does:

>>> nannite = numpy.array([1, float("NAN"), 2, math.nan, 3, numpy.nan])
>>> nannite
array([ 1., nan,  2., nan,  3., nan])

I mentioned earlier that the pandas module has an exception, of sorts. 

>>> import pandas

>>> nanism = pandas.DataFrame( {'FORWARD': nannite, 'BACKWARD': 
nannite[::-1]})
   
>>> nanism 
   FORWARD  BACKWARD
0  1.0   NaN
1  NaN   3.0
2  2.0   NaN
3  NaN   2.0
4  3.0   NaN
5  NaN   1.0

So, as I said, at least one extension chose differently and uses NaN.

BUT if I explicitly request the one item on the second row and first column it 
says 'nan' as it is no longer being handled by the same decision:

>>> nanism.at[1,'FORWARD']
nan

I have no doubt that if you search all over the place, you will find additional 
spellings say in a machine the sklearn module which is probably using pandas 
below it.

And, yes, I tried many other things I will not trouble you with. I repeat. I 
concede there is not necessarily any enforced spelling for 'nan' in the 
language. 

So, anyone want to decide how to spell inf properly?
>>> nanism.at[0,'FORWARD'] = math.inf
>>> nanism.at[1,'BACKWARD'] = float("-InF")
>>> nanism
 
FORWARD  BACKWARD
0   inf   NaN
1   NaN  -inf
2  2.00   NaN
3   NaN  2.00
4  3.00   NaN
5   NaN  1.00

I think it is time for me stop talking about what is not. 😉

-Original Message-
From: Python-list  On 
Behalf Of Ben Finney
Sent: Monday, February 18, 2019 5:08 PM
To: [email protected]
Subject: Re: The NaNny State

"Avi Gross"  writes:

> It is about the recent discussion about the concept and word "nan" as 
> used in python and elsewhere. As noted, the correct spelling in python 
> is all lower case as in "nan" with a minor exception that creating a 
> nan using
> float(string) allows any combination of cases such as string="nAN".

Who says that the “correct spelling in python is all lower case "nan"”?

The text representation of a Python ‘float’ NaN object is 'nan'. That is what 
the object emits as its text representation; it is not the same thing as "the 
correct spelling".

As you note, the ‘float’ type accepts several spellings as input to create a 
NaN object, all of them correct spelling.

Similarly, I can spell the number one thousand ‘1000.0’, ‘1.0e+3’
‘1.000e+3’, ‘1000.0’, and so on. Those are all correct (and, as it happens, 
they all result in equal ‘float’ values).

The resulting object will, when I interrogate it, represent itself *by
default* as ‘1000.0’; Python is not showing *the* correct spelling, just one 
possible correct spelling.

-- 
 \ “I wrote a song, but I can't read music so I don't know what it |
  `\is. Every once in a while I'll be listening to the radio and I |
_o__)say, ‘I think I might have written that.’” —Steven Wright |
Ben Finney

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

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


WebScrapping

2019-02-18 Thread Adrian Ordona
Hi,

I’m learning how to code and interested in web scrapping to gather data.
I’m running on Mac OS X 10.9.5 and python 3.7 terminal.
I’m trying to capture the name of the brand and price but i keep getting an 
error (see below).
Traceback (most recent call last):
  File "", line 1, in 
  File "/anaconda3/lib/python3.7/site-packages/bs4/element.py", line 1884, in 
__getattr__
"ResultSet object has no attribute '%s'. You're probably treating a list of 
items like a single item. Did you call find_all() when you meant to call 
find()?" % key
AttributeError: ResultSet object has no attribute 'find'. You're probably 
treating a list of items like a single item. Did you call find_all() when you 
meant to call find()?


Here’s what i got and thanks for the help

import bs4
from urllib.request import urlopen as uReq
from bs4 import BeautifulSoup as soup

my_url = 
'https://www.newegg.com/Desktop-Graphics-Cards/SubCategory/ID-48?Tid=7709'

uClient = uReq(my_url)
page_html = uClient.read()
uClient.close()
page_soup = soup(page_html, "html.parser")
records = []

containers = page_soup.findAll("div",{"class":"item-container"})

for container in containers:
brand = container.find('div', attrs={'class':'item-branding'})
price = container.find('div', attrs={'class':'item-action'})
records.append((brand, price))

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


Re: What's the address for?

2019-02-18 Thread Ben Finney
"Avi Gross"  writes:

> I hear that [the ‘id(foo)’ return value] is implementation dependent.
> But are there any requirements on the implementation that allow it to
> have meaning?

The requirements are that `id(foo)` should satisfy the documented API
for that function https://docs.python.org/3/library/functions.html#id>:

 Return the “identity” of an object. This is an integer which is
 guaranteed to be unique and constant for this object during its
 lifetime. Two objects with non-overlapping lifetimes may have the
 same `id()` value.

> I mean is the ID guaranteed to be unique and not reused within a
> session?

No. The identity of an object is guaranteed to be unique only during the
lifetime of that object. This implies that *outside* the lifetime of
that object (before it exists; after it is destroyed) the same value
is allowed to be the identity of some other object.

> If two things concurrently show the same ID, are they the same in some
> way?

Yes, querying the identity of two references concurrently will return
the same identity value only if those two references refer to the same
object.

That is the essential meaning of an object identity: you can compare it
with some other identity value and see whether that came from the same
object.

Other than object identity, there is pretty much no guarantee (and hence
almost no purpose for the value you get from ‘id(foo)’). That is useful
enough, of course.

> On the implementation I am using, the ID changes if I do this:

You are creating new objects and binding the name ‘a’ to different
objects in succession. Those different objects will each have different
identities.

> It looks like the ID of "a" can change depending on its contents.

That's because a name is not a container, it is a reference. Names don't
know *anything* about the object; they have no type, no identity,
nothing except the ability to refer to some object at a particular point
in time.

> So I decided to do what maybe should be done first. Find some
> documentation!

Yes (especially the documentation of the function you're using, ‘id’).

Also helpful: Learn the actual behaviour of references in Python. They
do not behave like “variables” in some other languages (I avoid talking
about Python “variables” at all, for this reason). References are not
containers, and thinking of them that way will frequently lead you to
the wrong conclusion.

https://nedbatchelder.com/text/names1.html>

-- 
 \   “Theology is the effort to explain the unknowable in terms of |
  `\ the not worth knowing.” —Henry L. Mencken |
_o__)  |
Ben Finney

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


Multiprocessing performance question

2019-02-18 Thread Israel Brewster
I have the following code running in python 3.7:

def create_box(x_y):
return geometry.box(x_y[0] - 1, x_y[1],  x_y[0], x_y[1] - 1)

x_range = range(1, 1001)
y_range = range(1, 801)
x_y_range = list(itertools.product(x_range, y_range))

grid = list(map(create_box, x_y_range))

Which creates and populates an 800x1000 “grid” (represented as a flat list at 
this point) of “boxes”, where a box is a shapely.geometry.box(). This takes 
about 10 seconds to run.

Looking at this, I am thinking it would lend itself well to parallelization. 
Since the box at each “coordinate" is independent of all others, it seems I 
should be able to simply split the list up into chunks and process each chunk 
in parallel on a separate core. To that end, I created a multiprocessing pool:

pool = multiprocessing.Pool()

And then called pool.map() rather than just “map”. Somewhat to my surprise, the 
execution time was virtually identical. Given the simplicity of my code, and 
the presumable ease with which it should be able to be parallelized, what could 
explain why the performance did not improve at all when moving from the 
single-process map() to the multiprocess map()?

I am aware that in python3, the map function doesn’t actually produce a result 
until needed, but that’s why I wrapped everything in calls to list(), at least 
for testing.

---
Israel Brewster
Software Engineer
Alaska Volcano Observatory 
Geophysical Institute - UAF 
2156 Koyukuk Drive 
Fairbanks AK 99775-7320
Work: 907-474-5172
cell:  907-328-9145

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


Re: Multiprocessing performance question

2019-02-18 Thread Ben Finney
I don't have anything to add regarding your experiments with
multiprocessing, but:

Israel Brewster  writes:

> Which creates and populates an 800x1000 “grid” (represented as a flat
> list at this point) of “boxes”, where a box is a
> shapely.geometry.box(). This takes about 10 seconds to run.

This seems like the kind of task NumPy http://www.numpy.org/> is
designed to address: Generating and manipulating large-to-huge arrays of
numbers, especially numbers that are representable directly in the
machine's basic number types (such as moderate-scale integers).

Have you tried using that library and timing the result?

-- 
 \ “You don't need a book of any description to help you have some |
  `\kind of moral awareness.” —Dr. Francesca Stavrakoloulou, bible |
_o__)  scholar, 2011-05-08 |
Ben Finney

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


Re: Multiprocessing performance question

2019-02-18 Thread Israel Brewster


> On Feb 18, 2019, at 6:37 PM, Ben Finney  wrote:
> 
> I don't have anything to add regarding your experiments with
> multiprocessing, but:
> 
> Israel Brewster  writes:
> 
>> Which creates and populates an 800x1000 “grid” (represented as a flat
>> list at this point) of “boxes”, where a box is a
>> shapely.geometry.box(). This takes about 10 seconds to run.
> 
> This seems like the kind of task NumPy http://www.numpy.org/> is
> designed to address: Generating and manipulating large-to-huge arrays of
> numbers, especially numbers that are representable directly in the
> machine's basic number types (such as moderate-scale integers).
> 
> Have you tried using that library and timing the result?

Sort of. I am using that library, and in fact once I get the result I am 
converting it to a NumPy array for further use/processing, however I am still a 
NumPy newbie and have not been able to find a function that generates a numpy 
array from a function. There is the numpy.fromfunction() command, of course, 
but “…the function is called with … each parameter representing the coordinates 
of the array varying along a specific axis…”, which basically means (if my 
understanding/inital testing is correct) that my function would need to work 
with *arrays* of x,y coordinates. But the geometry.box() function needs 
individual x,y coordinates, not arrays, so I’d have to loop through the arrays 
and append to a new one or something to produce the output that numpy needs, 
which puts me back pretty much to the same code I already have.

There may be a way to make it work, but so far I haven’t been able to figure it 
out any better than the code I’ve got followed by converting to a numpy array. 
You do bring up a good point though: there is quite possibly a better way to do 
this, and knowing that would be just as good as knowing why multiprocessing 
doesn’t improve performance. Thanks!
---
Israel Brewster
Software Engineer
Alaska Volcano Observatory 
Geophysical Institute - UAF 
2156 Koyukuk Drive 
Fairbanks AK 99775-7320
Work: 907-474-5172
cell:  907-328-9145

> 
> -- 
> \ “You don't need a book of any description to help you have some |
>  `\kind of moral awareness.” —Dr. Francesca Stavrakoloulou, bible |
> _o__)  scholar, 2011-05-08 |
> Ben Finney
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

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


Re: Trying to compile Python 3.5 on Linux Mint 19, getting compiler warnings and failing tests

2019-02-18 Thread Terry Reedy

On 2/18/2019 3:35 PM, Marcin G wrote:

Hmm. From looking at your full log (THANK YOU for posting that, btw -
so many people don't), it looks like an issue with certificate
checking. Might be a bug in the test itself. Does the same thing
happen with a more recent Python build? It could be a weirdness with
specific versions of OpenSSL.

Hmm, my Googling brought me this:

https://bugs.python.org/issue30714

Apparently, the test fails with newer versions of openssl and the test was 
fixed in 3.7, 3.6 and 2.7, but for some reason 3.5 was removed from the 
versions field of this bug report.


At the time of the fix, 3.5 had moved to security-fix only status.  That 
is now the status of 3.6.


--
Terry Jan Reedy

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


trying to begin a code for web scraping

2019-02-18 Thread Drake Gossi
Hi everyone,

I'm trying to write code to scrape this website
 (
regulations.gov) of its comments, but I'm having trouble figuring out what
to link onto in the inspect page (like when I right click on inspect with
the mouse).

Although I need to write code to scrape all 11,000ish of the comments
related to this event (by putting a code in a loop?), I'm still at the
stage of looking at individual comments. So, for example, with this comment
, I know
enough to right click on inspect and to look at the xml? (This is how much
of a beginner I am--what am I looking at when I right click inspect?) Then,
I control F to find where the comment is in the code. For that comment, the
word I used control F on was "troubling." So, I found the comment buried in
the xml

But my issue is this. I don't know what to link onto to scrape the comment
(and I assume that this same sequence of letters would apply to scraping
all of the comments in general). I assume what I grab is GIY1LSJISD. I'm
watching this video, and the person is linking onto "tr" and "td," but mine
is not that easy. In other words, what is the most essential language (bit
of xml? code), the copying of which would allow me to extract not only this
comment, but all of the comments, were I to put this bit of language(/xml?)
my code? ... ... soup.findALL ('?')

In sum, what I need to know is, how do I tell my Python code to ignore all
of the surrounding code and go straight in and grab the comment. Of course,
I need to grab other things too like the name, category, date, and so on,
but I haven't gotten that far yet. Right now, I'm just trying to figure out
what I need to insert into my code so that I can get the comment.

Help! I'm trying to learn code on the fly. I'm an experienced researcher
but am new to coding. Any help you could give me would be tremendously
awesome.

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


Re: What's the address for?

2019-02-18 Thread Gregory Ewing

Stefan Ram wrote:

  What's so important about the (presumed) address of a
  function that it is shown on every stringification of
  each function?


Its value isn't important at all. It's just a way of
distinguishing different objects in debugging output.

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


ajax with pyside webview

2019-02-18 Thread Abdur-Rahmaan Janhangeer
greetings, i'm using pyside webview to view a localhost app, all works
fine, just  ajax via jquery does not work. other requests work fine.

ajax works fine in web browser though.

any ideas?

Abdur-Rahmaan Janhangeer
http://www.pythonmembers.club | https://github.com/Abdur-rahmaanJ
Mauritius
-- 
https://mail.python.org/mailman/listinfo/python-list