重用路径到函数 - 转义字符

时间:2016-07-18 13:42:47

标签: python python-2.7 string-formatting

我试图弄清楚如何重用import javafx.application.Application; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.ButtonType; import javafx.scene.control.CheckBox; import javafx.scene.control.Dialog; import javafx.scene.control.DialogPane; import javafx.scene.control.Label; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; import javafx.stage.Stage; public class CustomDialogPaneTest extends Application { @Override public void start(Stage primaryStage) { Button button = new Button("Show Dialog"); button.setOnAction(e -> { DialogPane pane = new DialogPane() { @Override public Node createButtonBar() { VBox vbox = new VBox(5); vbox.setAlignment(Pos.BOTTOM_RIGHT); vbox.setPadding(new Insets(5)); vbox.getChildren().add(super.createButtonBar()); vbox.getChildren().add(new Label("Additional text")); return vbox ; } }; CheckBox checkBox = new CheckBox("A check box"); pane.setContent(checkBox); pane.setHeaderText("The header"); pane.getButtonTypes().addAll(ButtonType.YES, ButtonType.NO); Dialog<ButtonType> dialog = new Dialog<>(); dialog.setDialogPane(pane); dialog.showAndWait().ifPresent(System.out::println); }); StackPane root = new StackPane(button); root.setPadding(new Insets(20)); primaryStage.setScene(new Scene(root)); primaryStage.show(); } public static void main(String[] args) { launch(args); } } os.getcwd()的路径,使用dict.pop() call语句将生成的相同格式的路径(Python 2.7):< / p>

print

所以,我只想在import os import pysvn import sys def svnGetExternals(): directory = os.getcwd() # (C:\Development\test\) print directory # prints "C:\Development\test\" client = pysvn.Client() svnExternals = client.propget('svn:externals', directory) # returns a dictionary svnExternalList = svnExternals.pop(directory).split('\n') # returns: KeyError: 'C:\\Development\\test' 电话中使用'C:\Development\test'

0 个答案:

没有答案