Hello,
I'm using Windows XP and Windows Server 2003 for a work.
I need to copy a file from shared dir to my pc. This is my file location.
\\NOTEBOOK\\SharedDocs\\Musica\\Musica campione\\a.wma
I tried to use os.system and open: -
open("\\NOTEBOOK\\SharedDocs\\Musica\\Musica campione\\a.wma","r").read()
-
Traceback (most recent call last):
-
File "<pyshell#3>", line 1, in <module>
-
open("\\NOTEBOOK\\SharedDocs\\Musica\\Musica campione\\a.wma","r").read()
-
IOError: [Errno 2] No such file or directory: '\\NOTEBOOK\\SharedDocs\\Musica\\Musica campione\\a.wma'
And system returns nothing...But nothing happens too. (in fact cmd tells me that the folder path is unknown). I've got all the right privileges, because using explorer I can get my file.
Thank you,
Luca
5 1431 STM 4
New Member
Hello,
I'm using Windows XP and Windows Server 2003 for a work.
I need to copy a file from shared dir to my pc. This is my file location.
\\NOTEBOOK\\SharedDocs\\Musica\\Musica campione\\a.wma
I tried to use os.system and open: -
open("\\NOTEBOOK\\SharedDocs\\Musica\\Musica campione\\a.wma","r").read()
-
Traceback (most recent call last):
-
File "<pyshell#3>", line 1, in <module>
-
open("\\NOTEBOOK\\SharedDocs\\Musica\\Musica campione\\a.wma","r").read()
-
IOError: [Errno 2] No such file or directory: '\\NOTEBOOK\\SharedDocs\\Musica\\Musica campione\\a.wma'
And system returns nothing...But nothing happens too. (in fact cmd tells me that the folder path is unknown). I've got all the right privileges, because using explorer I can get my file.
Thank you,
it s just a guess, but try writing the open call like this: -
open(r'\NOTEBOOK\SharedDocs\Musica\Musica campione\a.wma','r').read()
the way you wrote it may have problems with escape sequences
let me know if that was the problem
Hello,
I'm using Windows XP and Windows Server 2003 for a work.
I need to copy a file from shared dir to my pc. This is my file location.
\\NOTEBOOK\\SharedDocs\\Musica\\Musica campione\\a.wma
I tried to use os.system and open: -
open("\\NOTEBOOK\\SharedDocs\\Musica\\Musica campione\\a.wma","r").read()
-
Traceback (most recent call last):
-
File "<pyshell#3>", line 1, in <module>
-
open("\\NOTEBOOK\\SharedDocs\\Musica\\Musica campione\\a.wma","r").read()
-
IOError: [Errno 2] No such file or directory: '\\NOTEBOOK\\SharedDocs\\Musica\\Musica campione\\a.wma'
And system returns nothing...But nothing happens too. (in fact cmd tells me that the folder path is unknown). I've got all the right privileges, because using explorer I can get my file.
Thank you,
Luca
I'm not sure but the problem might be because of the space in the path. Try calling it like this: -
open/os.system('"\\NOTEBOOK\\......\\a.wma"')
-
demo -
>>> import os
-
>>> os.path.join("c:\\","test","file with space.txt")
-
'c:\\test\\file with space.txt'
-
>>> os.path.exists (os.path.join("c:\\","test","file with space.txt"))
-
True
-
>>> f=open(os.path.join("c:\\","test","file with space.txt"))
-
>>> f.read()
-
'qweqwd'
-
>>> f.close()
-
ensure that you have a valid drive letter assigned to your mapped drive.
Problem solved using os.system and win32api.execute. I wasn't able to map drives because the program works on more than 30pcs...it was kinda impossible...
Thanks for help,
Luce
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: me |
last post by:
I'm also having problems getting the bulk insert to work. I don't know
anything about it except what I've gleened from BOL but I'm not seeming to
get anywhere...Hopefully there is some little (or...
|
by: Don |
last post by:
I'm having problems working with a streamwriter object. After closing the
streamwriter and setting it to Nothing, I try to delete the file it was
writing to, but I always get the following error...
|
by: DeanL |
last post by:
Hi all,
I'm having a few problems with a shared access 97 db. I have the
database split with the tables on the server and everything else in
"client" front ends with links to the tables, e.g....
|
by: electrixnow |
last post by:
Help!,
I need to compile this code with static libs so it run on another XP
machine that does'nt have
MS Studio installed. When I compile now I get an ERROR:
1>------ Rebuild All started:...
|
by: Mike |
last post by:
Hi,
I am new to C and having problems with the following program.
Basically I am trying to read some files, loading data structures into
memory for latter searching.
I am trying to use structres...
| |
by: jtertin |
last post by:
I am currently using the following code to make sure a file is
writable (i.e. is not in use) by using the CanWrite method of the
FileStream object. Using the code below, the TextWriter is still...
|
by: Simon |
last post by:
I have problem with namespaces. I have a program that consumes the web
service and has for instance names space nsProgram. In this program I have
defined several classes that I use for storing and...
|
by: LAD |
last post by:
Using Access 2003 on Windows 2000.
My Skill Level: Med Low (Some VBA, okay with Access)
Form: Single View - based on Query of single Table to sort by field.
Application: Dealers email 'contract...
|
by: Alexnb |
last post by:
Gerhard Häring wrote:
No, it didn't work, but it gave me some interesting feedback when I ran it
in the shell. Heres what it told me:
Traceback (most recent call last):
File...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |