[Tutor] numpy import failure

2011-02-27 Thread Ezra Kahn
I am a total newb, learning to ween myself off of Matlab. I am working off of EPD6.1, and I cannot get numpy to import. Python keeps sending me back this: Traceback (most recent call last): File "", line 1, in import numpy ImportError: No module named numpy How do I trouble shoot this

Re: [Tutor] python module to search a website

2011-02-27 Thread Alan Gauld
"vineeth" wrote looking for scraping. I am looking to obtain the html page that my query is going to return. I'm still notcompletely sure what you mean. What "query" are you talking about? The http GET request? Or a query transaction on the remote site? Just like when you type in a site li

Re: [Tutor] numpy import failure

2011-02-27 Thread Alan Gauld
"Ezra Kahn" wrote I am a total newb, learning to ween myself off of Matlab. I am working off of EPD6.1, and I cannot get numpy to import. Python keeps sending me back this: ImportError: No module named numpy Lets start at the beginning. What OS are you using? What Python version? What n

Re: [Tutor] numpy import failure

2011-02-27 Thread Steven D'Aprano
Ezra Kahn wrote: I am a total newb, learning to ween myself off of Matlab. I am working off of EPD6.1, and I cannot get numpy to import. Python keeps sending me back this: Traceback (most recent call last): File "", line 1, in import numpy ImportError: No module named numpy What's E

Re: [Tutor] Running Existing Python

2011-02-27 Thread Dave Angel
On 02/27/2011 02:50 AM, Justin Bonnell wrote: On Feb 26, 2011, at 10:51 PM, Dave Angel wrote: On 02/26/2011 06:03 PM, Justin Bonnell wrote: On Feb 26, 2011, at 4:05 PM, Dave Angel wrote: As for cd not working, someone else has pointed out that in the shell, you need to escape certain

Re: [Tutor] numpy import failure

2011-02-27 Thread Bill Allen
On Sat, Feb 26, 2011 at 22:45, Ezra Kahn wrote: > I am a total newb, learning to ween myself off of Matlab. I am working off > of EPD6.1, and I cannot get numpy to import. Python keeps sending me back > this: > > Traceback (most recent call last): > File "", line 1, in >import numpy > Imp

[Tutor] Converting .pyd to .so

2011-02-27 Thread fall colors
Hello, I was wondering if it would be possible to convert a .pyd file that works on Windows into a .so file that works on Linux? I gather that it might not be possible to convert the .pyd file if the underlying DLL file was built with Windows API calls (Swig was used to wrap up the DLL into a pyd

Re: [Tutor] Converting .pyd to .so

2011-02-27 Thread Stefan Behnel
fall colors, 27.02.2011 20:27: I was wondering if it would be possible to convert a .pyd file that works on Windows into a .so file that works on Linux? I gather that it might not be possible to convert the .pyd file if the underlying DLL file was built with Windows API calls (Swig was used to w

[Tutor] Generator expressions...

2011-02-27 Thread Modulok
List, I was messing around with generator expressions. I tried to make a script that would read a few bytes from '/dev/urandom' for eternity. It then did something pointless like computing checksums and printing them out. Unfortunately, the script only runs a few seconds and then terminates. I'm n

Re: [Tutor] Generator expressions...

2011-02-27 Thread Hugo Arts
On Sun, Feb 27, 2011 at 10:34 PM, Modulok wrote: > > import hashlib > > fd = open('/dev/urandom', 'rb') > gen = (hashlib.sha256(i).hexdigest() for i in fd.read(4096)) > > try: >    for i in gen: >        print i     #<-- This loop should never end... but does. Why? > > except KeyboardInterrupt: >

Re: [Tutor] Generator expressions...

2011-02-27 Thread Corey Richardson
On 02/27/2011 04:34 PM, Modulok wrote: > > import hashlib > > fd = open('/dev/urandom', 'rb') > gen = (hashlib.sha256(i).hexdigest() for i in fd.read(4096)) > I think the problem is that you're only reading 4096 bits (bytes? No idea), and iterating through that. I could be wrong. -- Corey Ric

Re: [Tutor] Generator expressions...

2011-02-27 Thread Modulok
>> import hashlib >> >> fd = open('/dev/urandom', 'rb') >> gen = (hashlib.sha256(i).hexdigest() for i in fd.read(4096)) >> >> try: >>for i in gen: >>print i #<-- This loop should never end... but does. Why? >> >> except KeyboardInterrupt: >>gen.close() >>fd.close() >>pri

Re: [Tutor] Tutor Digest, Vol 84, Issue 110

2011-02-27 Thread Ezra Kahn
Ezra Kahn wrote: > I am a total newb, learning to ween myself off of Matlab. I am working > off of EPD6.1, and I cannot get numpy to import. Python keeps sending > me back this: > > Traceback (most recent call last): > File "", line 1, in > import numpy > ImportError: No mod

Re: [Tutor] Converting .pyd to .so

2011-02-27 Thread fall colors
> Well, there's Wine, a free implementation of Windows for Unix systems. You > can either try to load the DLL using Wine and ctypes (I suspect that's the > hard way), or just run the Windows Python distribution through Wine and load > the wrapper .pyd into that. I assume the DLL is only available

Re: [Tutor] numpy import failure

2011-02-27 Thread Andre' Walker-Loud
Hi Ezra, Are you using Mac OSX or LINUX or ... If you have a preexisting python installation, it may be that when you launch python, it loads the older version, and not the new EPD version. When you launch python, what do you see? For example, on my Mac OSX, launched from Terminal, I get %

[Tutor] textbook question

2011-02-27 Thread Justin Bonnell
In trying to learn Python, I'm reading through How to Think Like a Computer Scientist. I'm just on the third chapter but I'm getting stuck on this question: Fill in the body of the function definition for cat_n_times so that it will print the string, s, n times: def cat_n_times(s, n): Save

Re: [Tutor] textbook question

2011-02-27 Thread michael scott
Hi, Justin, how are you? Most of the nice people here like to see that you try before you ask for help. So next time post some code that you have tried (and failed on) so they can see WHERE you are going wrong or WHAT is throwing you off. I'm a beginner too, also I am using How to Think Like a

Re: [Tutor] textbook question

2011-02-27 Thread delegbede
Nice job, Michael. The way it is, you have done the best anyone here would do to answer that question. Justin, in addition to what Michael said, note too that functions don't have to span hundreds of lines. def Useless(): pass That's a function correctly defined but does nothing. Havin

Re: [Tutor] Converting .pyd to .so

2011-02-27 Thread Stefan Behnel
fall colors, 28.02.2011 03:25: > Stefan Behnel wrote: Well, there's Wine, a free implementation of Windows for Unix systems. You can either try to load the DLL using Wine and ctypes (I suspect that's the hard way), or just run the Windows Python distribution through Wine and load the wrapper .pyd