473,233 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,233 software developers and data experts.

usage of file separator

in my code i am iterating thru a list of filenames (like 'image1.jpg'
etc) and appending them to fully qualified directory names

for x in imagefilenames:
imgfile=folder+"/"+x
newimgfilenamelist.append(imgfile)

sothat finally i can get items like c:/mycode/image1.jpg etc from the
newimgfilenamelist

on windows this will work..but how do i make it work on other os?
Being a beginner i couldn't figure out how to solve this using
os.path can anyone help?

sorry if this is a silly qn
dn
Dec 31 '07 #1
2 3947
de****@gmail.com:
for x in imagefilenames:
imgfile=folder+"/"+x
newimgfilenamelist.append(imgfile)

[..] how do i make it work on other os?
from os.path import join
#..
imgfile=join(folder, x)

--
Thomas Wittek
Web: http://gedankenkonstrukt.de/
Jabber: st*********@jabber.i-pobox.net
GPG: 0xF534E231
Dec 31 '07 #2
>
from os.path import join
#..
* * imgfile=join(folder, x)

--
Thomas Wittek
thanx!
dn
Jan 1 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: chris | last post by:
I'm writing a small app to help me learn more about cryptography. All it does is encrypt all of the files in directory A, and put the encrypted versions of the files in directory B. It then...
4
by: Hal Vaughan | last post by:
I want to have a config file for my program, which means I need to know where the config file is. If I type: java myclass and it runs myclass.class, is there any way to obtain the location of...
2
by: Ben Enfield | last post by:
I am migrating a program from C++ to C# and have encountered a difficulty in reading the data files. For example, when the data file looks like the following: 75000 77270 7900 8030 *Note...
12
by: oksuresh | last post by:
Hi talents, I have a situation where , I should keep on reading a FILE stream until a location. And I have to immediately write the EOF character , so that the rest of the file is cleared. ...
29
by: Markus Pitha | last post by:
Hello, I read a simple bmp-file with this loop: while ( !feof(fp) ) { printf("%x\n", fgetc(fp)); } fclose(fp); Everything seems to be correct, but at the end of the file, I get a weird
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
2
by: JB | last post by:
Hi All, I can write a Tab character in the Value of an XML field, but when I read the XML file back I get an empty string instead!!! Here's the sample code: 'Write the Tab char in Separator...
2
by: willyWEB66 | last post by:
Hi everyone, I have this code in javascript where the XML file is loaded and displayed to an html using XSLT. It works fine in IE but not in Firefox. My problem is in the looping to the...
7
by: JB | last post by:
Hi everyone, I'm having problems with Tab characters in an XML file. I want to store a Tab character as part of an element value e.g. <Separator>TAB</Separator> I'm using XmlWriter to write my...
0
by: ndedhia1 | last post by:
I am having trouble loading a property file and keep getting this error when running my shell script that loads and runs my jar files, etc: no property file loaded, using defaults......
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.