小编msw*_*msw的帖子

我不知道 zsh 中的哈希 (#) 是什么意思

curl 是我在命令行中经常使用的命令。当我使用 ZSH 时,我发现 -# 选项不起作用;该选项在 BASH 中工作正常——见下面的代码:

ZSH:
? curl --progress-bar www.google.com  > google.html
######################################################################## 100.0%

? curl -# www.google.com  > google.html
zsh: no matches found: -#

BASH:
$ curl --progress-bar www.google.com  > google.html
######################################################################## 100.0%

$ curl -# www.google.com  > google.html
######################################################################## 100.0%
Run Code Online (Sandbox Code Playgroud)

当然,如果我不想输入完整的选项名称(即 --progress-bar),我可以定义一个别名来解决这个问题。但我很好奇 ZSH 的哪一部分控制了这种行为,以及是否有任何方法可以在我的任何 .zshrc 文件中自定义/重新定义这种行为。非常感谢您提供任何有用的信息!

zsh

0
推荐指数
1
解决办法
755
查看次数

将可执行文件命名为a.out?

例如,如果我运行gfortran filename.f90它会创建a.out,但我想filename.out改为.

gcc

-1
推荐指数
1
解决办法
2214
查看次数

python语法错误无效

香港专业教育学院刚尝试运行我的python脚本并获得无效的语法错误我已经双重检查问题仍然无法看到问题可以看到问题吗?如果有人可以帮助查看问题,下面是代码.

谢谢.

import random
import Tkinter

class life (Tkinter.Frame):

    def __init__(self,x,y):
        Tkinter.Frame.__init__(self)
        self.master.title("The Game Of Life")
        self.grid = [[False for j in range (y)] for i in range (x)]
        universe = Tkinter.Frame(self)
        def createButton (i,j):
            bitmap=None
            if self.grid[i][j]:bitmap ='gray75'
            gridEntry = Tkinter.Button(universe, bitmap=bitmap)
            gridEntry.grid(row=i, column =j)
        self._applyToEachCellOfGrid (createButton)
        universe.pack(side='top')
        scale= Tkinter.Scale(self, orient = Tkinter.HORIZONTAL, from_=1, to =10,
                             command=self.setPeriod)
        scale.pack(side='top')
        quit=Tkinter.Button(self, text='Quit', command=self.quit)
        quit.pack(side='left')
        run=Tkinter.Button(self, text='Run' , command=self.run)
        run.pack(side='right')
        pause=Tkinter.Button(self, text='Pause', command=self.pause)
        pause.pack(side='right')
        self.pack()

    def _applyToEachCellOfGrid (self, function) :
        for i …
Run Code Online (Sandbox Code Playgroud)

python syntax

-2
推荐指数
1
解决办法
3923
查看次数

在定义之前无法调用函数

当我跑:

if language == "":
    language = t(30009)

# Translation util
def t(string_number):
    plugin       = xbmcaddon.Addon("plugin.video.jworg")
    return plugin.getLocalizedString(string_number)
Run Code Online (Sandbox Code Playgroud)

我明白了:

NameError:未定义名称't'

python

-2
推荐指数
1
解决办法
69
查看次数

标签 统计

python ×2

gcc ×1

syntax ×1

zsh ×1