Click here to Skip to main content
15,847,077 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When i called listDisk method from the class Diskpart class i will get exception "
template = result.split("\n")[0]

integer Cant split

how to resolve this issue

What I have tried:

python-diskpart/ at 5e63cddcec39b163944faf9365d393a43ea866b4 · Duoquote/python-diskpart · GitHub[^]
Updated 3-Feb-23 2:18am

The error message means what it says: You can't call split on an integer value.

split works on strings: Python String split() Method[^] So you need to look at your code and work out what exactly you are trying to do.

I'm not wading through unknown sized python code trying to work out where the error message comes from and what result contains or which variable you should be using: if you want us to look at code post the relevant code fragment(s) in the question rather than dumping a github project on us.
Share this answer
HelpMewithCode 3-Feb-23 6:52am    
Original but atleast you can get me idea right
How to integrated windows diskpart with Python
Richard MacCutchan 3-Feb-23 7:19am    
Which is what I told him yesterday.
OriginalGriff 3-Feb-23 7:21am    
Ah. Not a quick learner then ... :sigh:
I told you what you needed to do yesterday in your original question on this subject: How to integrated diskpart with Python[^]. Please do not repost the same question.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900