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\\Sha redDocs\\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 1436 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\\Sha redDocs\\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\\Sha redDocs\\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.execut e. 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 big) problem with my code
that someone can point out that may save me some time.
TIA
CBL
|
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 message:
"The process cannot access the file "whatever" because it is being used
by another process."
I've even tried opening another file using the same streamwriter object
before deleting the original file, but it's no use. Something keeps...
|
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.
\\10.31.42.10\db\mydb.mdb but the whoever opens their front end first
appears to have exclusive access to the database. Anyone else who
tries to open the database can open it to a certain extent (as long as
the form in question has no data on it,...
|
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: Project: drawing_control, Configuration:
Release Win32 ------
1>Deleting intermediate and output files for project 'drawing_control',
configuration 'Release|Win32'
|
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 and arrays of pointers to them.
I have gotten the program to compile with gcc on WinXP.
If the file i read doesnt have alot of records, it runs thru. But once
i add more, it dies. In this program i have 4 files setup to read. The
| |
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
trying to write to the file and is throwing an exception (File... in
use by another process) whenever the output file (strFileName) is
open. I am trying to prevent it from writing to it at all if this is
the case... Any insight?
Public...
|
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 handling internal
information. Than I have web service, that also uses the same classes (I
included the file as linked external resource). I included this web service
as web reference and used name wsWeb.
When I am trying to call the web...
|
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 packages' that include as attachments: a contract (PDF or TIF), a pricing tool (Excel), a companion document (Word). Clerks detach these files into a shared drive file on our intranet.
I'm building an 'contract package management' application...
|
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 "<pyshell#10>", line 1, in <module>
os.startfile("C:\Documents and Settings\Alex\My Documents\My
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |