小编Let*_*lle的帖子

powershell 运行 pip

我想通过 powershell 脚本运行 python 模块升级。第一行有效。
但我不知道如何将文件正确读入第二个 pip 行。我收到此错误:

Could not find a version that satisfies the requirement Get-Content   

pip freeze| Out-File requirements.txt 
pip install --upgrade  Get-Content requirements.txt
Remove-Item  requirements.txt
Run Code Online (Sandbox Code Playgroud)

更新:现在可以使用更改后的第二行。

    pip freeze| Out-File requirements.txt 

    foreach($line in Get-Content requirements.txt) 
    {
      pip install --upgrade $line 
    }  

    Remove-Item  requirements.txt
Run Code Online (Sandbox Code Playgroud)

更新 2 现在,在 python 3.6 中,我使用这个脚本。

$(
$exclude = 'virtualenv', 'prompt-toolkit'
pip list --outdated --format=freeze  | ForEach{ $_.split("=")[0]} | Where-Object { $exclude -notcontains $_ } | ForEach { pip install -U $_ }                               
) …
Run Code Online (Sandbox Code Playgroud)

python powershell pip

3
推荐指数
1
解决办法
1万
查看次数

seaborn 如何设置样式和字体大小

我正在尝试像这样更改样式和字体大小

sns.set_style("whitegrid")  

sns.set(font_scale=1.5)
Run Code Online (Sandbox Code Playgroud)

但似乎两者是相互排斥的。我一次只能使用其中的一行。如何使这两种变化显而易见?

python-3.x seaborn

3
推荐指数
1
解决办法
6828
查看次数

wpf边框比标签大得多

我想在标签周围放一个边框.但边界似乎有一些填充,或边缘,并没有接近标签.

 <Style x:Key="ArithmeticBorder" TargetType="Border">
            <Setter Property="BorderBrush" Value="Blue" />
            <Setter Property="BorderThickness" Value="6" />
            <Setter Property="CornerRadius" Value="6" />
            <Setter Property="Grid.Row" Value="4"/>
            <Setter Property="Grid.Column" Value="0"/>
        </Style>
 <Border Style="{StaticResource ArithmeticBorder}">
        <Label Content="Arithmetic" 
           HorizontalAlignment="Left" 
           Foreground="DarkBlue"
           Background="Yellow"
           FontStyle="Oblique"
           FontSize="16"
           FontFamily="Comic"
           Height="58.012" 
           Width="100"
           Margin="0,23.2,0,0"            
           VerticalAlignment="Top" 
           HorizontalContentAlignment="Center"
           VerticalContentAlignment="Center"
           />
Run Code Online (Sandbox Code Playgroud)

c# wpf xaml label

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

clear()不会使用selenium和python和firefox清除文本框

clear()在这种情况下不起作用。我追加后追加。
searchForMovie.clear()无法运作...我也曾尝试传送
CTRL + 'a',然后传送DELETE。同样,我得到的只是附件...

 for movie in allMissing:

            time.sleep (10)

            searchForMovie = WebDriverWait (driver, 10).until \
                (EC.presence_of_element_located ((By.CSS_SELECTOR, "#search-text")))  

            searchForMovie.send_keys (movie)

            # click
            enter = WebDriverWait (driver, 10).until \
                (EC.presence_of_element_located ((By.CSS_SELECTOR, "#search-submit")))  

            driver.execute_script ("arguments[0].click()", enter)


            # clear the search text box
            searchForMovie = WebDriverWait (driver, 10).until \
                (EC.presence_of_element_located ((By.CSS_SELECTOR, "#search-text")))

            searchForMovie.clear()
Run Code Online (Sandbox Code Playgroud)

selenium css-selectors python-3.x selenium-webdriver webdriverwait

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