Re: write file to a server

2015-01-28 Thread luca72
thanks for the reply i have resolve with the r'.' i have another question on linux i write cp -Ruv source destination There is one way to do it in python? with shutil there is copythree but if the dest dir exist he give back an error. Can you give me some ideas Thanks Luca -- https://ma

Re: write file to a server

2015-01-28 Thread Chris Angelico
On Thu, Jan 29, 2015 at 5:05 AM, Mark Lawrence wrote: > Windows will accept forward slashes in path names. Normally, yes. Does that work for UNC names too? //server/share/pathname ? In any case, that's an alternative solution to the same problem. ChrisA -- https://mail.python.org/mailman/listin

Re: write file to a server

2015-01-28 Thread Mark Lawrence
On 28/01/2015 14:12, Chris Angelico wrote: On Thu, Jan 29, 2015 at 12:38 AM, MRAB wrote: On 2015-01-28 13:22, luca72 wrote: Hello i'm under windows, i have to write a file from my computer to a local server like taht "\\DOCUMENTALE\my_folder\". How i have to proceed ? That's a path to a fol

Re: write file to a server

2015-01-28 Thread Chris Angelico
On Thu, Jan 29, 2015 at 12:38 AM, MRAB wrote: > On 2015-01-28 13:22, luca72 wrote: >> >> Hello i'm under windows, i have to write a file from my computer to a >> local server like taht "\\DOCUMENTALE\my_folder\". >> How i have to proceed ? >> > That's a path to a folder that just happens to be on

Re: write file to a server

2015-01-28 Thread MRAB
On 2015-01-28 13:22, luca72 wrote: Hello i'm under windows, i have to write a file from my computer to a local server like taht "\\DOCUMENTALE\my_folder\". How i have to proceed ? That's a path to a folder that just happens to be on another computer on your network. Treat it the same way you wo

write file to a server

2015-01-28 Thread luca72
Hello i'm under windows, i have to write a file from my computer to a local server like taht "\\DOCUMENTALE\my_folder\". How i have to proceed ? Thanks -- https://mail.python.org/mailman/listinfo/python-list

Re: how to write file into my android phone?

2014-08-13 Thread Chris “Kwpolska” Warrick
On Aug 14, 2014 8:11 AM, "alex23" wrote: > > On 10/08/2014 7:08 PM, Chris “Kwpolska” Warrick wrote: >>> >>> 2) the phone isn't necessarily visible on a pc as a drive at all. >>> For example the Samsung gs4. >> >> >> This is actually true for ALL android devices, starting with Android 3.0. > > >

Re: how to write file into my android phone?

2014-08-13 Thread alex23
On 10/08/2014 7:08 PM, Chris “Kwpolska” Warrick wrote: 2) the phone isn't necessarily visible on a pc as a drive at all. For example the Samsung gs4. This is actually true for ALL android devices, starting with Android 3.0. This isn't true for my Samsung gs2 running Android 4.1.2. -- https:

Re: how to write file into my android phone?

2014-08-12 Thread Grant Edwards
On 2014-08-11, Grant Edwards wrote: > What MTP allows is parallel access between the MTP protocol server in > the phone and the rest of the phone (OS and apps). In order to mount > a partition as a USB mass storage device, it has to first be unmounted > by the Android system. That's OK for an S

Re: how to write file into my android phone?

2014-08-12 Thread Anssi Saari
Chris “Kwpolska” Warrick writes: >> 2) the phone isn't necessarily visible on a pc as a drive at all. >> For example the Samsung gs4. > > This is actually true for ALL android devices, starting with Android 3.0. There was just a guy on comp.mobile.android saying his Android 4.2 phone (BLU Dash

Re: how to write file into my android phone?

2014-08-11 Thread Grant Edwards
On 2014-08-10, Marko Rauhamaa wrote: > Christian Gollwitzer : > >> Am 10.08.14 11:39, schrieb Steven D'Aprano: >>> Android phones don't mount as storage devices? >>> Oh well, that's Android crossed off my list. >> >> Not any longer. They used to, but the support for mass storage was >> dropped in

Re: how to write file into my android phone?

2014-08-10 Thread Marko Rauhamaa
Christian Gollwitzer : > Am 10.08.14 11:39, schrieb Steven D'Aprano: >> Android phones don't mount as storage devices? >> Oh well, that's Android crossed off my list. > > Not any longer. They used to, but the support for mass storage was > dropped in favour of MTP I don't see anything inherently

Re: how to write file into my android phone?

2014-08-10 Thread Christian Gollwitzer
Am 10.08.14 11:39, schrieb Steven D'Aprano: Android phones don't mount as storage devices? Oh well, that's Android crossed off my list. Not any longer. They used to, but the support for mass storage was dropped in favour of MTP to allow concurrent access from both the computer and the phone

Re: how to write file into my android phone?

2014-08-10 Thread Steven D'Aprano
Chris “Kwpolska” Warrick wrote: > On Sun, Aug 10, 2014 at 12:23 AM, Dave Angel wrote: >> 1) it's not necessarily j: And not necessarily a single drive. > > The OP claims it is a J: drive they want to write to. > >> 2) the phone isn't necessarily visible on a pc as a drive at all. >> For exam

Re: how to write file into my android phone?

2014-08-10 Thread Chris “Kwpolska” Warrick
On Sun, Aug 10, 2014 at 12:23 AM, Dave Angel wrote: > 1) it's not necessarily j: And not necessarily a single drive. The OP claims it is a J: drive they want to write to. > 2) the phone isn't necessarily visible on a pc as a drive at all. > For example the Samsung gs4. This is actually true

Re: how to write file into my android phone?

2014-08-09 Thread Dave Angel
Chris “Kwpolska” Warrick Wrote in message: > On Sat, Aug 9, 2014 at 7:56 PM, luofeiyu wrote: >> When i input usb line with my android phone into the pc , there are two >> disks j: and k: (type :removable disk) displayed in win7. >> >> i can get my android phone bluetooth mac address . >> >> impo

Re: how to write file into my android phone?

2014-08-09 Thread Chris “Kwpolska” Warrick
On Sat, Aug 9, 2014 at 7:56 PM, luofeiyu wrote: > When i input usb line with my android phone into the pc , there are two > disks j: and k: (type :removable disk) displayed in win7. > > i can get my android phone bluetooth mac address . > > import bluetooth > nearby_devices = bluetooth.discover_d

how to write file into my android phone?

2014-08-08 Thread luofeiyu
When i input usb line with my android phone into the pc , there are two disks j: and k: (type :removable disk) displayed in win7. i can get my android phone bluetooth mac address . import bluetooth nearby_devices = bluetooth.discover_devices(lookup_names = True) for addr, phoneName in nearby_d

Re: 回复: python32 to write file

2011-10-23 Thread Terry Reedy
On 10/23/2011 9:59 AM, 水静流深 wrote: i change my code into : Calling your file xml.py (as indicated below) is a potentially bad idea since the Python stdlib has a package named 'xml'. If you write 'import xml.xxx' in another file in the same directory, Python will try to find 'xxx' in your xml

回复: python32 to write file

2011-10-23 Thread 水静流深
on c:\xml.py Traceback (most recent call last): File "c:\xml.py", line 5, in root=lxml.html.fromstring(root) File "C:\Python32\lib\site-packages\lxml\html\__init__.py", line 630, in froms tring if start.startswith('; 发送时间: 2011年10月23日(星期天) 晚上9:48 收件人: "水

Re: python32 to write file

2011-10-23 Thread Chris Rebert
2011/10/23 水静流深 <1248283...@qq.com>: >     book=open('c:\'+str1,'w')  #  i  change it > when i run it  in  python32,the output is  : > book=open('c:\'+str1,'w') > invalid  syntax,what is wrong? Your problem is not at all Python 3-specific. Backslashes are used for escape sequences in string l

python32 to write file

2011-10-23 Thread 水静流深
code 1 can run in python2.6 #coding:utf-8 import urllib import lxml.html down='http://frux.wikispaces.com/' root=urllib.urlopen(down).read() root=lxml.html.fromstring(root) file=root.xpath('//a') for i in file: str1=i.text_content() if str1.find('pdf') >-1 : str2='http://frux.wi

Re: write file

2011-07-05 Thread Benjamin Kaplan
On Jul 5, 2011 2:28 PM, "miguel olivares varela" wrote: > > > Hi, > > i got a csv file that i need to modify and create a new one, i have no problem to read mi 'test.cvs' which is the source file but when i try to create a new one with the modifications i only got the first row in my 'out.csv' fi

RE: write file

2011-07-05 Thread miguel olivares varela
What's date_cdr supposed to be? It was a mistake it should be date_source Is your exception handler doing unusual things with sys.exit? Not really Did you try to run this? When I try to run it, it fails to compile. it compiles i have no problems with the compilation. The issue is the res

Re: write file

2011-07-05 Thread Dan Stromberg
What's date_cdr supposed to be? Is your exception handler doing unusual things with sys.exit? Did you try to run this? When I try to run it, it fails to compile. You might want to try opening your output file once and writing to it repeatedly, then close()ing it after all your writes are comple

write file

2011-07-05 Thread miguel olivares varela
Hi, i got a csv file that i need to modify and create a new one, i have no problem to read mi 'test.cvs' which is the source file but when i try to create a new one with the modifications i only got the first row in my 'out.csv' file. I think there is somethng wrong in my loop because i can

Re: Can't Write File

2009-11-12 Thread Victor Subervi
On Wed, Nov 11, 2009 at 6:35 PM, Rhodri James wrote: > On Wed, 11 Nov 2009 14:00:44 -, Victor Subervi < > victorsube...@gmail.com> wrote: > > 6) you don't indicate which user is executing this script (only root can >>> write to it) >>> >>> Help me on this. All scripts are owned by root. Is i

Re: Can't Write File

2009-11-11 Thread Rhodri James
On Wed, 11 Nov 2009 14:00:44 -, Victor Subervi wrote: 6) you don't indicate which user is executing this script (only root can write to it) Help me on this. All scripts are owned by root. Is it not root that is executing the script? Not unless your server setup is very, very stupid.

Re: Can't Write File

2009-11-11 Thread Victor Subervi
On Wed, Nov 11, 2009 at 2:46 PM, Rami Chowdhury wrote: > Now, the problem is that it doesn't print the picture. It prints only the >> url. Please try: >> http://angrynates.com/stcroixresort/cart/getpic.py?w=1&i=1 >> Now, if I go into mysql and the correct database and enter: >> select pic1 from pr

Re: Can't Write File

2009-11-11 Thread Rami Chowdhury
Now, the problem is that it doesn't print the picture. It prints only the url. Please try: http://angrynates.com/stcroixresort/cart/getpic.py?w=1&i=1 Now, if I go into mysql and the correct database and enter: select pic1 from products where ID=1; it starts printing out all sorts of crap (indicati

Re: Can't Write File

2009-11-11 Thread Victor Subervi
Never mind. It appears my old original file from a couple of years ago prints out the image nicely. Thanks all! V On Wed, Nov 11, 2009 at 2:26 PM, Victor Subervi wrote: > On Wed, Nov 11, 2009 at 1:20 PM, Benjamin Kaplan > wrote: > >> On Wed, Nov 11, 2009 at 11:42 AM, Victor Subervi >> wrote: >>

Re: Can't Write File

2009-11-11 Thread Victor Subervi
On Wed, Nov 11, 2009 at 1:20 PM, Benjamin Kaplan wrote: > On Wed, Nov 11, 2009 at 11:42 AM, Victor Subervi > wrote: > > On Wed, Nov 11, 2009 at 11:23 AM, Rami Chowdhury < > rami.chowdh...@gmail.com> > > wrote: > >> > >> On Wed, 11 Nov 2009 06:00:44 -0800, Victor Subervi > >> wrote: > >> > >>> On

Re: Can't Write File

2009-11-11 Thread Benjamin Kaplan
On Wed, Nov 11, 2009 at 11:42 AM, Victor Subervi wrote: > On Wed, Nov 11, 2009 at 11:23 AM, Rami Chowdhury > wrote: >> >> On Wed, 11 Nov 2009 06:00:44 -0800, Victor Subervi >> wrote: >> >>> On Tue, Nov 10, 2009 at 4:33 PM, Dave Angel wrote: >>> Victor Subervi wrote: >> Wrong? 2)

Re: Can't Write File

2009-11-11 Thread Carsten Haese
Victor Subervi wrote: > I will do that after I fix the problem "Doing that" is the fix. > No, this doesn't fix the problem! How do you know? You obviously haven't tried it, since you say you have yet to do it. -- Carsten Haese http://informixdb.sourceforge.net -- http://mail.python.org/mailma

Re: Can't Write File

2009-11-11 Thread Victor Subervi
On Wed, Nov 11, 2009 at 11:58 AM, Carsten Haese wrote: > Victor Subervi wrote: > > Here's > > a bigger code snippet with the entire try clause: > > > > if 14 < x < 20: # This just shows that it's a pic, not some > > other type of data > > y += 1 > > w += 1 > >

Re: Can't Write File

2009-11-11 Thread Carsten Haese
Victor Subervi wrote: > Here's > a bigger code snippet with the entire try clause: > > if 14 < x < 20: # This just shows that it's a pic, not some > other type of data > y += 1 > w += 1 > try: # It does this, because I've printed 'getpic1.py' etc. >

Re: Can't Write File

2009-11-11 Thread Rami Chowdhury
On Wed, 11 Nov 2009 08:42:27 -0800, Victor Subervi wrote: On Wed, Nov 11, 2009 at 11:23 AM, Rami Chowdhury wrote: On Wed, 11 Nov 2009 06:00:44 -0800, Victor Subervi < victorsube...@gmail.com> wrote: On Tue, Nov 10, 2009 at 4:33 PM, Dave Angel wrote: Victor Subervi wrote: Wrong?

Re: Can't Write File

2009-11-11 Thread Victor Subervi
On Wed, Nov 11, 2009 at 11:23 AM, Rami Chowdhury wrote: > On Wed, 11 Nov 2009 06:00:44 -0800, Victor Subervi < > victorsube...@gmail.com> wrote: > > On Tue, Nov 10, 2009 at 4:33 PM, Dave Angel wrote: >> >> Victor Subervi wrote: >>> >> > Wrong? >>> >>> 2) you don't show the error traceback >>>

Re: Can't Write File

2009-11-11 Thread Rami Chowdhury
On Wed, 11 Nov 2009 06:00:44 -0800, Victor Subervi wrote: On Tue, Nov 10, 2009 at 4:33 PM, Dave Angel wrote: Victor Subervi wrote: Wrong? 2) you don't show the error traceback because there are none try: # It does this, because I've printed 'getpic1.py' etc.

Re: Can't Write File

2009-11-11 Thread Victor Subervi
On Tue, Nov 10, 2009 at 4:33 PM, Dave Angel wrote: > Victor Subervi wrote: > >> Hi; >> I've determined the problem in a script is I can't open a file to write >> it: >> script = open(getpic, "w") # where getpic is already defined >> Here are the permissions: >> -rwxr-xr-x 1 root root 4649 Nov

Re: Can't Write File

2009-11-10 Thread Dave Angel
Victor Subervi wrote: Hi; I've determined the problem in a script is I can't open a file to write it: script = open(getpic, "w") # where getpic is already defined Here are the permissions: -rwxr-xr-x 1 root root 4649 Nov 10 12:31 start.py What am I doing wrong? TIA, Victor Wrong? 1) you

Re: Can't Write File

2009-11-10 Thread Rami Chowdhury
On Tue, 10 Nov 2009 12:57:30 -0800, Victor Subervi wrote: On Tue, Nov 10, 2009 at 3:41 PM, Rami Chowdhury wrote: On Tue, 10 Nov 2009 12:38:36 -0800, Victor Subervi < victorsube...@gmail.com> wrote: Hi; I've determined the problem in a script is I can't open a file to write it: script =

Re: Can't Write File

2009-11-10 Thread Victor Subervi
On Tue, Nov 10, 2009 at 3:41 PM, Rami Chowdhury wrote: > On Tue, 10 Nov 2009 12:38:36 -0800, Victor Subervi < > victorsube...@gmail.com> wrote: > > Hi; >> I've determined the problem in a script is I can't open a file to write >> it: >> script = open(getpic, "w") # where getpic is already define

Re: Can't Write File

2009-11-10 Thread Rami Chowdhury
On Tue, 10 Nov 2009 12:38:36 -0800, Victor Subervi wrote: Hi; I've determined the problem in a script is I can't open a file to write it: script = open(getpic, "w") # where getpic is already defined Here are the permissions: -rwxr-xr-x 1 root root 4649 Nov 10 12:31 start.py What am I do

Can't Write File

2009-11-10 Thread Victor Subervi
Hi; I've determined the problem in a script is I can't open a file to write it: script = open(getpic, "w") # where getpic is already defined Here are the permissions: -rwxr-xr-x 1 root root 4649 Nov 10 12:31 start.py What am I doing wrong? TIA, Victor -- http://mail.python.org/mailman/listinfo/

Re: Text lost when I write file

2009-08-17 Thread Ben Finney
Chris Rebert writes: > On Mon, Aug 17, 2009 at 8:45 PM, roy...@gmail.com wrote: > > I try to write text into a file but some text lost when the size of > > the text content is over 32K. > > Is that relate to the buffer of the python and any setting can solve > > this problem??. > > Please show us

Re: Text lost when I write file

2009-08-17 Thread Chris Rebert
On Mon, Aug 17, 2009 at 8:45 PM, roy...@gmail.com wrote: > Dear All, > > I try to write text into a file but some text lost when the size of > the text content is over 32K. > Is that relate to the buffer of the python and any setting can solve > this problem??. Please show us the code you're using

Text lost when I write file

2009-08-17 Thread roy...@gmail.com
Dear All, I try to write text into a file but some text lost when the size of the text content is over 32K. Is that relate to the buffer of the python and any setting can solve this problem??. Regards Roy -- http://mail.python.org/mailman/listinfo/python-list

Re: utf-8 read/write file

2008-10-09 Thread gigs
Kent Johnson wrote: On Oct 8, 5:55 pm, gigs <[EMAIL PROTECTED]> wrote: Benjamin wrote: On Oct 8, 12:49 pm, Bruno <[EMAIL PROTECTED]> wrote: Hi! I have big .txt file which i want to read, process and write to another .txt file. I have done script for that, but im having problem with croatian c

Re: utf-8 read/write file

2008-10-08 Thread Kent Johnson
On Oct 8, 5:55 pm, gigs <[EMAIL PROTECTED]> wrote: > Benjamin wrote: > > On Oct 8, 12:49 pm, Bruno <[EMAIL PROTECTED]> wrote: > >> Hi! > > >> I have big .txt file which i want to read, process and write to another > >> .txt file. > >> I have done script for that, but im having problem with croatia

Re: utf-8 read/write file

2008-10-08 Thread Aleksandar Radulovic
Hi, What is the encoding of the file1 you're reading from? I just ran tests on my machine (OS X) with both python2.5 and 2.6 and was able to read from a file containing: "život je lep" The file is UTF-8 encoded. >>> data = open("test.txt").read() >>> data '\xc5\xbeivot je lep.' >>> f = open("tes

Re: utf-8 read/write file

2008-10-08 Thread gigs
Benjamin wrote: On Oct 8, 12:49 pm, Bruno <[EMAIL PROTECTED]> wrote: Hi! I have big .txt file which i want to read, process and write to another .txt file. I have done script for that, but im having problem with croatian characters (Š,Đ,Ž,Č,Ć). Can you show us what you have so far? How can

Re: utf-8 read/write file

2008-10-08 Thread Benjamin
On Oct 8, 12:49 pm, Bruno <[EMAIL PROTECTED]> wrote: > Hi! > > I have big .txt file which i want to read, process and write to another .txt > file. > I have done script for that, but im having problem with croatian characters > (Š,Đ,Ž,Č,Ć). Can you show us what you have so far? > How can I read/

utf-8 read/write file

2008-10-08 Thread Bruno
Hi! I have big .txt file which i want to read, process and write to another .txt file. I have done script for that, but im having problem with croatian characters (Š,Đ,Ž,Č,Ć). How can I read/write from/to file in utf-8 encoding? I read file with fileinput.input. thanks -- http://mail.python.o

Re: how to write file with cp1250 encodings?

2006-03-03 Thread jean-michel bain-cornu
Hi, Grzegorz Smith wrote: > Hi all. I have got situation: i load data from database(MSSQL) wchich are > encoded cp1250 and I fill template with that data (Cheetah Template), after > all i want to save template to file on disk. I'm using > newfile = open("template.html",w") > newfile.write(str(temp

Re: how to write file with cp1250 encodings?

2006-03-01 Thread Magnus Lycka
Grzegorz Smith wrote: > Hi all. I have got situation: i load data from database(MSSQL) wchich are > encoded cp1250 Are you sure that you are getting cp1250 from the database? How do you communicate with the database? With the database APIs I used in Windows, I always got Unicode objects from data

Re: how to write file with cp1250 encodings?

2006-02-26 Thread Waldemar Osuch
Grzegorz Smith wrote: > Hi all. I have got situation: i load data from database(MSSQL) wchich are > encoded cp1250 and I fill template with that data (Cheetah Template), after > all i want to save template to file on disk. I'm using One way to do it: >>> from Cheetah.Template import Template >>>

how to write file with cp1250 encodings?

2006-02-26 Thread Grzegorz Smith
Hi all. I have got situation: i load data from database(MSSQL) wchich are encoded cp1250 and I fill template with that data (Cheetah Template), after all i want to save template to file on disk. I'm using newfile = open("template.html",w") newfile.write(str(template)) newfile.close() But data enco