Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spider
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
selection-new
spider
Commits
7597ea9f
Commit
7597ea9f
authored
Dec 29, 2025
by
Peng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
11ee49af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
0 deletions
+66
-0
start_1688.vbs
py_spider/amazon_spider/start_1688.vbs
+66
-0
No files found.
py_spider/amazon_spider/start_1688.vbs
0 → 100644
View file @
7597ea9f
logFile
=
"D:\\python\\start_python.log"
Sub
writeLog
(
msg
)
Dim
fso
,
logStream
,
mode
Set
fso
=
CreateObject
(
"Scripting.FileSystemObject"
)
' 不存在就覆盖创建(2),存在就追加(8)
If
fso
.
FileExists
(
logFile
)
Then
mode
=
8
Else
mode
=
2
End
If
Set
logStream
=
fso
.
OpenTextFile
(
logFile
,
mode
,
True
,
-
1
)
' -1 UTF-16
logStream
.
WriteLine
Now
&
" "
&
msg
logStream
.
Close
End
Sub
Function
isProcessExists
(
strExeName
)
On
Error
Resume
Next
strComputer
=
"."
Set
wbemServices
=
GetObject
(
"winmgmts:\\"
&
strComputer
)
Set
wbemObjectSet
=
wbemServices
.
InstancesOf
(
"Win32_Process"
)
isProcessExists
=
False
For
Each
wbemObject
In
wbemObjectSet
namedata
=
wbemObject
.
Name
exeFileName
=
strExeName
&
".exe"
If
exeFileName
=
namedata
Then
isProcessExists
=
True
Exit
Function
' 找到后直接退出
End
If
Next
End
Function
Call
startPythonScript
(
"python"
,
"D:\python\alipay_account_order.py"
)
Function
startPythonScript
(
pyProcName
,
scriptPath
)
writeLog
"检查进程: "
&
pyProcName
isRunning
=
isProcessExists
(
pyProcName
)
If
isRunning
=
False
Then
writeLog
"NO python 未发现 python,准备启动脚本 start ,: "
&
scriptPath
runPythonScript
(
scriptPath
)
Else
writeLog
"is python True 已存在,跳过启动"
End
If
End
Function
Function
runPythonScript
(
scriptPath
)
On
Error
Resume
Next
Dim
objShell
Set
objShell
=
CreateObject
(
"Wscript.Shell"
)
cmd
=
"python
""
"
&
scriptPath
&
"
""
"
writeLog
"python alipay_account_order .py 执行命令 "
&
cmd
objShell
.
Run
cmd
,
0
If
Err
.
Number
=
0
Then
writeLog
"启动 start"
Else
writeLog
"err 报错: "
&
Err
.
Description
End
If
End
Function
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment