Python Turtle:如何打开绘图

时间:2016-07-17 07:31:59

标签: python graphics tkinter drawing turtle-graphics

我有一个在[EL Warning]: 2016-07-17 11:42:32.584--ClientSession(1851088021)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java.sql.SQLException: Field 'code' doesn't have a default value Error Code: 1364 Call: INSERT INTO branch (id, provinceId) VALUES (?, ?) bind => [2 parameters bound] Query: DataModifyQuery(name="branches" sql="INSERT INTO branch (id, provinceId) VALUES (?, ?)") 2016-07-17 11:42:32.627 ERROR 2172 --- [nio-9099-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.transaction.TransactionSystemException: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java.sql.SQLException: Field 'code' doesn't have a default value Error Code: 1364 Call: INSERT INTO branch (id, provinceId) VALUES (?, ?) bind => [2 parameters bound] Query: DataModifyQuery(name="branches" sql="INSERT INTO branch (id, provinceId) VALUES (?, ?)")] with root cause java.sql.SQLException: Field 'code' doesn't have a default value 小部件上绘制乌龟的项目。我已经知道如何保存图纸但是如何打开它们。这是我试图说的一个例子:

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@NotNull
private Long code;
@NotBlank
private String title;
@NotNull
private Long provinceId;
@NotBlank
private String grade;
private Long versionId;

1 个答案:

答案 0 :(得分:0)

supported库包含图像数据的PostScript文件格式为PIL。所以你可以像这样打开你的海龟.ps文件:

import PIL

# Load the .ps file using PIL
ps_file = PIL.Image.open("turtle_file.ps")
ps_turtle = PIL.ImageTk.PhotoImage(ps_file)
...
...
# Let us suppose you want to display it on a label
label = Label(image=ps_turtle)
label.image = ps_turtle # keep a reference
label.pack()