我发现一个答案如下所示。我只是声明全球变量,其中包含路径,然后在两个名为“ Convertimg”的按钮的另一个函数中访问它。
解决的代码:
from tkinter import *
import tkinter as tk
from PIL import Image, ImageTk
from tkinter import filedialog
import os
import numpy as np
def showImage():
global fln
fln = filedialog.askopenfilename(initialdir= os.getcwd(), title = "Choose Image",
filetypes= (("JPG files", "*.jpg*"), ("all files", "*.*")))
img = Image.open(fln)
img.thumbnail((350,350))
img = ImageTk.PhotoImage(img)
lbl.configure(image= img)
lbl.image = img
root = Tk()
root.title("Browse Image")
root.geometry('300x450')
lbl = Label(root)
lbl.pack()
def convertImg():
fln1 = fln
img = Image.open(fln1)
imageConvert = np.asarray(img)
print(imageConvert)
frm = Frame(root)
frm.pack(side = BOTTOM, padx= 15, pady= 15)
#first button
btn1 = Button(frm, text= "Choose Another Image", command= lambda : showImage())
btn1.pack()
# path = showImage()
# second button
btn2 = Button(frm, text= "Convert Your Selected Image", command= lambda : convertImg())
btn2.pack()
root.mainloop()
在不同的机器上设置我的开发环境时,遇到了同样的问题。
使用NPM运行服务
。它对我有用。
我认为mattabledatasource
对象与您传递给mattabledataSource
构造函数的数据数组链接到某种方式。
例如:
dataTable: string[];
tableDS: MatTableDataSource<string>;
ngOnInit(){
// here your pass dataTable to the dataSource
this.tableDS = new MatTableDataSource(this.dataTable);
}
因此,当您必须更改数据时;在原始列表上更改dataTable
,然后通过call _UPDATECHANGESUBSCRIPEND()
方法tables
反映表上的更改。
例如:
this.dataTable.push('testing');
this.tableDS._updateChangeSubscription();
通过Angular 6与我一起工作。
对我而言,将其添加到&lt;链接中的工作方式如下示例,而不是将其用作CSS文件中的导入URL
<Head>
<link
href='https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap'
rel='stylesheet'
/>
</Head>
您可以使用扩展方法对其进行配置:
var builder = new DbContextOptionsBuilder();
builder.UseSqlServer(connectionString);
configurator.UseEntityFrameworkCoreAuditStore(builder.Options, "AuditTableName");
root@jenkins ~]# vim /usr/local/tomcat/conf/context.xml
添加
<Context>
.....
<Loader jakartaConverter="TOMCAT" />
</Context>
然后在tomcat/bin中
./shutdown.sh
./startup.sh
有趣的是,如果您不断向下看堆栈轨道,您会在底部发现此错误:
Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1005E: Type cannot be found 'String'
如果我将表达式更改为:
th:with="urls=${new java.lang.String[]{'/'}}"
一切都对我有效(用Spring Boot Starter 2.6.7进行了测试)。
查看是否可以进行以下内容并适应您的代码,因为这是接近但不完全想要的。
在DBContext
modelBuilder.HasDefaultSchema("dbo");
扩展方法
public static class EntityHelpers
{
public static string GetTableNameWithScheme<T>(this DbContext context) where T : class
{
var entityType = context.Model.FindEntityType(typeof(T));
var schema = entityType.GetDefaultSchema();
return $"{schema ?? "(unknown)"}.{entityType.GetTableName()}";
}
}
示例中
using var context = new YourContext();
Console.WriteLine(context.GetTableNameWithScheme<YourModel>());
可以作为回调函数需要这样的函数。
假设您的函数看起来像这样:
void do_something(int param1, char *param2, void (*callback)(void))
{
// do something with param1 and param2
callback();
}
此功能接收到随后调用的函数的指针。如果您不需要特别需要将此回调用于任何内容,那么您将传递一个无助的函数:
do_something(3, "test", Nothing);
正如 @ZX8754在注释中建议的那样,您可以使用Intersect
这样的:
cols <- c('a','b', 'v')
output <- datf[intersect(names(datf), cols)]
output
输出:
a b
1 1 4
2 2 3
3 3 4
.App {
background-color: rgb(24, 24, 35);
height: 100vh;
width: 100vw;
display: flex;
}
.innerBox{
width: 600px;
height: 300px;
background-color: red;
margin: auto;
display: flex;
flex-direction: row;
}
.menu{
background-color: blue;
height: 60px;
width: 300px;
text-align: center;
}
.content
{
background-color: orange;
height: 60px;
text-align: center;
width: 300px;
}
/* add This Class*/
.innerBoxContent{
display:flex;
aling-item:center;
justify-content:center;
}
import logo from "./logo.svg";
import "./App.css";
function App() {
return (
<div className="App">
<div className="innerBox">
<div className="innerBoxContent">
<div className="menu">
<h1>Menu</h1>
</div>
<div className="content">
<h1>content</h1>
</div>
</div>
</div>
</div>
);
}
export default App;
根据 https://github.com/phpmentors-jp/workflower/blob/blob/master/docs/quick-start-guide.md#workflow-elements-supported-by-workflower phpmentor Workflow Workflow Workflow workflow snot Snot Snot Swot Supporcesses。
打开位于Laravel项目根部中的
.env
文件,并更新数据库配置以使用mySQL:主要修改是修改sqllite
sqllite tomysql
编写命令:PHP Artisan迁移
Open the
.env
file located in the root of your Laravel project and update the database configuration to use MySQL: The main modification is modifyingsqllite
tomysql
and write the command:php artisan migrate
Laravel Sqlite数据库不存在