Re: [Tutor] path

2019-06-30 Thread Mats Wichmann
On 6/30/19 12:01 AM, ingo wrote: > > > On 29-6-2019 15:42, Mats Wichmann wrote: >> >> Most people don't use pathlib, and that's kind of sad, since it tries to >> mitigate the kinds of questions you just asked. Kudos for trying. > > In the end, it works, Sounds good. One suggestion - a sort of

Re: [Tutor] path

2019-06-29 Thread ingo
On 29-6-2019 15:42, Mats Wichmann wrote: > > Most people don't use pathlib, and that's kind of sad, since it tries to > mitigate the kinds of questions you just asked. Kudos for trying. In the end, it works, Ingo ---%<--%<--%<--- # set up some default directories and files # for star

Re: [Tutor] path

2019-06-29 Thread ingo
On 29-6-2019 16:33, ingo wrote: > > What I'm looking for is c:/test/this/path After further testing, the other tools in the chain accept paths like c:\\test\\dir c:\/test/dir c:/test/dir anything except standard windows, the top two I can generate. Ingo

Re: [Tutor] path

2019-06-29 Thread ingo
On 29-6-2019 15:52, Mats Wichmann wrote: > Sigh... something dropped my raw string, so that was a really bad sample :( > > inp = r"c:\test\drive\this" > > > On Sat, Jun 29, 2019, at 07:44, Mats Wichmann wrote: >> >> For your example, when you define inp as a string, it needs to be a raw >> strin

Re: [Tutor] path

2019-06-29 Thread Mats Wichmann
Sigh... something dropped my raw string, so that was a really bad sample :( inp = r"c:\test\drive\this" On Sat, Jun 29, 2019, at 07:44, Mats Wichmann wrote: > > For your example, when you define inp as a string, it needs to be a raw > string because otherwise Python will interpret the backslash

Re: [Tutor] path

2019-06-29 Thread Mats Wichmann
On 6/29/19 6:46 AM, ingo wrote: > A user has to type a path in the commandline on Win 10, so just a > string. > A short excerpt: > > Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 > bit (AMD64)] on win32 > Type "copyright", "credits" or "license()" for more information. >>>

Re: [Tutor] "Path tree"

2017-08-17 Thread Michael C
Ok, I will work with all these. Thx all! On Aug 16, 2017 20:22, "Abdur-Rahmaan Janhangeer" wrote: > in addition to the answers i'd say now you have the motivation to learn > python data structures and algorithms > > http://interactivepython.org/runestone/static/pythonds/index.html > > barnum and

Re: [Tutor] "Path tree"

2017-08-17 Thread Abdur-Rahmaan Janhangeer
in addition to the answers i'd say now you have the motivation to learn python data structures and algorithms http://interactivepython.org/runestone/static/pythonds/index.html barnum and miller it is free though i have not found a good pdf book form from where to download, but you have the site

Re: [Tutor] "Path tree"

2017-08-16 Thread Cameron Simpson
On 16Aug2017 10:22, Alan Gauld wrote: On 16/08/17 02:02, Cameron Simpson wrote: Ok. So you have a graph like this: 1 -- 2 -- 3 -- 4 | 7 -- 5 -- 6 -- 8 graph = { 1: [2], 2: [1, 3], 2: [1, 3, 5], 3: [2, 4], 4: [3], 5: [7, 6], 5: [2, 6, 7],

Re: [Tutor] "Path tree"

2017-08-16 Thread Alan Gauld via Tutor
On 16/08/17 02:02, Cameron Simpson wrote: > Ok. So you have a graph like this: > 1 -- 2 -- 3 -- 4 >| > 7 -- 5 -- 6 -- 8 > > graph = { > 1: [2], > 2: [1, 3], 2: [1, 3, 5], > 3: [2, 4], > 4: [3], > 5: [7, 6], 5: [2, 6, 7], > 6: [5, 8], > 7:

Re: [Tutor] "Path tree"

2017-08-15 Thread Cameron Simpson
On 14Aug2017 12:10, Michael C wrote: http://imgur.com/a/CwA2G Ok. So you have a graph like this: 1 -- 2 -- 3 -- 4 | 7 -- 5 -- 6 -- 8 Have a read of a graph theory textbook. Also, wikipedia has an article on finding the shortest path through a graph: https://en.wikipedia.org/wiki/

Re: [Tutor] "Path tree"

2017-08-15 Thread Peter Otten
Martin A. Brown wrote: > The image: > >> http://imgur.com/a/CwA2G > > To me, this looks like a 'graph', which is a more general data > structure -- it does not look like a 'tree' (in the computer-science > meaning of the term, anyway). > import networkx as nx While Martin's solution is certain

Re: [Tutor] "Path tree"

2017-08-14 Thread Michael C
http://imgur.com/a/CwA2G I don't know to do this with math :( On Sun, Aug 13, 2017 at 1:07 PM, Michael C wrote: > Hi all: > > I am trying to formulate a "path-finding" function, and I am stuck on this > problem: > > Please look at the picture attached: Those dots are coordinates of (x,y)

Re: [Tutor] "Path tree"

2017-08-14 Thread Alan Gauld via Tutor
On 13/08/17 21:07, Michael C wrote: > Please look at the picture attached: This is a text mailing list, no binary attachments allowed. The server strips them off. You need to put it on a web site and provide a link. > consisting of (x,y). Now I am trying to make a function go through this >

Re: [Tutor] "Path tree"

2017-08-14 Thread Mats Wichmann
On 08/13/2017 02:07 PM, Michael C wrote: > Hi all: > > I am trying to formulate a "path-finding" function, and I am stuck on this > problem: > > Please look at the picture attached: Those dots are coordinates of (x,y), > and this tree can be thought of as a list of tuples, with each tuple > consi

Re: [Tutor] path string

2017-01-02 Thread Alan Gauld via Tutor
On 02/01/17 17:01, anatta anatta wrote: > I am trying to create unsuccessfully source path as > a string 'str7' in part_1 of the code below, When you say unsuccessfully what do you mean? What do you expect? What do you get? > to be used in part_2 of the code. For that you need to expose it out

Re: [Tutor] path directory backslash ending

2013-04-19 Thread eryksun
On Thu, Apr 18, 2013 at 8:51 PM, Jim Mooney wrote: > > But that's in win 7. Is it okay to always omit them in Linux? Python33 > is itself installed with a trailing backslash, so I figured this was a > Linux habit. POSIX/Linux uses a forward slash instead of a backslash (py: os.sep), and the delim

Re: [Tutor] path directory backslash ending

2013-04-18 Thread Jim Mooney
Well, under the principle of least harm, it appears that since the trailing backslash causes no harm if omitted, but sometimes does if allowed, I removed them all. But that's in win 7. Is it okay to always omit them in Linux? Python33 is itself installed with a trailing backslash, so I figured th

Re: [Tutor] path directory backslash ending

2013-04-18 Thread eryksun
On Thu, Apr 18, 2013 at 12:45 PM, Jim Mooney wrote: > Minor question. I was adding the Py Script directory to the Win 7 > Path, and noticed that Python33 ends with a backslash but many > directories do not. Is there a difference? Should I use backslash or > not preferentially, or doesn't it matter

Re: [Tutor] path directory backslash ending

2013-04-18 Thread Dave Angel
On 04/18/2013 12:45 PM, Jim Mooney wrote: Minor question. I was adding the Py Script directory to the Win 7 Path, and noticed that Python33 ends with a backslash but many directories do not. Is there a difference? Should I use backslash or not preferentially, or doesn't it matter at all? It does

Re: [Tutor] Path?

2010-07-15 Thread Adam Bark
On 15 July 2010 17:21, Jim Byrnes wrote: > Adam Bark wrote: > >> On 14 July 2010 17:41, Jim Byrnes wrote: >> >> Adam Bark wrote: >>> >>> On 14 July 2010 02:53, Jim Byrnes wrote: Adam Bark wrote: > > > > > If I use the terminal to start the program it has

Re: [Tutor] Path?

2010-07-15 Thread Jim Byrnes
Adam Bark wrote: On 14 July 2010 17:41, Jim Byrnes wrote: Adam Bark wrote: On 14 July 2010 02:53, Jim Byrnes wrote: Adam Bark wrote: If I use the terminal to start the program it has no problem using the file. There are multiple files in multiple directories so I was lookin

Re: [Tutor] Path?

2010-07-14 Thread Adam Bark
On 14 July 2010 17:41, Jim Byrnes wrote: > Adam Bark wrote: > >> On 14 July 2010 02:53, Jim Byrnes wrote: >> >> Adam Bark wrote: >>> >>> >>> >>> >>> If I use the terminal to start the program it has no problem using the >>> file. There are multiple files in multiple directories so I wa

Re: [Tutor] Path?

2010-07-14 Thread Jim Byrnes
Adam Bark wrote: On 14 July 2010 02:53, Jim Byrnes wrote: Adam Bark wrote: If I use the terminal to start the program it has no problem using the file. There are multiple files in multiple directories so I was looking for a way to just double click them and have them run. If it turns

Re: [Tutor] Path?

2010-07-14 Thread Adam Bark
On 14 July 2010 02:53, Jim Byrnes wrote: > Adam Bark wrote: > > > > > If I use the terminal to start the program it has no problem using the > file. There are multiple files in multiple directories so I was > looking > for > a way to just double click them and have them run. I

Re: [Tutor] Path?

2010-07-13 Thread Jim Byrnes
Adam Bark wrote: If I use the terminal to start the program it has no problem using the file. There are multiple files in multiple directories so I was looking for a way to just double click them and have them run. If it turns out that I must make changes to or for each of the files it will

Re: [Tutor] Path?

2010-07-13 Thread Adam Bark
On 13 July 2010 23:27, Jim Byrnes wrote: > Adam Bark wrote: > >> On 13 July 2010 14:43, Jim Byrnes wrote: >> >> Steven D'Aprano wrote: >>> >>> My apologizes to Steven and the list, when I replied originally I messed >>> up >>> and sent it to him privately which was not my intention. >>> >>> >>>

Re: [Tutor] Path?

2010-07-13 Thread Jim Byrnes
Adam Bark wrote: On 13 July 2010 14:43, Jim Byrnes wrote: Steven D'Aprano wrote: My apologizes to Steven and the list, when I replied originally I messed up and sent it to him privately which was not my intention. On Mon, 12 Jul 2010 03:42:28 am Jim Byrnes wrote: I am running Ubuntu. I

Re: [Tutor] Path?

2010-07-13 Thread Adam Bark
On 13 July 2010 14:43, Jim Byrnes wrote: > Steven D'Aprano wrote: > > My apologizes to Steven and the list, when I replied originally I messed up > and sent it to him privately which was not my intention. > > > > > On Mon, 12 Jul 2010 03:42:28 am Jim Byrnes wrote: > >> I am running Ubuntu. I dow

Re: [Tutor] Path?

2010-07-13 Thread Jim Byrnes
Steven D'Aprano wrote: My apologizes to Steven and the list, when I replied originally I messed up and sent it to him privately which was not my intention. > On Mon, 12 Jul 2010 03:42:28 am Jim Byrnes wrote: >> I am running Ubuntu. I downloaded the source code examples for a >> book I purcha

Re: [Tutor] Path?

2010-07-11 Thread Steven D'Aprano
On Mon, 12 Jul 2010 03:42:28 am Jim Byrnes wrote: > I am running Ubuntu. I downloaded the source code examples for a > book I purchased. Some of the examples load image files located in > the same directory as the program. If I go to the current directory > in the terminal the program can use th

Re: [Tutor] Path?

2010-07-11 Thread Adam Bark
On 11/07/10 18:42, Jim Byrnes wrote: I am running Ubuntu. I downloaded the source code examples for a book I purchased. Some of the examples load image files located in the same directory as the program. If I go to the current directory in the terminal the program can use the image files. H

Re: [Tutor] path to executing .py file

2009-04-14 Thread tiefeng wu
> > is there some way to get path to my executing script, so I can replaced >> "os.getcwd()" in above line? >> > > Look at the recent thread on creating exe files with py2exe. > Investigate the __file__ variable... thanks, Alan Gauld. thanks for your patience for such a trivial question:) > sh

Re: [Tutor] path to executing .py file

2009-04-14 Thread Alan Gauld
"tiefeng wu" wrote is there some way to get path to my executing script, so I can replaced "os.getcwd()" in above line? Look at the recent thread on creating exe files with py2exe. Investigate the __file__ variable... shutil.rmtree(svn_repos_copy_dir) I got error "Access denied!" Is that

Re: [Tutor] path to use for setting the environment variable PYTHONDOCS?

2007-03-07 Thread Dick Moores
At 03:15 AM 3/7/2007, Kent Johnson wrote: >Dick Moores wrote: > > At 02:41 PM 3/6/2007, Alan Gauld wrote: > > > >> "Dick Moores" <[EMAIL PROTECTED]> wrote > >> > >>> Sorry, topic and keyword documentation is not available because the > >>> Python > >>> HTML documentation files could not be found.

Re: [Tutor] path to use for setting the environment variable PYTHONDOCS?

2007-03-07 Thread Kent Johnson
Dick Moores wrote: > At 02:41 PM 3/6/2007, Alan Gauld wrote: > >> "Dick Moores" <[EMAIL PROTECTED]> wrote >> >>> Sorry, topic and keyword documentation is not available because the >>> Python >>> HTML documentation files could not be found. If you have installed >>> them, >>> please set the envir

Re: [Tutor] path to use for setting the environment variable PYTHONDOCS?

2007-03-06 Thread Dick Moores
At 02:41 PM 3/6/2007, Alan Gauld wrote: >"Dick Moores" <[EMAIL PROTECTED]> wrote > > > Sorry, topic and keyword documentation is not available because the > > Python > > HTML documentation files could not be found. If you have installed > > them, > > please set the environment variable PYTHONDOCS

Re: [Tutor] path to use for setting the environment variable PYTHONDOCS?

2007-03-06 Thread Alan Gauld
"Dick Moores" <[EMAIL PROTECTED]> wrote > Sorry, topic and keyword documentation is not available because the > Python > HTML documentation files could not be found. If you have installed > them, > please set the environment variable PYTHONDOCS to indicate their > location. >