小编diz*_*mes的帖子

git 如何更改我所做的一切的默认分支?

由于 github 将默认分支从 master 更改为 main,所以我的所有推送最终都在一个单独的分支而不是主分支中,并且我无法更改默认值。当我启动一个程序并进行第一次推送时,git 告诉我 main 不存在,我总是必须推送到 master。

git github git-branch

32
推荐指数
2
解决办法
4万
查看次数

PySimpleGUI,如何让字符串在新行上打印而不是切断它?

我正在开发图像查看器,但我注意到在图像查看器中,当要显示的链接太长时,它会被切断。我怎样才能修改这段代码,以便如果字符串太长,它会在新行上打印它。我正在遵循指南,因此您可以查看https://realpython.com/pysimplegui-python/

# img_viewer.py


import PySimpleGUI as sg

import os.path


# First the window layout in 2 columns


file_list_column = [

    [

        sg.Text("Image Folder"),

        sg.In(size=(25, 1), enable_events=True, key="-FOLDER-"),

        sg.FolderBrowse(),

    ],

    [

        sg.Listbox(

            values=[], enable_events=True, size=(40, 20), key="-FILE LIST-"

        )

    ],

]


# For now will only show the name of the file that was chosen

image_viewer_column = [

    [sg.Text("Choose an image from list on left:")],

    [sg.Text(size=(40, 1), key="-TOUT-")],

    [sg.Image(key="-IMAGE-")],

]


# ----- Full layout -----

layout = [

    [

        sg.Column(file_list_column), …
Run Code Online (Sandbox Code Playgroud)

python pysimplegui

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

标签 统计

git ×1

git-branch ×1

github ×1

pysimplegui ×1

python ×1