Batch stops running when running `pythonw xx.py`

Spaceship222

I try to write some batch that can autorun my python scripts.Here is my batch file:

@echo off
:: do something here
pythonw xx.py
rem run python script in the backgroud
rem but batch stops here, doesn't run the rest code
:: do something else again

So how can I fix this. Any help will be appreciated!
Related question:
Running Python Script as a Windows background process

martineau

You should be able to get the batch file to keep running by executing the Python script using Windows start command.

So in your case the batch file should look something like:

@echo off
:: do something here
rem Run python script in the backgroud
start "title" /b pythonw xx.py
:: do some more stuff...

Este artigo é coletado da Internet.

Se houver alguma infração, entre em [email protected] Delete.

editar em
0

deixe-me dizer algumas palavras

0comentários
loginDepois de participar da revisão

Artigos relacionados

TimerTask stops running after midnight

O lote para de ser executado ao executar `pythonw xx.py`

Batch File Infinitely Running

Crontab is not running properly with .py

the system cannot find the path specified when running batch file

How to access a remote datastore when running dev_appserver.py?

Recieving errors when running server with manage.py

Running Plink in a Windows Batch - Issues

Batch Norm - Extract Running Mean & Running Variance in TensorFlow

Printing output of python script to Windows console, when running via batch file

Console app only terminates when holding key down while running batch script

How to make it so that matplotlib graph titles are included in window when running .py file in Anaconda prompt

Check if PowerShell script is running using batch script

Running Batch Script on remote Server via PowerShell

Running multiple windows commands using batch file

Keep running batch loop after starting .exe

Adding mysqli_connect() function stops running the script

Spring Boot KafkaListener stops consuming messages after running some time

IIS stops responding to requests until restart after running this method

Import error while running py.test

Running sqlcmd in batch file works but running the same batch file as a scheduled task works and does nothing

NoSuchFileException when running jar file

AndroidHttpClient not found (when running Robolectric)

Function running when it shouldn't

Blank screen when running and no errors

ModuleNotFoundError when running paga with scanpy

Ubuntu error when running Virtualbox

Service not running when application exits

Junit5 and Instrumentation Tests running when running unit tests

TOP lista

  1. 1

    R Shiny: use HTML em funções (como textInput, checkboxGroupInput)

  2. 2

    O Chromium e o Firefox exibem as cores de maneira diferente e não sei qual deles está fazendo certo

  3. 3

    Como assinar digitalmente um documento PDF com assinatura e texto visíveis usando Java

  4. 4

    R Folheto. Dados de pontos de grupo em células para resumir muitos pontos de dados

  5. 5

    Gerenciar recurso shake de Windows Aero com barra de título personalizado

  6. 6

    Como obter dados API adequados para o aplicativo angular?

  7. 7

    UITextView não está exibindo texto longo

  8. 8

    Por que meus intervalos de confiança de 95% da minha regressão multivariada estão sendo plotados como uma linha de loess?

  9. 9

    Acessando relatório de campanhas na AdMob usando a API do Adsense

  10. 10

    Usando o plug-in Platform.js do Google

  11. 11

    Como posso modificar esse algoritmo de linha de visada para aceitar raios que passam pelos cantos?

  12. 12

    Dependência circular de diálogo personalizado

  13. 13

    Coloque uma caixa de texto HTML em uma imagem em uma posição fixa para site para desktop e celular

  14. 14

    iOS: como adicionar sombra projetada e sombra de traço no UIView?

  15. 15

    Como usar a caixa de diálogo de seleção de nomes com VBA para enviar e-mail para mais de um destinatário?

  16. 16

    Tabela CSS: barra de rolagem para a primeira coluna e largura automática para a coluna restante

  17. 17

    How to create dynamic navigation menu select from database using Codeigniter?

  18. 18

    Converter valores de linha SQL em colunas

  19. 19

    ChartJS, várias linhas no rótulo do gráfico de barras

  20. 20

    用@StyleableRes注释的getStyledAttributes。禁止警告

  21. 21

    não é possível adicionar dependência para com.google.android.gms.tasks.OnSuccessListener

quentelabel

Arquivo