首页 \ 问答 \ 使用&中间打开文件 - Mac终端(Opening a file with an & in the middle — Mac Terminal)

使用&中间打开文件 - Mac终端(Opening a file with an & in the middle — Mac Terminal)

这只是令人抓狂 - 我的文件中间有一个&符号。 当我的python脚本打开它时,&符号作为命令结束字符或其他东西....

谁能告诉我如何解决这个问题? 或者更好的是,我很想知道在哪里查找终端所有这些特殊字符的列表。

提前致谢

- 一个mac noob


This is just maddening--I have a file with an & sign in the middle of it. When my python script went to open it, the & sign acted as an end of command character or something....

Can anyone tell me how to get around this? Or better yet, I would love to know where to look for a list of all of these special characters for the terminal.

Thanks in advance

--A mac noob


原文:https://stackoverflow.com/questions/11233682
更新时间:2022-07-30 11:07

最满意答案

您可能希望无论如何都要将ComboBoxItem的Content字符串用于SelectedOperator绑定,在这种情况下,您可以使用FallbackValue

<ComboBox SelectedValuePath="Content"
          SelectedValue="{Binding SelectedOperator, FallbackValue=\=}">
    <ComboBoxItem Content="=" />
    <ComboBoxItem Content="&gt;" />
    <ComboBoxItem Content="&lt;" />
</ComboBox>

You might probably want to use the ComboBoxItem's Content string for the SelectedOperator binding anyway, in which case you could use a FallbackValue:

<ComboBox SelectedValuePath="Content"
          SelectedValue="{Binding SelectedOperator, FallbackValue=\=}">
    <ComboBoxItem Content="=" />
    <ComboBoxItem Content="&gt;" />
    <ComboBoxItem Content="&lt;" />
</ComboBox>

相关问答

更多
  • 您可能希望无论如何都要将ComboBoxItem的Content字符串用于SelectedOperator绑定,在这种情况下,您可以使用FallbackValue :
  • 感谢这些资源: http : //social.msdn.microsoft.com/Forums/vstudio/en-US/ce14fc29-d320-4557-abc5-81b042730c48/how-to-get-current-combobox-item-on-which -mouse旁白式,WPF 我找到了这个解决方案 在WPF中: ...
  • 这是一个非常痛苦的一些奇怪的原因,你必须使用ContainerFromItem来获取容器,然后调用select方法。 有一个关于如何在这里做的博客条目。 It's a real pain for some strange reason, you have to use ContainerFromItem to get the container, then invoke the select method. // selectedItemObject is not a TreeViewItem, but ...
  • 将ItemsPanelTemplate更改为WrapPanel。