Re: [Tutor] Move files to a new directory with matching folder names

2014-05-21 Thread questions anon
Thank you for your response. I have created some sample folders and tried your method but I receive an error: IOError: [Errno 21] Is a directory: '/Data/test1/2011/01' The script I use is: destination_prefix="/Data/test/" source_prefix="/Data/test1/" for year in range(2011, 2012): year = str(

Re: [Tutor] Option on How to create web Interface

2014-05-21 Thread Dave Angel
fabu desay Wrote in message: > If I got the problem correctly What problem is that? I see no context. > ,you can equally create + open a file > file = open(filename,+wr) But the second argument must be a string. I cannot imagine any content in the wrong variable that would produce a strin

Re: [Tutor] Move files to a new directory with matching folder names

2014-05-21 Thread Steven D'Aprano
On Thu, May 22, 2014 at 10:25:27AM +1000, questions anon wrote: > I have files contained separately in folders labelled by years and months > and I would like to copy them into another directory where they have > matching folder names of years and months. > I can do this for one folder at a time (s

Re: [Tutor] Move files to a new directory with matching folder names

2014-05-21 Thread Danny Yoo
On Wed, May 21, 2014 at 5:25 PM, questions anon wrote: > I have files contained separately in folders labelled by years and months > and I would like to copy them into another directory where they have > matching folder names of years and months. > I can do this for one folder at a time (see below

Re: [Tutor] Option on How to create web Interface

2014-05-21 Thread Danny Yoo
As a web server, you would not even be trying to open a file on disk. You've most likely got the network socket as a file-like object in hand: you'd probably write directly to that file-like object and avoid touching any disk whatsoever. You want to avoid touching disk if possible, especially on h

[Tutor] Move files to a new directory with matching folder names

2014-05-21 Thread questions anon
I have files contained separately in folders labelled by years and months and I would like to copy them into another directory where they have matching folder names of years and months. I can do this for one folder at a time (see below) but I want it to be able to go through all the folders (2002/0

Re: [Tutor] Option on How to create web Interface

2014-05-21 Thread Alan Gauld
On 21/05/14 16:50, fabu desay wrote: If I got the problem correctly,you can equally create + open a file file = open(filename,+wr) You wouldn't normally use +wr as a mode; that introduces a lot of complications. Usually you just open to read, or open to write. In your case w is all you need.

[Tutor] Option on How to create web Interface

2014-05-21 Thread fabu desay
If I got the problem correctly,you can equally create + open a file file = open(filename,+wr) The file should have the HTML extension You can now pace your web contents in the file.html you created that should work by trigering the python file you programed in and it inturn creates the website or

Re: [Tutor] Set values from list as per user input

2014-05-21 Thread Alan Gauld
On 21/05/14 13:39, Shweta Kaushik wrote: Hi All, I am new to python. Please help me. I have to create one function which can set values sent by user from a list of values. For eg: I have a list having values between 1 to 100. List = ['1', '2', ... '100'] I have to write a function to set valu

Re: [Tutor] Set values from list as per user input

2014-05-21 Thread Dave Angel
Shweta Kaushik Wrote in message: > Hi All, > > I am new to python. Please help me. > I have to create one function which can set values sent by user from a list > of values. > > For eg: > I have a list having values between 1 to 100. > List = ['1', '2', ... '100'] > > I have to write a functi

Re: [Tutor] How do I create a "loop until" looping structure?

2014-05-21 Thread Wolfgang Maier
On 21.05.2014 12:32, 1 2 wrote: Hi there, As shown in the codes below, I want to end the loop until the s is no greater than -5 but I found there is no "do... loop until..." like C so what should I do? I will write it in C's style s,n = 0,1 do: import math s=s+(math.log((n+1)/(n+2))

Re: [Tutor] How do I create a "loop until" looping structure?

2014-05-21 Thread Greg Schroeder
https://wiki.python.org/moin/WhileLoop Greg On Wed, 2014-05-21 at 18:32 +0800, 1 2 wrote: > Hi there, > As shown in the codes below, I want to end the loop until the s is > no greater than -5 but I found there is no "do... loop until..." like > C so what should I do? I will write it in C's styl

Re: [Tutor] How do I create a "loop until" looping structure?

2014-05-21 Thread Alan Gauld
On 21/05/14 11:32, 1 2 wrote: Hi there, As shown in the codes below, I want to end the loop until the s is no greater than -5 but I found there is no "do... loop until..." like C so what should I do? I will write it in C's style Normally you just reverse the logic and use a while loop instea

Re: [Tutor] Set values from list as per user input

2014-05-21 Thread R. Alan Monroe
> take value 15 from list Hint: use square brackets to choose a particular item from a list. test = ['first', 'second', 'third'] test[0] would refer to 'first' for example. Alan ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscri

Re: [Tutor] Set values from list as per user input

2014-05-21 Thread Shweta Kaushik
Hi All, I am new to python. Please help me. I have to create one function which can set values sent by user from a list of values. For eg: I have a list having values between 1 to 100. List = ['1', '2', ... '100'] I have to write a function to set values from the list based on user input. If u

[Tutor] How do I create a "loop until" looping structure?

2014-05-21 Thread 1 2
Hi there, As shown in the codes below, I want to end the loop until the s is no greater than -5 but I found there is no "do... loop until..." like C so what should I do? I will write it in C's style s,n = 0,1 do: import math s=s+(math.log((n+1)/(n+2))/math.log(2)) loop until s < -5 print