Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Error reporting solution and experience summary of Python programming source code

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This issue of the content of the editor will bring you about Python programming source code error solutions and experience summary, the article is rich in content and professional analysis and description for you, after reading this article, I hope you can get something.

I. Preface

Recently Ben is happy to turn on the computer and write some ancestral BUG.

But an error hindered my progress in writing BUG!

Are there any mistakes that can prevent me from writing BUG in this day and age?

Second, the process of solution

A new project needs to be certified by token, so copy the original project code

Yes, the senior CV engineer is me!

After adding some token configuration information, start the project and prepare for debugging.

The startup was successful without any errors.

Then start the front-end project to start a day of writing BUG time!

As a result, I made a mistake when I logged in!

Will you report an error if you copy the code of the previous project?

It's a little weird, but it's all a little scene!

Start debugging

As a result, when I looked at the error log, I panicked!

It is an error reported within restframework (third-party package)!

If you report an error in your own code, you can also troubleshoot the cause according to which line of error and error message (usually your own code error is corrected in seconds)

The third package of internal errors reported, if there is no obvious error prompt troubleshooting will take some time!

A little flustered!

Error log analysis does not provide any useful information for the time being!

Jump to the third package of source code inside, still do not see why the error!

After debugging, it is confirmed once again that it has not entered my method.

Then Baidu Dafa roughly locates the problem through Baidu.

Test = (1) for i in test: print (I)

Non-iterative errors will be reported when the above code is executed

Test= (1), the type of test is not a tuple

Instead, 1 is assigned directly to test, and at this time test is equal to 1.

That's why non-iterating errors are reported when iterating over test!

To define a tuple, you should define it like this: test = (1,)

At this point, test is an iterative object.

Think of the initial changes to the configuration file of django, go back to check

Sure enough! There's a comma missing!

After adding, the problem is solved!

The error itself is very simple, just start the source code error report so that I do not have a solution!

Still too little experience!

I believe I will work for another 100 years and borrow another 500 years from heaven!

If you encounter similar problems, you can quickly locate and solve them!

The above is the error solution and experience of Python programming source code shared by Xiaobian. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report