![]() |
|
#1
|
|||
|
|||
USB Hub Python programmingSo this new wireless USB hub from Belkin is coming out very soon its date is mid December, so soon, but I was wondering if anyone knew how I could write a program in python or could you possibly do it for me which would tell the computer to extract the images from the camera automatically to the computer once it it plugged into the usb hub. How the usb hub works is, there is a hub and a flash drive dongle looking thing, which is hooked up into a computers USB port. Now what will be done is the camera will be hooked up into the hub a distance away and it will be recognized on the computer b/c signals will be sent to the dongle and the camera will appear on the computer. Next the images can be extracted manually, but I was wondering if anyone knew how to write a program that would tell the computer as soon as the camera is connected into the hub and appears connected on the computer to automatically download all the pictures into a folder on the computers hard drive without me having to go to the computer personally and do it manually?
|
|||
|
#2
|
||||
|
||||
Re: USB Hub Python programmingAre you saying you want to write the program yourself? I have no experience with this personally so you might want to check out the Python newsgroup on Google Groups.
I would imagine that the program would simply look for the USB "drive" and simply move the data files from there to your computer's drive. As long as you treat everything as a simple HD and not worry about what it actually is, it should work. __________________
Start Programming with Python-A beginner's guide to programming and the Python language. ------------- Common Sense v2.0-Striving to make the world a little bit smarter. |
|
#3
|
|||
|
|||
Re: USB Hub Python programmingsince now the camera isn't a mass storage device I changed it up. Now I am making a program that when the memory stick is put into a usb port it gets assigned a drive letter well from that drive it will copy the files into another folder and the program runs every 5 seconds, now what I need help on is what do I add into my program that would Ignore the errors when the memory stick isn't plugged in, but still have the program run every 5 seconds and once the memory stick is inserted and the directory exist for the program to copy the files once it has come to one of its 5 second runs.
Python Code:
Last edited by LuciWiz : 23-Dec-2006 at 18:05.
Reason: Please insert your Python code between [py] & [/py] tags
|
|
#4
|
||||
|
||||
Re: USB Hub Python programmingI assume you want the exception that is missing from your try block. I'm not sure what the actual exception would be if the memory stick isn't inserted (I'd have to look it up but maybe something like FileNotFound). I'd imagine that once the exception is caught, indicating that the memory stick isn't found, you'd probably just want it to ignore the exception (unless you have something else in mind). If that's the case, then a simple:
Python Code:
I think that's what you're looking for. __________________
Start Programming with Python-A beginner's guide to programming and the Python language. ------------- Common Sense v2.0-Striving to make the world a little bit smarter. |
Recent GIDBlog
Toyota - 2009 May Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: Beginning Python Tutorial (Part 9) | crystalattice | Python Forum | 0 | 19-Feb-2006 02:04 |
| Sockets Programming in Python | crystalattice | Python Forum | 0 | 07-Oct-2005 23:49 |
| Re: Beginning Python Tutorial (Part 5) | crystalattice | Python Forum | 0 | 04-Oct-2005 05:27 |
| Re: Beginning Python Tutorial (Part 1) | crystalattice | Python Forum | 5 | 01-Aug-2005 18:14 |
| Re: Beginning Python Tutorial (Part 2) | crystalattice | Python Forum | 2 | 31-Jul-2005 13:25 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The