我的图片位置:
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QFileDialog
from config_assign_ui import Ui_ConfigAssign
import pyodbc
import pandas as pd
class Main(QtWidgets.QMainWindow):
#class Window(Ui_ConfigAssign):
def __init__(self):
Ui_ConfigAssign.__init__(self)
self.setupUi(self)
self.combo_list()
self.ImportMapButton.clicked.connect(lambda: self.import_map())
def combo_list(self):
self.customerlistbox.clear()
conn = pyodbc.connect(
r'DRIVER={ODBC Driver 13 for SQL Server};'
r'SERVER=server;'
r'DATABASE=db;'
r'Trusted_Connection=yes;'
)
querystring = """SELECT CustomerName FROM [table]
WHERE Column = 'Active' ORDER BY Column"""
cursor = conn.cursor()
cursor.execute(querystring)
customerlist = []
# Dump results into a list called customerlist
customerlist = [row[0] for row in cursor.fetchall()]
for i in customerlist:
self.customerlistbox.addItem(str(i))
def import_map(self):
name = QtGui.QFileDialog.getOpenFileName(self, "Open CSMConfig Map...", "T:\\Drive\",
"Worksheets (*.xlsx,*.xlsm,*.xlsb,*.xls)")
file = open(name, 'r')
with file:
xl = pd.ExcelFile(file)
df = xl.parse('Sheet1')
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
window = Main()
window.show()
sys.exit(app.exec_())
我的PHP代码:
public_html/storage/app/public/img
图像不显示。任何人都请帮助我。
答案 0 :(得分:0)
根据Laravel 5.2文档,您的公开文件应放在目录中
存储/应用/公共
要使其能够从网络上访问,您应该创建从 public / storage 到 storage / app / public
的符号链接ln -s /path/to/laravel/storage/app/public /path/to/laravel/public/storage
在视图中使用资产助手创建指向文件的URL:
echo asset('storage/app/public/img/$product->image');
答案 1 :(得分:0)
使用工匠命令为存储目录创建符号链接
php artisan storage:link
您可以通过url辅助程序(例如 -> url('存储/应用/公共/ img / $ product->图像')