You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
663 B
25 lines
663 B
// 定位可用的 Python(WindowsApps stub 可能无效)+ 检查 pymysql
|
|
import { existsSync, readdirSync } from 'node:fs';
|
|
|
|
const candidates = [
|
|
'E:/python.exe',
|
|
'E:/Scripts',
|
|
'C:/Python311/python.exe',
|
|
'C:/Python312/python.exe',
|
|
'C:/Python38/python.exe',
|
|
'C:/Users/Administrator/AppData/Local/Programs/Python',
|
|
'C:/Program Files/Python311',
|
|
'C:/Program Files/Python312',
|
|
];
|
|
|
|
for (const d of candidates) {
|
|
if (existsSync(d)) {
|
|
try {
|
|
console.log('EXISTS ' + d + ' -> ' + readdirSync(d).slice(0, 15).join(' | '));
|
|
} catch (e) {
|
|
console.log('EXISTS ' + d + ' (dir)');
|
|
}
|
|
} else {
|
|
console.log('MISS ' + d);
|
|
}
|
|
}
|
|
|