Re: Use of a variable in parent loop

2020-09-28 Thread Christian Gollwitzer

Am 28.09.20 um 07:38 schrieb Stephane Tougard:

On 2020-09-28, MRAB  wrote:

It's used where the language requires a statement.

In, say, C, you would use empty braces:

  while (process_next_item()) {
  /* Do nothing. */
  }


If I want to express nothing in C, I put nothing and it works fine.

#include 

int main(int argc, char * argv[])
{
   if(1 == 1)
 ;


No. You put ";", that's not nothing.

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


Re: Use of a variable in parent loop

2020-09-28 Thread Manfred Lotz
On Mon, 28 Sep 2020 13:39:08 +0800
Stephane Tougard  wrote:

> On 2020-09-28, Manfred Lotz  wrote:
> > On Mon, 28 Sep 2020 05:20:20 +0800
> > Stephane Tougard  wrote:
> >  
> >> On 2020-09-27, Manfred Lotz  wrote:  
> >> > -
> >> > http://localhost:2015/tutorial/controlflow.html#pass-statements
> >> >   
> >> ...  
> >> > (In comparison to guys like ChrisA and StefanR and others here I
> >> > am also a Python beginner)
> >> 
> >> To give me a pointer on your localhost, I could guess.  
> >
> > Don't understand this sentence.  
> 
> The URL you gave is pointing to your localhost, your own computer if
> you prefer.

It is amazing that I just didn't see it. I am a bad at spotting things.
Sigh.

Anyway:
https://docs.python.org/3/tutorial/controlflow.html#pass-statements


-- 
Manfred

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


Re: Use of a variable in parent loop

2020-09-28 Thread Stephane Tougard via Python-list
On 2020-09-27, Manfred Lotz  wrote:
> - http://localhost:2015/tutorial/controlflow.html#pass-statements
...
> (In comparison to guys like ChrisA and StefanR and others here I am also
> a Python beginner)

To give me a pointer on your localhost, I could guess.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Use of a variable in parent loop

2020-09-28 Thread Stephane Tougard via Python-list
On 2020-09-27, Grant Edwards  wrote:
> Maybe you need to choose different editors and tools.

In my world, humans don't adapt to tools but human adapt tools to their
needs.

> A guy I worked for many years ago used to write BASIC programs in C by
> using a bizarre set of pre-processor macros.  While it provided his
> employees with plenty of amusement, he could never get the programs to
> work right...

It's normal, he was an ass. When I manage a team, I don't enforce tools
or language, I ask them to work the best way they can to get the things
done. If they want to write C in Perl (as I often do), I'm happy. If
they prefer Ruby (that I never learnt), or Lisp ... as long as it works
and they are able to maintain it, I'm happy as well.

Nothing is more enjoyable than a platform running a variety of languages
and technologies, working all together.

And FYI, I've done this way since 25 years and I count a few good
success in my career. Practically, my way of doing things works is at least
as well as any.

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


Re: Use of a variable in parent loop

2020-09-28 Thread Stephane Tougard via Python-list
On 2020-09-27, MRAB  wrote:
>> If a extremist Pythonist takes over my code some day, he'll have to
>> search and delete hundreds of useless pass. I laugh already thinking
>> about it.
> He could write some code to do it.

I would do it in Perl, LOL.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Use of a variable in parent loop

2020-09-28 Thread Stephane Tougard via Python-list
On 2020-09-27, Joe Pfeiffer  wrote:
> and so forth.  What I discovered in fairly short order was that it made
> it easier for me to read my own code, but did absolutely nothing for
> either me reading other people's code, nor for them reading mine.  I
> eventually concluded my best move was to just suck it up and learn to
> program in the language as intended.

Not that I disagree, but coming from twenty years of Perl, it means
where nobody really understands the code of anybody else, that never has
really been a concern to me.

However, I discovered that Emacs interprets as well an empty line or a
comment as a breaking point of a block, it's not as good as the use of
pass because I still have to indent up manually, but at least the
indent-region does not break it.

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


Re: check dependencies of a pypi package

2020-09-28 Thread Arjun_tech
just go to command prompt and type pip install pandas. it will install the
latest version with all the dependencies.

On Sun, 27 Sep 2020 at 09:30, kamaraju kusumanchi <
raju.mailingli...@gmail.com> wrote:

> How can I check the dependencies of a pypi package without installing it?
>
> For example, looking at the pandas 1.1.2 package in
> https://pypi.org/project/pandas/1.1.2/, is there a way to determine
> the numpy version it depends upon without installing the package?
>
> thanks
> raju
> --
> Kamaraju S Kusumanchi | http://raju.shoutwiki.com/wiki/Blog
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Use of a variable in parent loop

2020-09-28 Thread Grant Edwards
On 2020-09-27, Terry Reedy  wrote:
> On 9/26/2020 3:36 PM, Stephane Tougard via Python-list wrote:
>> On 2020-09-26, Terry Reedy  wrote:
>>> Noise.  Only 'pass' when there is no other code.
>> 
>> Why ?
>> 
>> I use pass and continue each time to break a if or a for because emacs
>> understands it and do not break the indentation.

Huh?  What is emacs doing to "break the indentation"?

>> Is there any other instruction to end a if than pass and ensure Emacs
>> does not break the indentation during a copy paste or an indent-region ?
>
> Emacs should come with python.el or python-mode.el defining a 
> python-mode.  Are you using it?  I presume it understands python block 
> structure without extra passes.

It works for me.

> emacs with python-mode has been and likely still is used by some 
> experienced python programmers.

I've been usnig emacs in python-mode for almost 20 years.  I've never
had any problems with.

--
Grant

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


Re: Use of a variable in parent loop

2020-09-28 Thread Grant Edwards
On 2020-09-27, Stephane Tougard via Python-list  wrote:

> However, I discovered that Emacs interprets as well an empty line or a
> comment as a breaking point of a block, it's not as good as the use of
> pass because I still have to indent up manually, but at least the
> indent-region does not break it.

I don't understand what you expect emacs 'indent-region' to do.

With token-delimited languages, it will re-do the indentation of a
block with respect to the first selected line.  That's possible
because for C et al. indentation can be deduced from keywords and
block delimiters.

That's simply not possible with Python because indentation _is_ the
delimiters.  Expecting Python to know how your code is supposed to be
indented would be like entering a block of C code with no curly braces
and then expecting emacs to know where to insert them so that the code
does what you want.

You can increase/decrease indentation by selecting a block and hitting
C-c < or C-c >.

--
Grant



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


Re: Can't install Python

2020-09-28 Thread Eryk Sun
On 9/28/20, Dennis Lee Bieber  wrote:
>
>   Python is not a GUI. You do not "click on the phyton.exe file" (sic).
> You open a command shell and, in a proper install which sets up the PATH
> environment variable, enter "python" as the command to execute.

You can run python.exe directly from Explorer -- typically from the
start menu or the Win+R run dialog. The only issue is that by default
the console that python.exe creates will close when the Python shell
exits. If you need to keep the console output around, you can simply
spawn a system shell before exiting, e.g.

>>> subprocess.Popen('pwsh'); exit()
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: pip update fails

2020-09-28 Thread Eryk Sun
On 9/28/20, Dennis Lee Bieber  wrote:
> On Sun, 27 Sep 2020 05:33:14 +0300, "Hylton" 
> declaimed the following:
>
>> "C:\Users\user\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\
>> distlib\scripts.py", line 386, in _get_launcher
>
>   That path seems to imply that you have a Python installed for single
> user...

No, it implies that the pip package was installed for just the current
user via, for example, `py -m ensurepip --user`. Per-user package
installs in 3.8 go in "%APPDATA%\Python\Python38\site-packages"
(roaming appdata). For a per-user installation of Python 3.8, pip
would be installed in
"%LOCALAPPDATA%\Programs\Python\Python38\site-packages" (local appdata
programs).
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Use of a variable in parent loop

2020-09-28 Thread Python
On Sun, Sep 27, 2020 at 03:18:44PM +0800, Stephane Tougard via Python-list 
wrote:
> On 2020-09-27, 2qdxy4rzwzuui...@potatochowder.com 
> <2qdxy4rzwzuui...@potatochowder.com> wrote:
> > As ChrisA noted, Python almost always Just Works without declarations.
> > If you find yourself with a lot of global and/or nonlocal statements,
> > perhaps you're [still] thinking in another language.
> 
> 
> I don't really agree with that, trying to use an undeclared
> object/variable/whatever :
> 
> Python 3.7.7 (default, Aug 22 2020, 17:07:43) 
> [GCC 7.4.0] on netbsd9
> Type "help", "copyright", "credits" or "license" for more information.
> >>> print(name)
> Traceback (most recent call last):
>   File "", line 1, in 
>   NameError: name 'name' is not defined
>   >>> 
> 
> You can say it's not the "declaration" the issue, it's the "definition",
> that's just a matter of vocabulary and it does not answer the question.

No it's not... those two words mean different things, and the
difference actually matters.  If you use strict in perl you need BOTH
(at least, if you want your variable to actually have a value):

  my $foo;
  $foo = 1;

The declaration and definition serve different purposes.  You can
combine them into one statement for syntactic convenience, much as you
can in C/C++, but nevertheless both functions still exist and are
explicitly expressed.

In Python, you almost always only need the definition.

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


Re: Use of a variable in parent loop

2020-09-28 Thread 황병희
Stephane Tougard  writes:

> ...
> It's normal, he was an ass. When I manage a team, I don't enforce tools
> or language, I ask them to work the best way they can to get the things
> done. If they want to write C in Perl (as I often do), I'm happy. If
> they prefer Ruby (that I never learnt), or Lisp ... as long as it works
> and they are able to maintain it, I'm happy as well.
>
> Nothing is more enjoyable than a platform running a variety of languages
> and technologies, working all together.
>
> And FYI, I've done this way since 25 years and I count a few good
> success in my career. Practically, my way of doing things works is at least
> as well as any.

Maybe you seems like lisp or emacs lisp just i think, not serious...

Sincerely, Byung-Hee from South Korea

-- 
^고맙습니다 _白衣從軍_ 감사합니다_^))//
-- 
https://mail.python.org/mailman/listinfo/python-list