我对 Python 和 Azure Web 应用程序相当陌生。任何帮助表示赞赏。
我的设置:
在我的代码中,我使用它pyodbc来连接到 Azure SQL DB。代码在终端本地成功运行。然而,当它在Web上运行时,遇到以下错误:
Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 17 for SQL Server' : file not found (0) (SQLDriverConnect)")
我遵循了几篇故障排除帖子,但是没有成功。
我尝试使用 $sudo ln 创建符号链接,导致权限被拒绝。我认为这是 Azure Web 应用程序的一个已知限制。
我尝试在 etc/odbcinst.ini 中查找驱动程序以查看驱动程序名称是否存在,但是,我对 Azure / VS Code 非常陌生,所以我什至不知道如何打开等/中的文件文件夹。当我导航到 etc/ 文件夹时,我确实在 BASH 命令提示符中看到它,但不确定如何打开该文件。
BASH我在安装中运行了以下命令PYODBC,但这并没有解决问题。
python -m pip install …Run Code Online (Sandbox Code Playgroud) 如果您回答我关于 WebAssembly 多线程的问题,我将不胜感激。我想用 2 个线程(主线程和辅助线程)实现代码,这样就有一个全局变量用作辅助线程中的计数器变量,并在循环中递增它。和主线程,读取计数器变量,一次在运行指令之前,一次在运行指令之后(测量完成该指令所需的时间)。我已经实现了这个代码:
#include "pthread.h"
#include <stdio.h>
#include <unistd.h>
#include<chrono>
int i;
int counter;
void* timerfunction( void *ptr)
{
printf ("Thread Timer!\n");
//cout<<"Thread Timer!"<<endl;
while(1)
{
counter=counter+1;
}
pthread_exit("The thread was exited!");
}
int main()
{
pthread_t thread_id;
void *thread_result;
int c=0;
int l=pthread_create(&thread_id,NULL,timerfunction,&c);
int t1= counter;//reading the counter for the first one
//intended instruction that we want to measure its execution time
int t2= counter;//reading the counter for the second one
int t3 = t2 - t1;//computing …Run Code Online (Sandbox Code Playgroud) 我的代码是:
from PIL.ExifTags import *
from PIL import Image
import sys
import os
import glob
import time
image_fileList = []
mainFolder = 'C:' + chr(92) + 'Users' + chr(92) + 'aa\Desktop\ToDigitalFrame\To select from'
folderList = [x[0] for x in os.walk(mainFolder)]
print(folderList)
def saveImage(imgName):
imgName.save('rotated.jpg')
for folder in folderList:
print(folder)
for image_file in glob.glob(folder + '/*.jpg'):
print(image_file)
if not os.path.isfile(image_file):
sys.exit("%s is not a valid image file!")
img = Image.open(image_file)
info = img._getexif()
exif_data = {}
if info:
for (tag, value) …Run Code Online (Sandbox Code Playgroud) azure ×1
docker ×1
emscripten ×1
exif ×1
linux ×1
python ×1
python-3.x ×1
rotation ×1
save ×1
wasm-bindgen ×1
webassembly ×1