Re: error in os.chdir

2018-07-01 Thread Steven D'Aprano
On Sun, 01 Jul 2018 03:18:23 +, eryk sun wrote: > On Sun, Jul 1, 2018 at 1:44 AM, Steven D'Aprano > wrote: >> On Sat, 30 Jun 2018 23:36:40 +, eryk sun wrote: >> >>> Only use forward slashes for legacy DOS paths passed to Windows API >>> functions. Do not use forward slashes for paths in c

File names with slashes [was Re: error in os.chdir]

2018-07-01 Thread Steven D'Aprano
On Sun, 01 Jul 2018 03:18:23 +, eryk sun wrote: > Bear in mind that forward slash is just a name character in NT. So, using Python, how could you open, write to, and then read from, a file with a slash in its name? Say, something like: spam/eggs in your home directory. (Is that still

Re: EXTERNAL: OSError: [Errno 48] Address already in use

2018-07-01 Thread Peter J. Holzer
On 2018-07-01 01:52:12 +, Steven D'Aprano wrote: > On Sat, 30 Jun 2018 23:49:41 +0200, Peter J. Holzer wrote: > > The old adage that "security is binary" is utter balderdash. > > I think that "old adage" is one of those ones that only people denying it > actually use. > > I've never seen any

Re: error in os.chdir

2018-07-01 Thread Peter J. Holzer
On 2018-07-01 08:50:22 +, Steven D'Aprano wrote: > On Sun, 01 Jul 2018 03:18:23 +, eryk sun wrote: > > On Sun, Jul 1, 2018 at 1:44 AM, Steven D'Aprano > > wrote: > >> I guess that if the user is using a path beginning with \\?\ they may > >> or may not need to use backslashes, but I have n

EuroPython 2018: Inviting European Python Conference Organizers

2018-07-01 Thread M.-A. Lemburg
The EuroPython Society (EPS), who is organizing the EuroPython conference, last year extended it’s mission to also provide help for the Python community in Europe in general. As part of this, we would like to get to know, and help create closer ties between organizers of other European Python even

EuroPython 2018: Community Discounts

2018-07-01 Thread M.-A. Lemburg
The EuroPython Society (EPS) extended its mission last year to not only run the EuroPython conference, but also provide help for the Python community in Europe in general. Let’s all meet at EuroPython In addition to the Python Organizers Lunch (see previous post), whi

logging module

2018-07-01 Thread Sharan Basappa
Folks, I am trying to use logging module and somehow I cannot make it work. A simple code that I am trying is below. The commented code line 5,6 are other options I have tried but don't work #importing module import logging #Create and configure logger #logging.basicConfig(filename="D:/Projec

Re: Assignments to ps1

2018-07-01 Thread Gregory Ewing
Stefan Ram wrote: from sys import ps1 ps1 = 'alpha' >>> import sys >>> sys.ps1 = "alpha" alpha -- Greg -- https://mail.python.org/mailman/listinfo/python-list

File names with slashes [was Re: error in os.chdir]

2018-07-01 Thread Mikhail V
[Steven D'Aprano] > (The same applies to Unix/Linux systems too, of course.) But while you're > using Python to manipulate files, you should use Python rules, and that > is "always use forward slashes". > > Is that reasonable? > > Under what circumstances would a user calling open(pathname) in Pyt

Re: error in os.chdir

2018-07-01 Thread eryk sun
On Sun, Jul 1, 2018 at 8:50 AM, Steven D'Aprano wrote: > On Sun, 01 Jul 2018 03:18:23 +, eryk sun wrote: > >> The Windows API handles this, but not for a path that begins with \\?\. > > But what about the *Python* API? The Python open() function, and all the > high-level os.* and os.path.* fun

Re: File names with slashes [was Re: error in os.chdir]

2018-07-01 Thread Richard Damon
On 7/1/18 6:49 AM, Mikhail V wrote: > [Steven D'Aprano] > >> (The same applies to Unix/Linux systems too, of course.) But while you're >> using Python to manipulate files, you should use Python rules, and that >> is "always use forward slashes". >> >> Is that reasonable? >> >> Under what circumstan

Re: File names with slashes [was Re: error in os.chdir]

2018-07-01 Thread Abdur-Rahmaan Janhangeer
one common scenario is C:\Users\ where \U is taken as a unicode litteral Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ > > > -- https://mail.python.org/mailman/listinfo/python-list

Re: File names with slashes [was Re: error in os.chdir]

2018-07-01 Thread eryk sun
On Sun, Jul 1, 2018 at 8:51 AM, Steven D'Aprano wrote: > On Sun, 01 Jul 2018 03:18:23 +, eryk sun wrote: > >> Bear in mind that forward slash is just a name character in NT. > > So, using Python, how could you open, write to, and then read from, a > file with a slash in its name? Say, somethi

Re: File names with slashes [was Re: error in os.chdir]

2018-07-01 Thread eryk sun
On Sun, Jul 1, 2018 at 4:00 PM, Abdur-Rahmaan Janhangeer wrote: > one common scenario is > > C:\Users\ > > where \U is taken as a unicode litteral This one is especially annoying in Python 2, since it makes raw unicode strings useless for common path literals. For example: >>> ur'C:\User

PEP 526 - var annotations and the spirit of python

2018-07-01 Thread Abdur-Rahmaan Janhangeer
was viewing pep526, so, finally, python cannot do without hinting the type as other languages? will python finally move to int x = 3 where int is a pre annotation? i am not arguing it's usefulness but rather, does it fit with python? Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ --

Re: PEP 526 - var annotations and the spirit of python

2018-07-01 Thread MRAB
On 2018-07-01 18:06, Abdur-Rahmaan Janhangeer wrote: was viewing pep526, so, finally, python cannot do without hinting the type as other languages? will python finally move to int x = 3 where int is a pre annotation? i am not arguing it's usefulness but rather, does it fit with python? PEP 526

Re: PEP 526 - var annotations and the spirit of python

2018-07-01 Thread Ian Kelly
On Sun, Jul 1, 2018 at 11:09 AM Abdur-Rahmaan Janhangeer wrote: > > was viewing pep526, so, finally, python cannot do without hinting the type > as other languages? Python certainly can do without it. That's why it's an optional feature with no runtime effect beyond making the annotations inspect

Re: PEP 526 - var annotations and the spirit of python

2018-07-01 Thread Abdur-Rahmaan Janhangeer
i meant that x: int = 3 is dangerously close to int x = 3, in the long run, you'll come across people who come from other languages wanting to java/c style their code and end up sprinkling a lot of these, it'll be a sad day for me return type in function definition also managed to return via ->

Re: PEP 526 - var annotations and the spirit of python

2018-07-01 Thread Chris Angelico
On Mon, Jul 2, 2018 at 3:55 AM, Abdur-Rahmaan Janhangeer wrote: > i meant that x: int = 3 is dangerously close to int x = 3, > > in the long run, you'll come across people who come from other languages > wanting to java/c style their code and end up sprinkling a lot of these, > it'll be a sad day

Re: PEP 526 - var annotations and the spirit of python

2018-07-01 Thread Abdur-Rahmaan Janhangeer
not python, the spirit of python, i guess i must have been around when it was first discussed, now it's too late to discuss why it was introduced in the first place ... Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ I'm sure people will misuse type hints too. What of it? Does it > de

Re: logging module

2018-07-01 Thread Bev in TX
> On Jul 1, 2018, at 8:05 AM, Sharan Basappa wrote: > > Folks, > > I am trying to use logging module and somehow I cannot make it work. Saying that something does not work does not provide enough information for anyone to assist you. You need to provide both the exact code that did not wo

Re: logging module

2018-07-01 Thread Steven D'Aprano
On Sun, 01 Jul 2018 06:05:48 -0700, Sharan Basappa wrote: > Folks, > > I am trying to use logging module and somehow I cannot make it work. > > A simple code that I am trying is below. The commented code line 5,6 are > other options I have tried but don't work > > #importing module > import log

Re: PEP 526 - var annotations and the spirit of python

2018-07-01 Thread Steven D'Aprano
On Sun, 01 Jul 2018 21:55:21 +0400, Abdur-Rahmaan Janhangeer wrote: > i meant that x: int = 3 is dangerously close to int x = 3, > > in the long run, you'll come across people who come from other languages > wanting to java/c style their code and end up sprinkling a lot of these, > it'll be a sad

Re: File names with slashes [was Re: error in os.chdir]

2018-07-01 Thread Gregory Ewing
eryk sun wrote: Python 2 raw strings are half-baked. Obviously the "r" actually stand for "rare". -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP 526 - var annotations and the spirit of python

2018-07-01 Thread Steven D'Aprano
On Sun, 01 Jul 2018 22:48:00 +0400, Abdur-Rahmaan Janhangeer wrote: > not python, the spirit of python, > > i guess i must have been around when it was first discussed, now it's > too late to discuss why it was introduced in the first place ... Guido has been talking about this for a LONG time:

Re: File names with slashes [was Re: error in os.chdir]

2018-07-01 Thread eryk sun
On Sun, Jul 1, 2018 at 4:30 PM, eryk sun wrote: > On Sun, Jul 1, 2018 at 8:51 AM, Steven D'Aprano > >> spam/eggs [...] >> And how would that file be displayed in the Windows GUI file explorer? > > I suppose if a file system allowed forward slash in names that > Explorer would just display it.

Re: PEP 526 - var annotations and the spirit of python

2018-07-01 Thread Jim Lee
On 07/01/18 18:21, Steven D'Aprano wrote: Guido has been talking about this for a LONG time: You keep bringing that up.  It's not an argument. People have been talking about taxes for a long, long time.  Does it surprise you that they still do?  None of us has a time machine that will tra

Re: I lost nearly all my modules installing 3.7

2018-07-01 Thread dieter
Elliott Roper writes: > ... > I should have mentioned that none of this went wrong in 3.6. All I'm after > are packages I can install with pip3. I really don't need to go down all the > twisty passages installing Fortran "pip[*]" is a tool to install Python packages. But some Python packages ar

Re: logging module

2018-07-01 Thread dieter
Sharan Basappa writes: > I am trying to use logging module and somehow I cannot make it work. > > A simple code that I am trying is below. The commented code line 5,6 are > other options I have tried but don't work > > #importing module > import logging > > #Create and configure logger > #loggi

Re: I lost nearly all my modules installing 3.7

2018-07-01 Thread tljarolimek
On Thursday, June 28, 2018 at 1:09:04 PM UTC-4, Elliott Roper wrote: > I have done something stupid. Don't know what. > > My $PATH looks like this > XXXMac:~ elliott$ echo $PATH > /Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Pyth > on.framework/Versions/3.6/bin:/Librar

Re: PEP 526 - var annotations and the spirit of python

2018-07-01 Thread Abdur-Rahmaan Janhangeer
me too i come from "other languages" but what i liked in python was python now the world got mixed up again Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ In the long run, why do we always fear people coming from other > languages? Why don't they fear Python programmers coming to thei