Search code examples
pythontranscrypt

How to make Transcrypt skip a line (without "try")?


The program I write should be able to run both directly via the interpreter and via Transcrypt. The problem is that I need to skip some lines when Transcrypt is running and "try" does not work in Transcrypt. Is there any other way to skip lines when running the program via Transcypt? Is it possible to use if ?:

if transctypt is activated:

Thanks in advance!


Solution

  • Thanks to the fzzylogic's comment I solved the problem like this:

    from org.transcrypt.stubs.browser import __pragma__
    
    #__pragma__('skip')
    import subprocess
    import os
    #__pragma__('noskip')