On 2017-05-30 08:45, loial wrote:
I am reading a list of pdf files from a directory which is a symbolic link and
adding them to a zip file.
Issue I have is that the zip files are being added as empty directories rather
than the actual pdf files.
My code is below. Any idea why this happening
I am reading a list of pdf files from a directory which is a symbolic link and
adding them to a zip file.
Issue I have is that the zip files are being added as empty directories rather
than the actual pdf files.
My code is below. Any idea why this happening?
# ZIP pdfs subdirectory
Peng Yu wrote:
I find the following two files that define realpath. But I don't find
'realpath' in os.py. I looked at 'os.py'. But I don't understand how
the function realpath is introduced in the name space in os.path.
Would you please let me know?
gfind . ! -path '*backup*' -name "*.py" -type
On Sat, Oct 31, 2009 at 14:48 -0500, Peng Yu wrote:
> On Sat, Oct 31, 2009 at 1:46 PM, Terry Reedy wrote:
> > Peng Yu wrote:
[ snip ]
> I find the following two files that define realpath. But I don't find
> 'realpath' in os.py. I looked at 'os.py'. But I don't understand how
> the function realp
tory and files. I want to get
>>>> the canonical path of a file, a directory or a symbolic link.
>>>> For example, for 'b' below, I want to get its canonical path as
>>>> '/private/tmp/abspath/b'.
>>>
>>> So, why i
ibe. I use the following example to show what I want.
>>
>> In my example in the original post,
>>
>> '/tmp/abspath/b' is a symbolic link to '/tmp/abspath/a' and '/tmp' is
>> a symbolic link to '/private/tmp'.
>>
>> The
Peng Yu wrote:
On Sat, Oct 31, 2009 at 11:26 AM, Emile van Sebille wrote:
On 10/31/2009 12:03 AM Peng Yu said...
Suppose that I have the following directory and files. I want to get
the canonical path of a file, a directory or a symbolic link.
For example, for 'b' below, I want
the original post,
>
> '/tmp/abspath/b' is a symbolic link to '/tmp/abspath/a' and '/tmp' is
> a symbolic link to '/private/tmp'.
>
> Therefore, I want to get '/private/tmp/abspath/b', rather than
> '/private/tmp/abspath/a
On Sat, Oct 31, 2009 at 11:26 AM, Emile van Sebille wrote:
> On 10/31/2009 12:03 AM Peng Yu said...
>>
>> Suppose that I have the following directory and files. I want to get
>> the canonical path of a file, a directory or a symbolic link.
>> For example, for &
On 10/31/2009 12:03 AM Peng Yu said...
Suppose that I have the following directory and files. I want to get
the canonical path of a file, a directory or a symbolic link.
For example, for 'b' below, I want to get its canonical path as
'/private/tmp/abspath/b'.
So, why isn
Suppose that I have the following directory and files. I want to get
the canonical path of a file, a directory or a symbolic link.
For example, for 'b' below, I want to get its canonical path as
'/private/tmp/abspath/b'.
However, os.path.abspath('b') gives me
Peng Yu writes:
> 'symbolic_link' is a symbolic link in the current directory. I run
> 'python main.py', but it does not return me anything. I want to check
> if a file is a symbolic link.
You have the same access to the Python help as we do:
>>> imp
import os
if os.path.islink('symbolic_link'):
print "hello."
Cheers,
Mahmoud Abdelkader
On Oct 28, 2009, at 11:19 PM, Peng Yu wrote:
'symbolic_link' is a symbolic link in the current directory. I run
'python main.py', but it does not return me
On Wed, 28 Oct 2009 22:19:55 -0500, Peng Yu wrote:
> 'symbolic_link' is a symbolic link in the current directory. I run
> 'python main.py', but it does not return me anything. I want to check if
> a file is a symbolic link. I'm wondering what is the correct
On 2009-10-29 11:19, Peng Yu wrote:
'symbolic_link' is a symbolic link in the current directory. I run
'python main.py', but it does not return me anything. I want to check
if a file is a symbolic link. I'm wondering what is the correct way to
do so?
$cat main.py
On Wed, 28 Oct 2009 22:19:55 -0500
Peng Yu wrote:
> 'symbolic_link' is a symbolic link in the current directory. I run
> 'python main.py', but it does not return me anything. I want to check
> if a file is a symbolic link. I'm wondering what is the correct
'symbolic_link' is a symbolic link in the current directory. I run
'python main.py', but it does not return me anything. I want to check
if a file is a symbolic link. I'm wondering what is the correct way to
do so?
$cat main.py
import stat
import os
st = os.stat('s
On Sep 9, 10:05 pm, Lawrence D'Oliveiro <[EMAIL PROTECTED]
central.gen.new_zealand> wrote:
> In message <[EMAIL PROTECTED]>,samwysewrote:
>
> > A hard-link, OTOH, allows
> > direct access to the contents of a file, as long as it is on the same
> > filesystem. No extra steps are required, so the pr
In message <[EMAIL PROTECTED]>, samwyse wrote:
> A hard-link, OTOH, allows
> direct access to the contents of a file, as long as it is on the same
> filesystem. No extra steps are required, so the process runs a few
> microseconds faster, and directory-level permissions can't get in the way.
Har
g to make a link in a browser friendly area so I
>>>>can use it to display an image file.
>>
>>My question would be why a symbolic link? Why not a hard link? Are the
>>two directories on different mount points? After the script finishes
>>does python need to see t
In message <[EMAIL PROTECTED]>, Ian Clark
wrote:
> My question would be why a symbolic link? Why not a hard link?
Because of the potential for confusion. For instance, modifying the file
without realizing that some other place expects to see the unmodified
version.
--
http://mail.p
Assuming your hosting service will allow that, then it should work.
> > If not, then why not just copy the image files? Storage is cheap
> > these days.
>
> > Hyuga
>
> My question would be why a symbolic link? Why not a hard link? Are the
> two directories on different
e image files? Storage is cheap
> these days.
>
> Hyuga
>
My question would be why a symbolic link? Why not a hard link? Are the
two directories on different mount points? After the script finishes
does python need to see that image file again? Why not just move it?
Ian
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 19, 4:29 pm, mosscliffe <[EMAIL PROTECTED]> wrote:
> The source file is in an area which python can see, but not the
> browser. I am trying to make a link in a browser friendly area so I
> can use it to display an image file.
You might want to try using an .htaccess file. Place a file
cal
On 19 Aug, 13:16, samwyse <[EMAIL PROTECTED]> wrote:
> mosscliffewrote:
> > I am trying to create a link to a file, which I can then use in an
> > HTML page.
>
> > The system is Linux on a hosted web service, running python 2.3.
> > Other than that I have no knowledge of the system.
>
> > The link
mosscliffe wrote:
> I am trying to create a link to a file, which I can then use in an
> HTML page.
>
> The system is Linux on a hosted web service, running python 2.3.
> Other than that I have no knowledge of the system.
>
> The link is created OK, but when I try to use it as filename for the
>
mosscliffe schrieb:
> On 18 Aug, 23:49, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
>> mosscliffe schrieb:
>>
>>
>>
>>> I am trying to create a link to a file, which I can then use in an
>>> HTML page.
>>> The system is Linux on a hosted web service, running python 2.3.
>>> Other than that I have
On 18 Aug, 23:49, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> mosscliffe schrieb:
>
>
>
> > I am trying to create a link to a file, which I can then use in an
> > HTML page.
>
> > The system is Linux on a hosted web service, running python 2.3.
> > Other than that I have no knowledge of the sys
mosscliffe schrieb:
> I am trying to create a link to a file, which I can then use in an
> HTML page.
>
> The system is Linux on a hosted web service, running python 2.3.
> Other than that I have no knowledge of the system.
>
> The link is created OK, but when I try to use it as filename for the
I am trying to create a link to a file, which I can then use in an
HTML page.
The system is Linux on a hosted web service, running python 2.3.
Other than that I have no knowledge of the system.
The link is created OK, but when I try to use it as filename for the
IMG TAG, it does not get displayed
30 matches
Mail list logo