when I execute my code, it causes the execution window to open up and close instantly. Note that this is prior to execution of my programme, as the several inputk=input("blablabla") I have in my code don't show up before the window closes.
I ask for advice on what is happening.
Related
I'm trying to test out if the compiled rust program is portable but the window immediately closes. Opening the program in a terminal in vs code doesn't immediately close the program but waits for you to enter any key before closing. Is there a function or any code that would make it act like that?
Opening the program in a terminal in vs code doesn't immediately close the program but waits for you to enter any key before closing.
I'd guess that's just the vscode behaviour. Immediately closing the window is the normal behaviour for a program terminating.
Is there a function or any code that would make it act like that?
Reading from stdin usually does the trick.
Whenever I run any turtle code, the code runs correctly but the window that opens does not respond after the code is executed and it crashes.
How do I fix it? Please help!
my original question posted
Simulate Double Click Event in IE EXCEL , VBA interaction
.
You said,
this is a deadlocks for me because 1) i trigger the prompt from excel
to retrieve data from server 2) the server is stop responding until
prompt is being dismissed 3) all codes coded to handle prompt not
being processed because excel still waiting for the #1 to complete
I made a tests with some suggestions in older threads, but nothing worked.
References of those older threads.
(1) Disable Alert message of a webpage using VBA code (Refer the second answer)
(2) vba to dismiss an IE8 or IE9 "message from webpage" popup window
The thing is that, VBA code execution get stops when IE display the Alert() message. As code execution is already stopped we are not able to handle the Alert() prompt using code. So user need to close the Alert() prompt manually which resumes the code execution.
For simplicity in testing, if you just try to create an IE object and display the prompt and put some other lines of code after the prompt than you will notice that execution of code get stopped when prompt get displayed and until you close the prompt manually further lines of code will not get execute.
I agree with the suggestion given by the Zhi Lv - MSFT in your referenced thread for using the Selenium Web driver.
It can be the easiest solution for this issue.
References:
(1) Selenium Web Driver
(2) Selenium handle alerts prompts confirmation popups
I'm trying to use the ocaml graphics module.
The line:
#Graphics.open_graph "";;
works fine in the interactive module, i.e. a small window pop up in X11 with white background.
However, when I try to use the script mode -- put this line in a file then compile it:
ocamlc -o a.out graphics.cma code.ml
only X11 starts but with no window popup.
Am using a mac. Anyone knows why? Thanks.
Followup:
It seems under script mode the popup window will closeup immediately after code execution. Because if I compile using XTerminal, I can see a small window popup but then closes.
I managed to keep the window open by adding an infinit loop at the bottom:
while true do () done;;
But still don't understand how things really work. Please help. Thanks.
All ressources are freed when the script terminates: memory, file descriptors, including the X window.
If you add an infinite loop, the script does not terminates, and the windows stays open.
Likewise, under the toplevel, the window stays open as long as you don't close the toplevel.
I would suggest to add two lines add the end of your script:
print "press enter to exit"
read one line from keyboard input
This way the script will not terminate until the user presses enter.
Indeed, as jrouquie explains you need to delay the termination of your program. The way I personally do that is by waiting on user input. At the end of the interactive program (or function being studied that opens the graphic mode), I put:
ignore (Graphics.read_key ())
This will wait until a key has been hit on the keyboard, and ignore the key value before returning.
I am running a big python script on a bash terminal. The problem is that everytime I use Alt+Tab or click outside the terminal into another windows (Say, google-chrome), the program stops execution. Then I need to put the terminal back in focus by clicking inside it to resume execution. This keeps happening all the time.
What could be wrong?