Hướng dẫn what does restart mean python? - khởi động lại python có nghĩa là gì?

Tôi có một kịch bản đơn giản mà tôi đã viết, và khi cố gắng chạy nó (F5), tôi nhận được MSG này:

================== Khởi động lại: C: \ Người dùng \ *** \ Desktop \ tst.py ========================== ==

Tôi đã khởi động lại shell, mở lại kịch bản, nhưng vẫn vậy, cùng một tin nhắn xuất hiện. Tôi sử dụng Python 3.5.1 và tôi đã cố gắng đơn giản hóa tập lệnh càng nhiều càng tốt, nhưng tôi vẫn nhận được kết quả này. Bây giờ tập lệnh của tôi chỉ là một dòng có lệnh print(1) đơn giản và tôi vẫn nhận được tin nhắn này.

Có điều gì đó sai với việc cài đặt shell?

Hướng dẫn what does restart mean python? - khởi động lại python có nghĩa là gì?

hỏi ngày 28 tháng 7 năm 2016 lúc 5:07Jul 28, 2016 at 5:07

Hướng dẫn what does restart mean python? - khởi động lại python có nghĩa là gì?

CisforcookiescisforcookiesCIsForCookies

Huy hiệu vàng 11.5k853 Huy hiệu bạc109 Huy hiệu đồng8 gold badges53 silver badges109 bronze badges

8

Tôi có một kịch bản đơn giản mà tôi đã viết, và khi cố gắng chạy nó (F5)

Đó là phím nóng cho Idle để chạy một tập tin. Nó không ra lệnh để làm bất cứ điều gì. Đó là một tuyên bố nhật ký để tuyên bố rõ ràng rằng không gian tên của bạn đang bị xóa và tệp sẽ được chạy mới trở lại.

Không, tôi không bảo nó khởi động lại

Nhưng bạn đã làm ... bạn đã nhấn f5

Đã trả lời ngày 28 tháng 7 năm 2016 lúc 5:18Jul 28, 2016 at 5:18

OneCricketeerOneCricketeerOneCricketeer

163K18 Huy hiệu vàng122 Huy hiệu bạc225 Huy hiệu Đồng18 gold badges122 silver badges225 bronze badges

5

Điều tương tự đang xảy ra với vỏ của tôi. Trong các phiên bản cũ hơn, điều này không xảy ra. Tôi cũng nhận thấy rằng khi tôi nhấn các tài liệu mô -đun Python 3.5.2, tôi sẽ mở trình duyệt internet của mình và tôi thấy thư mục của tôi được hiển thị trên màn hình. Nó có vẻ như:

C: \ Users \ MyComputerName \ AppData \ Local \ Programs \ Python \ Python35-32 \ DLLS.

Điều đó có phải là xảy ra không? Đó có được bảo mật không? Tôi không biết.

Tôi cũng thấy rằng điều này in ra bất cứ khi nào tôi "nhập" một cái gì đó. Vì vậy, nếu tôi sử dụng một lệnh nhập và đặt nó ngay trước dòng tên ngẫu nhiên của tôi, nó sẽ in ra thứ "khởi động lại" đó. Nó luôn luôn ở đầu. Hoặc những gì nó đọc như là sự khởi đầu.

Đã trả lời ngày 10 tháng 8 năm 2016 lúc 8:23Aug 10, 2016 at 8:23

Cisforcookies, tôi đoán là bạn không thực sự có một kịch bản hoàn chỉnh; Có thể bạn chỉ có một định nghĩa chức năng và bạn chưa bao gồm một dòng để chạy chức năng đó. (Tôi đã gặp vấn đề này và sau đó nhớ gọi chức năng tôi đã xác định; vấn đề đã biến mất.)

Đã trả lời ngày 28 tháng 8 năm 2019 lúc 14:32Aug 28, 2019 at 14:32

Hướng dẫn what does restart mean python? - khởi động lại python có nghĩa là gì?

Bạn có thể đã phạm sai lầm tương tự như tôi và chạy một chương trình và sau đó bạn tự hỏi tại sao khởi động lại là tất cả những gì hiển thị. Chương trình của tôi hoạt động hoàn hảo, tôi chỉ không in bất cứ thứ gì hoặc yêu cầu bất kỳ đầu vào nào để nó chạy và được thực hiện với chương trình và không có gì hiển thị.

Đã trả lời ngày 13 tháng 11 năm 2020 lúc 15:25Nov 13, 2020 at 15:25

Hướng dẫn what does restart mean python? - khởi động lại python có nghĩa là gì?

Cross! Alex21

Tin nhắn: + MSG3226902018-07-28 10:59 by Cross!Alex21, last changed 2022-04-11 14:59 by admin. This issue is now closed.

2018-07-30 & NBSP; 17: 22: 15
Terry.reedyTác giả: Aleksa Bulatovic (Cross! Alex21)Tin nhắn: + MSG322680
2018-07-30 & NBSP; 09: 15: 50
Tin nhắn: + MSG3226612018-07-30 & NBSP; 04: 15: 06*Trạng thái: Mở -> đóng: Hành vi: + MSG322649
First off, no judgment! :)

I just want to get some more details from you. 
1) How are you running your program?
2) How far into your program do you get?
3) What are you passing in as values for your Input() calls?
MSG322614 - (Xem)Tác giả: Aleksa Bulatovic (Cross! Alex21)Ngày: 2018-07-29 08:32
Im running as a idle python(when im in editor,i run the module)
I get like in 3 days(if you asked when did i get into the program,english is not my first language)
For my input calls i put a string so that player knows what to answer to.
I hope i answered your questions for details.(I don't understand some things when someone says like '	PyArg_ParseTupleAndKeywords' or something like that,im 12 year old so i don't understand some issues)
MSG322630 - (Xem)Tác giả: Steve Dower (Steve.Dower) **
Hướng dẫn what does restart mean python? - khởi động lại python có nghĩa là gì?
Ngày: 2018-07-29 11:23
Maybe you could describe what it looks like when it restarts? Or take a screenshot and share it so we can see what is happening?
MSG322649 - (Xem)Tác giả: Terry J. Reedy (Terry.reedy) **
Hướng dẫn what does restart mean python? - khởi động lại python có nghĩa là gì?
Ngày: 2018-07-30 04:15
In IDLE, Run Module, F5, is a shortcut, in a sense, for saving the file to filename, switching to a terminal or console window, such as Command Prompt on Windows, and entering 'python -i filename'.  The -i means 'switch it interactive mode after running the file'.  When you are done, and close the window, you can switch back to the editor.

The IDLE Shell more-or-less simulates Python's interactive mode.  When you hit F5, a separator line is added, like 
=================== RESTART: F:\Python\a\tem.py =====================
to indicate that Shell reinitialized itself and is now running your program.  This is completely normal and intended.  When your program finishes, Shell will display '>>> '.

Please try to read the IDLE doc, which is available on the Help menu as 'IDLE Help'.  You can ask about using Python and IDLE on python-list.   Always mention the Python version and operating system you are using.

You program has a bug.  In the 'else' section, it tries to print q1 without q1 being defined.

If a program has a severe bug that caused the Python executing your code to crash, Shell will restart with a line that does not have a filename, like
======================== RESTART ========================
This is hard to bring about and is also not an IDLE bug.
MSG322661 - (Xem)Tác giả: Aleksa Bulatovic (Cross! Alex21)Ngày: 2018-07-29 08:32
Im running as a idle python(when im in editor,i run the module)
I get like in 3 days(if you asked when did i get into the program,english is not my first language)
For my input calls i put a string so that player knows what to answer to.
I hope i answered your questions for details.(I don't understand some things when someone says like '	PyArg_ParseTupleAndKeywords' or something like that,im 12 year old so i don't understand some issues)
MSG322630 - (Xem)Tác giả: Terry J. Reedy (Terry.reedy) **
Hướng dẫn what does restart mean python? - khởi động lại python có nghĩa là gì?
Ngày: 2018-07-30 04:15
In IDLE, Run Module, F5, is a shortcut, in a sense, for saving the file to filename, switching to a terminal or console window, such as Command Prompt on Windows, and entering 'python -i filename'.  The -i means 'switch it interactive mode after running the file'.  When you are done, and close the window, you can switch back to the editor.

The IDLE Shell more-or-less simulates Python's interactive mode.  When you hit F5, a separator line is added, like 
=================== RESTART: F:\Python\a\tem.py =====================
to indicate that Shell reinitialized itself and is now running your program.  This is completely normal and intended.  When your program finishes, Shell will display '>>> '.

Please try to read the IDLE doc, which is available on the Help menu as 'IDLE Help'.  You can ask about using Python and IDLE on python-list.   Always mention the Python version and operating system you are using.

You program has a bug.  In the 'else' section, it tries to print q1 without q1 being defined.

If a program has a severe bug that caused the Python executing your code to crash, Shell will restart with a line that does not have a filename, like
======================== RESTART ========================
This is hard to bring about and is also not an IDLE bug.
MSG322661 - (Xem)Tác giả: Aleksa Bulatovic (Cross! Alex21)Ngày: 2018-07-30 09:15
Well the error looks like this

===== RESTART: F:\Python Shell Learning\Games\How smart are you Test.py =====
i think it's normal but it won't show '>>> '.I will see what i can do,but thanks for some help.
MSG322680 - (Xem)
Ngày: 2018-07-30 17:22
Again, that RESTART line is NOT an error.  IDLE's prompt is not displayed until your program is completely done.  It initially pauses on the second line 'check = input()', waiting for user input.

Start with a one-line file:

print('Hello to my game')

Run that and you will see the prompt.
MSG322690 - (Xem)Ngày: 2018-07-30 20:25
Thanks Terry J. ReedyTerry.
Lịch sửbộGitHub: 78439
2018-07-30 & NBSP; 20: 25: 48Cross! Alex21bộTin nhắn: + MSG322690
2018-07-30 & NBSP; 17: 22: 15Terry.reedybộTin nhắn: + MSG322680
2018-07-30 & NBSP; 09: 15: 50Cross! Alex21bộTin nhắn: + MSG322690
2018-07-30 & NBSP; 17: 22: 15Terry.reedybộTin nhắn: + MSG322680
type: behavior
messages: + msg322649

2018-07-30 & NBSP; 09: 15: 50
stage: resolved

Tin nhắn: + MSG3226612018-07-30 & NBSP; 04: 15: 06bộTrạng thái: Mở -> đóng: Hành vi: + MSG322649
messages: + msg322630

Độ phân giải: Không phải là một lỗi: Đã giải quyết
components: + IDLE

2018-07-29 & NBSP; 11: 23: 01Cross! Alex21bộTin nhắn: + MSG322690
2018-07-30 & NBSP; 17: 22: 15Terry.reedybộTin nhắn: + MSG322680
messages: + msg322606
2018-07-30 & NBSP; 09: 15: 50Cross! Alex21Tin nhắn: + MSG322690

2018-07-30 & NBSP; 17: 22: 15

Terry.reedycreate a new instance of the process with the same configuration and then call the start() function. Now that we know we cannot restart a process but must instead re-create and start a new process, let's look at some worked examples.

Tin nhắn: + MSG322680

2018-07-30 & NBSP; 09: 15: 50your script has been restarted.