User directory in PATH in zsh: ~ Does Not Work

1,006

Use $HOME instead.

PATH="$HOME/scripts:$PATH"
Share:
1,006

Related videos on Youtube

Dan G.
Author by

Dan G.

Updated on September 17, 2022

Comments

  • Dan G.
    Dan G. over 1 year

    I am trying to make a basic drawing program with a RadioButton to determine shape of the brush.

    self.choseo = Radiobutton(text='Circle', variable=shape,indicatoron=0, value=1)
    self.choser = Radiobutton(text='Rectangle', variable=shape,indicatoron=0, value=2)
    self.chosea = Radiobutton(text='Arc', variable=shape,indicatoron=0, value=3)
    

    Which corresponds to:

       if shape.get()==3:
          self.display.create_arc( self.x1, self.y1, self.x2,
              self.y2, fill = mycolor, outline= mycolor, tags = "line")
       elif shape.get()==2:
          self.display.create_rectangle( self.x1, self.y1, self.x2,
              self.y2, fill = mycolor, outline= mycolor, tags = "line")
       elif shape.get()==1:
          self.display.create_oval( self.x1, self.y1, self.x2,
              self.y2, fill = mycolor, outline= mycolor, tags = "line")
    

    When i run this i get this error:

    "TypeError: get() takes exactly 1 argument (0 given)"
    

    How do i make this work?

    • Nix
      Nix over 11 years
      What is shape? Generally .get() accepts an index.
  • Chris Johnsen
    Chris Johnsen almost 14 years
    Expansion of ~ in PATH is an abhorrent bashism. The PATH-searching library functions execlp or execvp do not expand ~, so other programs that use them to find and run programs in the PATH would also fail to search ~ entries.
  • Dennis Williamson
    Dennis Williamson almost 14 years
    I consider ~ to be a command-line convenience. It shouldn't be used in scripts and variable values for expansion.
  • Dan Rosenstark
    Dan Rosenstark almost 14 years
    @Chris Johnsen, it's amazing, the main impact on my *nix knowledge after switching shells is learning what is universal and what is not. I think zsh is cool, but I've learned quite a bit suffering through the switch (and I'm only two days in). @Dennis Williamson, I'm getting that, and it makes sense, somehow.