![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
|
Listing HD's
Hey, i was wondering if anybody could point in the right direction. Ie give me the name of modules and links to module listing etc for a method of listing what HD's a computer, under WinXP.
Thanks, Chris
__________________
Who said i couldn't program sarcasm = raw_input('Type in a sarcastic remark: ')
|
|
|
|
|
|
#2 |
|
Hobbyist Programmer
|
Re: Listing HD's
Is there a way of doing this properly or would i have to do something like this
Python Syntax (Toggle Plain Text)
So is that how i will have to do it, or is there an actual method to do that for you? Chris
__________________
Who said i couldn't program sarcasm = raw_input('Type in a sarcastic remark: ')
|
|
|
|
|
|
#3 |
|
Newbie
Join Date: May 2008
Location: teh interwebz
Posts: 22
Rep Power: 0
![]() |
Re: Listing HD's
well I don't have a solution for you, but one thing worth mentioning about the way you have it done is this: every single drive that has a letter will be shown as present. This includes mapped drives, optical drives etc.
EDIT: I found the below link that may help, but it seems as if you have to have a 3rd party module to do it, because when i tried it it gave an error about win32file http://mail.python.org/pipermail/pyt...ay/324479.html Also instead of listing out all the drives like that in one huge array, you could just do the following if you like it better: python Syntax (Toggle Plain Text)
__________________
iEngage |
|
|
|
|
|
#4 |
|
Hobbyist Programmer
|
Re: Listing HD's
Indeed this is a 3rd party module which is not what im after, and yes im aware that the solution i use will show all drives, this is in actual fact how i would like it. You have to bare in mind in only shows drives in use not blank CD drives etc. And again mapped network drives are also wanted.
Chris
__________________
Who said i couldn't program sarcasm = raw_input('Type in a sarcastic remark: ')
|
|
|
|
|
|
#5 |
|
Newbie
Join Date: May 2008
Location: teh interwebz
Posts: 22
Rep Power: 0
![]() |
Re: Listing HD's
well then in that case your solution seems to be the way to go
__________________
iEngage |
|
|
|
|
|
#6 |
|
Hobbyist Programmer
|
Re: Listing HD's
yes and ising string is the better option, i don't know why i didn't do that in the first place lol. O well thanks for reminding me. i May look int WMI (although it is an extra module) aparently has some functionality that could be of use to me.
Chris
__________________
Who said i couldn't program sarcasm = raw_input('Type in a sarcastic remark: ')
|
|
|
|
|
|
#7 |
|
Newbie
Join Date: May 2008
Location: teh interwebz
Posts: 22
Rep Power: 0
![]() |
Re: Listing HD's
__________________
iEngage |
|
|
|
|
|
#8 | |
|
Professional Programmer
Join Date: May 2006
Location: UK - London
Posts: 329
Rep Power: 3
![]() |
Re: Listing HD's
__________________
Quote:
|
|
|
|
|
|
|
#9 |
|
Hobbyist Programmer
|
Re: Listing HD's
Yer its another example of a third party module by the looks of it, or at least a module that is no longer supported. I'd rather use default libraries and working with the solution i have at the moment since i would like to be able to rn the script on other machines that will not have the extra modules installed.
But thanks anyway, these were the sorts of things i was getting when i googled it myself. Chris
__________________
Who said i couldn't program sarcasm = raw_input('Type in a sarcastic remark: ')
|
|
|
|
|
|
#10 |
|
Professional Programmer
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3
![]() |
Re: Listing HD's
I wouldn't stop there at all. Take a look at the source code for those 3rd party modules. Its most likely that they use the Win32 API (or another C api). If so you can use ctypes to just load the right DLL and call the needed functions directly from Python. No 3rd party module is needed. I have done this myself for other areas of Win32 API and it works just fine.
__________________
Robotics @ Maryland AUV Team - Software Lead |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Query and List, PhP Main Page Auto Listing of User Actio | Stryker | PHP | 1 | Aug 21st, 2006 3:40 PM |
| IDX MLS Listing Software | galgoz | Paid Job Offers | 5 | May 15th, 2006 3:03 PM |
| Rank Listing | Lightninghawk | Coder's Corner Lounge | 2 | Nov 4th, 2005 3:04 AM |
| How to get file listing of a dir | some1 | C++ | 16 | May 29th, 2005 9:45 AM |
| Explorer Directory Listing | Lance | Existing Project Development | 5 | Jan 28th, 2005 1:03 PM |