[Tutor] Renaming Files in Directory

2014-10-09 Thread Felisha Lawrence
Hello, I have the following program import os path = '/Users/felishalawrence/testswps/vol1' for file in os.listdir(path): newFile = path+file[:file.rindex("v")]+"v20" print newFile and I want to output the results of the 'newFile' variable into the directory specified by the '

Re: [Tutor] Renaming Files in Directory

2014-10-09 Thread Peter Otten
Felisha Lawrence wrote: > I have the following program > import os > > path = '/Users/felishalawrence/testswps/vol1' > for file in os.listdir(path): > newFile = path+file[:file.rindex("v")]+"v20" > > print newFile > and I want to output the results of the 'newFile' variable in

Re: [Tutor] Renaming Files in Directory

2014-10-09 Thread Alan Gauld
On 09/10/14 00:58, Felisha Lawrence wrote: Hello, I have the following program import os path = '/Users/felishalawrence/testswps/vol1' for file in os.listdir(path): newFile = path+file[:file.rindex("v")]+"v20" print newFile and I want to output the results of the 'newFile

[Tutor] alternative Python 2.6 install?

2014-10-09 Thread Albert-Jan Roskam
Hi, I need to install Python 2.6 on my Debian system to check some code.*) What is the easiest way to do this? Simply "sudo apt-get install python2.6"? I know I can also compile it and then do make altinstall, but I prefer apt-get. I am kinda paranoid that I might accidentally change my system

[Tutor] (no subject)

2014-10-09 Thread William Becerra
I'm new to programming. Started reading the book 'How to think like a computer Scientist-learning with python'. I'm now in chapter 3 sub-chapter 3.4 Math functions. When I write the following code: import maths; decibel = math.log10 (17.0); angle = 1.5; height = math.sin(angle); print height; I

Re: [Tutor] (no subject)

2014-10-09 Thread Joel Goldstick
On Oct 9, 2014 8:00 PM, "William Becerra" wrote: > > I'm new to programming. Started reading the book 'How to think like a computer Scientist-learning with python'. I'm now in chapter 3 sub-chapter 3.4 Math functions. > > When I write the following code: > > import maths; import math You added s

Re: [Tutor] (no subject)

2014-10-09 Thread Martin A. Brown
Hi there and welcome! import maths; decibel = math.log10 (17.0); angle = 1.5; height = math.sin(angle); print height; Traceback (most recent call last): File "C:/Python27/test", line 1, in import maths; ImportError: No module named maths Oops! It's a nice error report, though! Python

Re: [Tutor] (no subject)

2014-10-09 Thread Alan Gauld
On 09/10/14 19:38, William Becerra wrote: import maths; Python, like most languages speaks American English so its math not maths. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.flickr.com/photos/alangauldphotos _

[Tutor] Installing both Python 2.7 and Python 3.4 on Windows 7 Pro 64-bit: Install Python 2.7 FIRST!

2014-10-09 Thread boB Stepp
I am hoping to save other people the grief I just worked through. I wanted to run both Python 2 and 3 on my windows PC, and, after googling this topic found that with Python 3.3 or later one could easily do both. So I merrily installed Python 3.4.2 first and then Python 2.7.8. A Python 3 program th

Re: [Tutor] (no subject)

2014-10-09 Thread William Becerra
It is working now. Thank you everyone. It was very helpfull. On Fri, Oct 10, 2014 at 2:36 AM, Alan Gauld wrote: > On 09/10/14 19:38, William Becerra wrote: > > import maths; >> > > Python, like most languages speaks American English > so its math not maths. > > -- > Alan G > Author of the Learn