Re: effbot.org broken (WAS: Problems in commands.getoutput(cmd) with sox)

2009-07-24 Thread Piet van Oostrum
 Chris Rebert c...@rebertia.com (CR) wrote:

CR On Thu, Jul 23, 2009 at 12:42 PM, Chris Rebertc...@rebertia.com wrote:
 You can use tabnanny to help diagnose the problem:
 http://74.125.155.132/search?q=cache:QtxvZm3QDLsJ:effbot.org/librarybook/tabnanny.htm+tabnannycd=3hl=enct=clnkgl=usclient=firefox-a

CR Anyone know what's the deal with effbot.org? It seems to be broken at
CR present, forcing me to use Google's cached version.
CR It's a real shame since it has lots of handy Python info.

Just try again.
-- 
Piet van Oostrum p...@cs.uu.nl
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: effbot.org broken (WAS: Problems in commands.getoutput(cmd) with sox)

2009-07-24 Thread Chris Rebert
On Fri, Jul 24, 2009 at 2:38 AM, Piet van Oostrump...@cs.uu.nl wrote:
 Chris Rebert c...@rebertia.com (CR) wrote:

CR On Thu, Jul 23, 2009 at 12:42 PM, Chris Rebertc...@rebertia.com wrote:
 You can use tabnanny to help diagnose the problem:
 http://74.125.155.132/search?q=cache:QtxvZm3QDLsJ:effbot.org/librarybook/tabnanny.htm+tabnannycd=3hl=enct=clnkgl=usclient=firefox-a

CR Anyone know what's the deal with effbot.org? It seems to be broken at
CR present, forcing me to use Google's cached version.
CR It's a real shame since it has lots of handy Python info.

 Just try again.

Yup, whatever the problem was, seems to be fixed now. Interesting.

- Chris
-- 
http://mail.python.org/mailman/listinfo/python-list


Problems in commands.getoutput(cmd) with sox

2009-07-23 Thread bbarbero

Hello to all!

I am a new researcher, new to Python as well, and I have a problem,  
when I try to get commands from sox in a python script. I am going  
crazy, because this code has been working before.. so I dont really  
know whats going on..


Ive already seen some solutions that match with what I have. I am  
running this:




if os.path.splitext(file_au)[1] == .au:
resampled_file_path = os.path.join(resampled_path, file_au)
cmd = sox  + dir_file +  -r 44100  + resampled_file_path
print cmd
output = commands.getoutput(cmd)
print output

What i do, is just to resample a song from dir_file to  
resampled_file_path. As a result of cmd I get:



sox /Volumes/HAL/Datasets/Audio/gtzan_genres/rock/rock.00097.au -r  
44100  
/Volumes/bmorab/Audio_Projecto/Data/gtzan_genres/resampled/rock/rock.00097.au

.

If I run this on the command line, it will work perfectly!

But The program stops at

 File  
/Volumes/bmorab/Audio_Projecto/Data/gtzan_genres/resamplingto44.py,  
line 35

output = commands.getoutput(cmd)
^
IndentationError: unexpected indent

I dont have any idea, whats going on, I am trying lot of things, but I  
can understand where is the error as it has been running perfectly  
before.


Any suggestions will be more than welcome! Thanks in advance for your help!

Best regards,
Beatriz Mora.




This message was sent using IMP, the Internet Messaging Program.
--
http://mail.python.org/mailman/listinfo/python-list


effbot.org broken (WAS: Problems in commands.getoutput(cmd) with sox)

2009-07-23 Thread Chris Rebert
On Thu, Jul 23, 2009 at 12:42 PM, Chris Rebertc...@rebertia.com wrote:
 You can use tabnanny to help diagnose the problem:
 http://74.125.155.132/search?q=cache:QtxvZm3QDLsJ:effbot.org/librarybook/tabnanny.htm+tabnannycd=3hl=enct=clnkgl=usclient=firefox-a

Anyone know what's the deal with effbot.org? It seems to be broken at
present, forcing me to use Google's cached version.
It's a real shame since it has lots of handy Python info.

Cheers,
Chris
-- 
http://blog.rebertia.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Problems in commands.getoutput(cmd) with sox

2009-07-23 Thread Peter Otten
bbarb...@inescporto.pt wrote:

 Hello to all!
 
 I am a new researcher, new to Python as well, and I have a problem,
 when I try to get commands from sox in a python script. I am going
 crazy, because this code has been working before.. so I dont really
 know whats going on..
 
 Ive already seen some solutions that match with what I have. I am
 running this:
 
 
 
  if os.path.splitext(file_au)[1] == .au:
resampled_file_path = os.path.join(resampled_path, file_au)
 cmd = sox  + dir_file +  -r 44100  + resampled_file_path
 print cmd
 output = commands.getoutput(cmd)
 print output
 
 What i do, is just to resample a song from dir_file to
 resampled_file_path. As a result of cmd I get:
 
 
 sox /Volumes/HAL/Datasets/Audio/gtzan_genres/rock/rock.00097.au -r
 44100
 
/Volumes/bmorab/Audio_Projecto/Data/gtzan_genres/resampled/rock/rock.00097.au
 .
 
 If I run this on the command line, it will work perfectly!
 
 But The program stops at
 
   File
 /Volumes/bmorab/Audio_Projecto/Data/gtzan_genres/resamplingto44.py,
 line 35
  output = commands.getoutput(cmd)
  ^
 IndentationError: unexpected indent
 
 I dont have any idea, whats going on, I am trying lot of things, but I
 can understand where is the error as it has been running perfectly
 before.
 
 Any suggestions will be more than welcome! Thanks in advance for your
 help!

You are probably mixing tabs and spaces and have set your editor to display 
a tabsize != 8 spaces.

When you change the tabsize to 8 you will see the inconsistent indentation.

In the future you can avoid such problems by configuring your editor to 
replace one tab with four spaces. Recommended reading:

http://www.python.org/dev/peps/pep-0008/

Peter


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Problems in commands.getoutput(cmd) with sox

2009-07-23 Thread MRAB

bbarb...@inescporto.pt wrote:

Hello to all!

I am a new researcher, new to Python as well, and I have a problem, when 
I try to get commands from sox in a python script. I am going crazy, 
because this code has been working before.. so I dont really know whats 
going on..


Ive already seen some solutions that match with what I have. I am 
running this:




if os.path.splitext(file_au)[1] == .au:
  resampled_file_path = os.path.join(resampled_path, file_au)
   cmd = sox  + dir_file +  -r 44100  + resampled_file_path
   print cmd

^ extra indent

output = commands.getoutput(cmd)
print output

What i do, is just to resample a song from dir_file to 
resampled_file_path. As a result of cmd I get:



sox /Volumes/HAL/Datasets/Audio/gtzan_genres/rock/rock.00097.au -r 44100 
/Volumes/bmorab/Audio_Projecto/Data/gtzan_genres/resampled/rock/rock.00097.au 


.

If I run this on the command line, it will work perfectly!

But The program stops at

 File 
/Volumes/bmorab/Audio_Projecto/Data/gtzan_genres/resamplingto44.py, 
line 35

output = commands.getoutput(cmd)
^
IndentationError: unexpected indent

I dont have any idea, whats going on, I am trying lot of things, but I 
can understand where is the error as it has been running perfectly before.


Any suggestions will be more than welcome! Thanks in advance for your help!


You need to double-check the indentation.
--
http://mail.python.org/mailman/listinfo/python-list