Re: Python27.dll module error from Python 2.7.15/PCbuild/get_externals.bat

2018-06-30 Thread Amit Kumar Singh
Yes pylauncher was installed when I installed 3.6.4. Moreover, the python in externals\pythonx86 is supposed to be able to parse it's own code but it errors out in my case. Can you provide me the list of all the external modules with it's dependencies if possible ? I will pull those separately a

Re: Python 3.7 Windows Help Behaviour

2018-06-30 Thread BlindAnagram
On 29/06/2018 17:53, Terry Reedy wrote: > On 6/29/2018 6:14 AM, BlindAnagram wrote: >> In Python 3.7.0 on Windows the help file (python370.chm) displays with a >> fixed line length and does not adjust its line length when the user >> expands the help window horizontally.  This behaviour is differen

Re: Python 3.7 Windows Help Behaviour

2018-06-30 Thread Steven D'Aprano
On Fri, 29 Jun 2018 12:53:15 -0400, Terry Reedy wrote: > On 6/29/2018 6:14 AM, BlindAnagram wrote: >> In Python 3.7.0 on Windows the help file (python370.chm) displays with >> a fixed line length and does not adjust its line length when the user >> expands the help window horizontally. This behav

error in os.chdir

2018-06-30 Thread Sharan Basappa
0 down vote favorite I need to change directory to my local working directory in windows and then open a file for processing. Its just a 3 lines code, as below: import csv import os os.chdir('D:\Projects\Initiatives\machine learning\programs\assertion') The error is as follows: WindowsError: [E

Re: error in os.chdir

2018-06-30 Thread Karsten Hilbert
On Sat, Jun 30, 2018 at 04:05:22AM -0700, Sharan Basappa wrote: > I need to change directory to my local working directory in windows and then > open a file for processing. > Its just a 3 lines code, as below: > import csv > import os > os.chdir('D:\Projects\Initiatives\machine learning\programs\

naming methods in python (std lib)

2018-06-30 Thread Abdur-Rahmaan Janhangeer
normally, naming methods in python is given by method_name but i see some cases where this is not followed in the std lib ex : dict.fromkeys should it not have been from_keys? Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ -- https://mail.python.org/mailman/listinfo/python-list

Re: error in os.chdir

2018-06-30 Thread Chris Angelico
On Sat, Jun 30, 2018 at 9:05 PM, Sharan Basappa wrote: > > 0 > down vote > favorite > > I need to change directory to my local working directory in windows and then > open a file for processing. > Its just a 3 lines code, as below: > import csv > import os > os.chdir('D:\Projects\Initiatives\mach

Re: error in os.chdir

2018-06-30 Thread Sharan Basappa
On Saturday, 30 June 2018 16:51:53 UTC+5:30, Karsten Hilbert wrote: > On Sat, Jun 30, 2018 at 04:05:22AM -0700, Sharan Basappa wrote: > > > I need to change directory to my local working directory in windows and > > then open a file for processing. > > Its just a 3 lines code, as below: > > impo

list initialize with ?

2018-06-30 Thread Sharan Basappa
Can anyone explain to me what the ? does here: ignore_words = ['?'] -- https://mail.python.org/mailman/listinfo/python-list

Re: error in os.chdir

2018-06-30 Thread Abdur-Rahmaan Janhangeer
for user input, a replace might be the solution, using / in internal code Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ Use forward slashes instead of backslashes for all paths. > > os.chdir('D:/Projects/Initiatives/machine learning/programs') > > ChrisA > -- > https://mail.python.or

Re: list initialize with ?

2018-06-30 Thread Steven D'Aprano
On Sat, 30 Jun 2018 04:50:10 -0700, Sharan Basappa wrote: > Can anyone explain to me what the ? does here: > > ignore_words = ['?'] Its a question mark inside a string, which is inside a list. You can put anything you like in strings: 'a' 'abcde' even punctuation like '?'. Then you c

Re: naming methods in python (std lib)

2018-06-30 Thread Steven D'Aprano
On Sat, 30 Jun 2018 15:27:35 +0400, Abdur-Rahmaan Janhangeer wrote: > normally, naming methods in python is given by > > method_name > > but i see some cases where this is not followed in the std lib > > ex : dict.fromkeys > > should it not have been > > from_keys? Python is about 25 years

Re: error in os.chdir

2018-06-30 Thread Steven D'Aprano
On Sat, 30 Jun 2018 04:47:44 -0700, Sharan Basappa wrote: >> The quick fix: >> >> put an r in front of the directory string: r'...' > > thanks. That works Please don't do that. It's the wrong solution -- all you are doing is postponing failure. It will *seem* to work, until one day you will wri

Re: error in os.chdir

2018-06-30 Thread Sharan Basappa
On Saturday, 30 June 2018 18:05:02 UTC+5:30, Steven D'Aprano wrote: > On Sat, 30 Jun 2018 04:47:44 -0700, Sharan Basappa wrote: > > >> The quick fix: > >> > >> put an r in front of the directory string: r'...' > > > > thanks. That works > > Please don't do that. It's the wrong solution -- all y

Re: list initialize with ?

2018-06-30 Thread Sharan Basappa
On Saturday, 30 June 2018 17:48:05 UTC+5:30, Steven D'Aprano wrote: > On Sat, 30 Jun 2018 04:50:10 -0700, Sharan Basappa wrote: > > > Can anyone explain to me what the ? does here: > > > > ignore_words = ['?'] > > Its a question mark inside a string, which is inside a list. You can put > anyth

is my interpreation correct

2018-06-30 Thread Sharan Basappa
A code I am using as reference has the following line: from nltk.stem.lancaster import LancasterStemmer I am inferring the following based on above: 1) nltk is a package 2) nltk itself may have module because I see - nltk.word_tokenize(pattern['sentence']) in the code 3) nltk has a package named

Re: error in os.chdir

2018-06-30 Thread Karsten Hilbert
On Sat, Jun 30, 2018 at 05:46:59AM -0700, Sharan Basappa wrote: > > >> The quick fix: > > >> > > >> put an r in front of the directory string: r'...' > > > > Please don't do that. It's the wrong solution -- all you are doing is > > postponing failure. It will *seem* to work, until one day you w

Re: Python 3.7 Windows Help Behaviour

2018-06-30 Thread BlindAnagram
On 30/06/2018 10:43, Steven D'Aprano wrote: > On Fri, 29 Jun 2018 12:53:15 -0400, Terry Reedy wrote: > >> On 6/29/2018 6:14 AM, BlindAnagram wrote: >>> In Python 3.7.0 on Windows the help file (python370.chm) displays with >>> a fixed line length and does not adjust its line length when the user >

Re: error in os.chdir

2018-06-30 Thread Sharan Basappa
On Saturday, 30 June 2018 18:55:53 UTC+5:30, Karsten Hilbert wrote: > On Sat, Jun 30, 2018 at 05:46:59AM -0700, Sharan Basappa wrote: > > > > >> The quick fix: > > > >> > > > >> put an r in front of the directory string: r'...' > > > > > > Please don't do that. It's the wrong solution -- all yo

Re: error in os.chdir

2018-06-30 Thread Karsten Hilbert
On Sat, Jun 30, 2018 at 07:34:46AM -0700, Sharan Basappa wrote: > sorry. I mean why my code worked in one case but did not in the other one. > > This worked - os.chdir('D:\Projects\Initiatives\machine learning\programs') > > This did not work - os.chdir('D:\Projects\Initiatives\machine > learn

using trace module in enthought

2018-06-30 Thread Sharan Basappa
I am using enthought for python. Trace module seems to be very useful for my work but somehow I am unable to make it work. When I use the following option, I get the following error: %run -m trace --trace "D:/Projects/Initiatives/machine learning/programs/debug_1.py" UsageError: option --trace

Logger option

2018-06-30 Thread Sharan Basappa
Can anyone tell me if there are some good logger modules in Python. I have tried both logging and trace in Canopy and both are not working. Any help is appreciated. -- https://mail.python.org/mailman/listinfo/python-list

Re: Logger option

2018-06-30 Thread Karsten Hilbert
On Sat, Jun 30, 2018 at 10:02:13AM -0700, Sharan Basappa wrote: > I have tried both logging and trace in Canopy and both are not working. You will have to be more specific. Karsten -- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B -- https://mail.python.org/mailman/listinfo/python-lis

Re: I lost nearly all my modules installing 3.7

2018-06-30 Thread Elliott Roper
On 30 Jun 2018, dieter wrote (in article): > Elliott Roper writes: > > ... > > install scipy wrote an error message longer than War and Peace that finished > > with:- > > > > error: library dfftpack has Fortran sources b

Re: error in os.chdir

2018-06-30 Thread Jim Lee
On 06/30/18 07:34, Sharan Basappa wrote: sorry. I mean why my code worked in one case but did not in the other one. This worked - os.chdir('D:\Projects\Initiatives\machine learning\programs') This did not work - os.chdir('D:\Projects\Initiatives\machine learning\programs\assertion') only di

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

2018-06-30 Thread Peter J. Holzer
On 2018-06-28 18:04:16 -0700, Dan Stromberg wrote: > On Thu, Jun 28, 2018 at 1:27 PM, Marko Rauhamaa wrote: > > Dan Stromberg : > > > On Wed, Jun 27, 2018 at 10:31 PM, Marko Rauhamaa > > > wrote: > > >> Dan Stromberg : > > >> >> > The problem can be solved by turning on the SO_REUSEADDR flag of >

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

2018-06-30 Thread Jim Lee
On 06/28/18 18:04, Dan Stromberg wrote: [snip] Start an echo server process P that listens on tcp/. Initiate a connection from a client machine to process P at tcp/. It works as expected. Kill P. Initiate a connection from a client machine to process P at tcp/. It gives a connec

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

2018-06-30 Thread Dan Stromberg
On Sat, Jun 30, 2018 at 11:19 AM, Peter J. Holzer wrote: > On 2018-06-28 18:04:16 -0700, Dan Stromberg wrote: > > On Thu, Jun 28, 2018 at 1:27 PM, Marko Rauhamaa > wrote: > > Start an echo server process P that listens on tcp/. > > > > Initiate a connection from a client machine to process P

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

2018-06-30 Thread Peter J. Holzer
On 2018-06-30 14:01:56 -0700, Dan Stromberg wrote: > On Sat, Jun 30, 2018 at 11:19 AM, Peter J. Holzer wrote: > > On 2018-06-28 18:04:16 -0700, Dan Stromberg wrote: > > > If someone else comes along soon after and starts a different echo server

Re: naming methods in python (std lib)

2018-06-30 Thread Terry Reedy
On 6/30/2018 7:27 AM, Abdur-Rahmaan Janhangeer wrote: normally, naming methods in python is given by method_name but i see some cases where this is not followed in the std lib ex : dict.fromkeys should it not have been from_keys? No. _ is an option, not a requirement and usually not used

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

2018-06-30 Thread T Berger
On Friday, June 29, 2018 at 7:00:15 PM UTC-4, Cameron Simpson wrote: > The key point here from Jim is "simultaneously". Are you properly shutting > down > the Flask instance in IDLE before running from Terminal, and vice versa? Cameron, I try every option to quit either program, but they don't

Re: is my interpreation correct

2018-06-30 Thread Terry Reedy
On 6/30/2018 8:57 AM, Sharan Basappa wrote: A code I am using as reference has the following line: from nltk.stem.lancaster import LancasterStemmer The CapitalName indicates a class. I am inferring the following based on above: 1) nltk is a package 2) nltk itself may have module because I see

Re: using trace module in enthought

2018-06-30 Thread Terry Reedy
On 6/30/2018 12:46 PM, Sharan Basappa wrote: I am using enthought for python. Trace module seems to be very useful for my work but somehow I am unable to make it work. When I use the following option, I get the following error: %run What is 'run' and what does it do? Does not exist on Window

$s and %d in python

2018-06-30 Thread Sharan Basappa
Is there any difference in %d and %s below. I get the same result: my_name = 'Zed A. Shaw' my_age = 35 # not a lie my_height = 74 # inches print "Let's talk about %s." % my_name print "He's %d inches tall." % my_height print "He's %s inches tall." % my_height Let's talk about Zed A. Shaw. He's 7

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

2018-06-30 Thread MRAB
On 2018-06-30 23:01, T Berger wrote: On Friday, June 29, 2018 at 7:00:15 PM UTC-4, Cameron Simpson wrote: The key point here from Jim is "simultaneously". Are you properly shutting down the Flask instance in IDLE before running from Terminal, and vice versa? Cameron, I try every option to qui

Re: $s and %d in python

2018-06-30 Thread Cameron Simpson
On 30Jun2018 05:01, Sharan Basappa wrote: Is there any difference in %d and %s below. I get the same result: my_name = 'Zed A. Shaw' my_age = 35 # not a lie my_height = 74 # inches print "Let's talk about %s." % my_name print "He's %d inches tall." % my_height print "He's %s inches tall." % my

Re: error in os.chdir

2018-06-30 Thread eryk sun
On Sat, Jun 30, 2018 at 11:21 AM, Chris Angelico wrote: > On Sat, Jun 30, 2018 at 9:05 PM, Sharan Basappa > wrote: >> >> 0 >> down vote >> favorite >> >> I need to change directory to my local working directory in windows and then >> open a file for processing. >> Its just a 3 lines code, as bel

Re: error in os.chdir

2018-06-30 Thread Chris Angelico
On Sun, Jul 1, 2018 at 9:36 AM, eryk sun wrote: > On Sat, Jun 30, 2018 at 11:21 AM, Chris Angelico wrote: >> On Sat, Jun 30, 2018 at 9:05 PM, Sharan Basappa >> wrote: >>> >>> 0 >>> down vote >>> favorite >>> >>> I need to change directory to my local working directory in windows and >>> then op

Re: $s and %d in python

2018-06-30 Thread Terry Reedy
On 6/30/2018 7:04 PM, Cameron Simpson wrote: On 30Jun2018 05:01, Sharan Basappa wrote: Is there any difference in %d and %s below. I get the same result: my_name = 'Zed A. Shaw' my_age = 35 # not a lie my_height = 74 # inches print "Let's talk about %s." % my_name print "He's %d inches tall."

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

2018-06-30 Thread Gregory Ewing
Dan Stromberg wrote: On Thu, Jun 28, 2018 at 10:30 PM, Marko Rauhamaa wrote: Well, the same security issue can be demonstrated without SO_REUSEADDR: The security issue can be real but is not directly related with SO_REUSEADDR. Yes, it can. It just takes longer. I don't see how the addres

Re: error in os.chdir

2018-06-30 Thread Terry Reedy
On 6/30/2018 7:36 PM, eryk sun wrote: On Sat, Jun 30, 2018 at 11:21 AM, Chris Angelico wrote: On Sat, Jun 30, 2018 at 9:05 PM, Sharan Basappa wrote: 0 down vote favorite I need to change directory to my local working directory in windows and then open a file for processing. Its just a 3 li

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

2018-06-30 Thread Grant Edwards
On 2018-06-30, Gregory Ewing wrote: > Dan Stromberg wrote: >> On Thu, Jun 28, 2018 at 10:30 PM, Marko Rauhamaa wrote: >> >>>Well, the same security issue can be demonstrated without SO_REUSEADDR: >>> >>>The security issue can be real but is not directly related with >>>SO_REUSEADDR. >> >> Yes, i

Re: error in os.chdir

2018-06-30 Thread eryk sun
On Sat, Jun 30, 2018 at 11:42 PM, Chris Angelico wrote: > On Sun, Jul 1, 2018 at 9:36 AM, eryk sun wrote: >> On Sat, Jun 30, 2018 at 11:21 AM, Chris Angelico wrote: >>> On Sat, Jun 30, 2018 at 9:05 PM, Sharan Basappa >>> wrote: 0 down vote favorite I need to change

Re: error in os.chdir

2018-06-30 Thread Steven D'Aprano
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 command line > arguments, \\?\ prefixed paths, or registry paths. I don't see why this is relevant, or at least not the "c

Re: list initialize with ?

2018-06-30 Thread Steven D'Aprano
On Sat, 30 Jun 2018 05:49:03 -0700, Sharan Basappa wrote: > On Saturday, 30 June 2018 17:48:05 UTC+5:30, Steven D'Aprano wrote: >> On Sat, 30 Jun 2018 04:50:10 -0700, Sharan Basappa wrote: >> >> > Can anyone explain to me what the ? does here: >> > >> > ignore_words = ['?'] >> >> Its a questio

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

2018-06-30 Thread Steven D'Aprano
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 anyone say "security is binary" except to disagree with it, "don't m

Re: error in os.chdir

2018-06-30 Thread Chris Angelico
On Sun, Jul 1, 2018 at 10:20 AM, eryk sun wrote: > On Sat, Jun 30, 2018 at 11:42 PM, Chris Angelico wrote: >> "Legacy" implies that it's the old standard that is now deprecated, > > I did not mean to imply that DOS paths are deprecated. That's not what > legacy means to me. Unless you are Humpty

Re: list initialize with ?

2018-06-30 Thread Steven D'Aprano
On Sat, 30 Jun 2018 05:49:03 -0700, Sharan Basappa wrote: > On Saturday, 30 June 2018 17:48:05 UTC+5:30, Steven D'Aprano wrote: >> On Sat, 30 Jun 2018 04:50:10 -0700, Sharan Basappa wrote: >> >> > Can anyone explain to me what the ? does here: >> > >> > ignore_words = ['?'] >> >> Its a questio

Re: Logger option

2018-06-30 Thread Steven D'Aprano
On Sat, 30 Jun 2018 10:02:13 -0700, Sharan Basappa wrote: > Can anyone tell me if there are some good logger modules in Python. I > have tried both logging and trace in Canopy and both are not working. When you are talking about a standard module used by hundreds of thousands or millions of prog

Re: Logger option

2018-06-30 Thread Chris Angelico
On Sun, Jul 1, 2018 at 12:03 PM, Steven D'Aprano wrote: > On Sat, 30 Jun 2018 10:02:13 -0700, Sharan Basappa wrote: > >> Can anyone tell me if there are some good logger modules in Python. I >> have tried both logging and trace in Canopy and both are not working. > > When you are talking about a s

Re: error in os.chdir

2018-06-30 Thread eryk sun
On Sun, Jul 1, 2018 at 1:58 AM, Chris Angelico wrote: > On Sun, Jul 1, 2018 at 10:20 AM, eryk sun wrote: >> On Sat, Jun 30, 2018 at 11:42 PM, Chris Angelico wrote: >>> "Legacy" implies that it's the old standard that is now deprecated, >> >> I did not mean to imply that DOS paths are deprecated.

Re: error in os.chdir

2018-06-30 Thread Chris Angelico
On Sun, Jul 1, 2018 at 12:22 PM, eryk sun wrote: >> So what if, internally, that's done by converting them to backslashes? >> No Python program needs to care. In fact, there are other conversions, >> too - the underlying file system is most likely using UTF-16 paths, >> but your Python program nee

Re: $s and %d in python

2018-06-30 Thread Gregory Ewing
Cameron Simpson wrote: The variable my_height is an int, and for an int both these things are the same. But note that 'd' and 's' can give different results when other formatting options are present, e.g. >>> "%05d" % 42 '00042' >>> "%05s" % 42 ' 42' -- Greg -- https://mail.python.org/mailm

Re: error in os.chdir

2018-06-30 Thread eryk sun
On Sun, Jul 1, 2018 at 2:28 AM, Chris Angelico wrote: > On Sun, Jul 1, 2018 at 12:22 PM, eryk sun wrote: >>> So what if, internally, that's done by converting them to backslashes? >>> No Python program needs to care. In fact, there are other conversions, >>> too - the underlying file system is mo

Re: error in os.chdir

2018-06-30 Thread Chris Angelico
On Sun, Jul 1, 2018 at 12:43 PM, eryk sun wrote: > On Sun, Jul 1, 2018 at 2:28 AM, Chris Angelico wrote: >> On Sun, Jul 1, 2018 at 12:22 PM, eryk sun wrote: So what if, internally, that's done by converting them to backslashes? No Python program needs to care. In fact, there are other

Re: error in os.chdir

2018-06-30 Thread eryk sun
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 command line >> arguments, \\?\ prefixed paths, or registry pa

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

2018-06-30 Thread T Berger
On Saturday, June 30, 2018 at 6:39:36 PM UTC-4, MRAB wrote: > On 2018-06-30 23:01, T Berger wrote: > > On Friday, June 29, 2018 at 7:00:15 PM UTC-4, Cameron Simpson wrote: > > > >> The key point here from Jim is "simultaneously". Are you properly shutting > >> down > >> the Flask instance in IDL

Re: error in os.chdir

2018-06-30 Thread Steven D'Aprano
On Sun, 01 Jul 2018 02:22:41 +, eryk sun wrote: > I use the native API a lot, so for me registry and file paths are just > paths. It's only the Windows API that separates the two and only the > Windows API that allows forward slash as a path separator in file paths. Not being a Windows user,