Re: paramiko.BadAuthenticationType

2012-12-06 Thread who
FWIW, I'm trying to write a python program that does the equivalent this perl 
program:

http://devcentral.f5.com/downloads/iControl/SDK/sslvpn.public.pl.txt

I don't see any code there that refers to a public key, but it works fine.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Doc Error: os.makedirs

2005-10-19 Thread Dr. Who

Xah Lee wrote:
> i think the function shouldn't complain if dir already exists. How is a
> programer to distinguish if the dir already exists, or if there's a
> problem creating the dir?

Of course it should thrown an exception because it was unable to do
what it was asked: create a directory.  The fact that the directory
already exists is irrelevant to the function...it still failed to
create the directory.

And I have had situations where attempting to create a directory that
already exists was an error condition.

Jeff

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


Buffering problem using subprocess module

2005-07-21 Thread Dr. Who
I am using the subprocess module in 2.4.  Here's the fragment:

bufcaller.py:
import sys, subprocess
proc = subprocess.Popen('python bufcallee.py', bufsize=0, shell=True,
stdout=subprocess.PIPE)
for line in proc.stdout:
sys.stdout.write(line)

bufcallee.py:
import time
print 'START'
time.sleep(10)
print 'STOP'

Although the documentation says that the output should be unbuffered
(bufsize=0) the program (bufcaller) pauses for 10 seconds and then
prints START immediately followed by 'STOP' rather than pausing 10
seconds in between them.  Note that I made bufcallee a Python script
for ease of the example but in the real-world problem I am trying to
solve it is simply an executable.

Any ideas?
Jeff

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


Re: Buffering problem using subprocess module

2005-07-21 Thread Dr. Who
Unfortunatley that doesn't help.  Even when callee is started using the
-u, I get the same behavior.

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


Something that Perl can do that Python can't?

2005-07-22 Thread Dr. Who
So here it is: handle unbuffered output from a child process.

Here is the child process script (bufcallee.py):
import time
print 'START'
time.sleep(10)
print 'STOP'

In Perl, I do:
open(FILE, "python bufcallee.py |");
while ($line = )
{
print "LINE: $line";
}

in which case I get
LINE: START
followed by a 10 second pause and then
LINE: STOP

The equivalent in Python:
import sys, os

FILE = os.popen('python bufcallee.py')
for line in FILE:
print 'LINE:', line

yields a 10 second pause followed by
LINE: START
LINE: STOP

I have tried the subprocess module, the -u on both the original and
called script, setting bufsize=0 explicitly but to no avail.  I also
get the same behavior on Windows and Linux.

If anyone can disprove me or show me what I'm doing wrong, it would be
appreciated.

Jeff

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


Re: Something that Perl can do that Python can't?

2005-07-22 Thread Dr. Who
Well, I finally managed to solve it myself by looking at some code.
The solution in Python is a little non-intuitive but this is how to get
it:

while 1:
line = stdout.readline()
if not line:
break
print 'LINE:', line,

If anyone can do it the more Pythonic way with some sort of iteration
over stdout, please let me know.

Jeff

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


Re: On fighting fire with fire...

2005-07-29 Thread Dr. Who
I was explaining the difference between irony and sarcasm to my
daughter just the other day.  It was nice of Asad to provide us with
such a besutiful example.  Not that I'm sure that was his intent...

Jeff

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


HTML/text formatting question

2005-08-03 Thread Dr. Who
I have a tool that outputs data in either html or text output.

Currently I'm writing chucnks like:

if html:
print ''
print ''
print ''
print 'Differences %s: %s' % (htypestr, lbl1)
if html:
...

This seems clunky and my next step was going to be to define generic
functions which would generate the surrounding html tags only when
passed the proper argument.  I was wondering if there was a better way
to do this with a standard Python library.  It looked like formatter
might but that it also might be too low-level.

Any help is appreciated,
Jeff

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


Problem building Python on HP-UX

2005-09-02 Thread Dr. Who
I'm trying to build Python 2.4.1 on HP-UX 11.00 with full tcl/tk IDLE
support.  So far, I haven't had any luck.  I always wind up getting
errors of the form:

ld: DP relative code in file
/ptg/devtools/hppa1.1/pre/lib/libtk8.4.a(tkWindow.o) - shared library
must be position independent.  Use +z or +Z to recompile.

I have tried building tcl/tk without any configure options as well as
with --disable-shared and --disable-load but this doesn't help.

Anyone seen anything like this or know how to get around it?

Jeff

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


Re: Best IDE for Python

2006-08-15 Thread Bruce Who
Hi, sjdevnull

I'm a vimmer too, and I wonder what plugins you are using. What you
said sounds interesting. Could you tell us more about the plugins?
"Object browser" is what I need most, but so far I've no idea what
plugin can do this for me, :-(

On 14 Aug 2006 15:02:13 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Yu-Xi Lim wrote:
> > Eclipse+PyDev has the advantage over emacs when it comes to big
> > projects, IMO. It has features like refactoring, better project
> > management, code coverage
>
> Emacs and vim both have good integration of BicycleRepairMan for python
> refactoring.  I don't know what better project management or code
> coverage in eclipse entail, but I've posted before that if you think
> vim/emacs are just syntax highlighting/indenting text editors you've
> got them misconfigured.
>
> The beautiful thing about vim in particular is that it uses Python as
> an internal scripting language, so it's very easy to extend it to add
> whatever you want.
>
> e.g. in vim I get
> * Syntax checking, if I type invalid python code it gets highlighted as
> an error (if I type, say, "if a=1:" and hit return, it gets highlighted
> since I need an == there).
> * Object browser, with dropdowns showing the parent and child classes
> of the current class, and the ability to jump to various class methods
> * Normal tag-jump stuff, so I can drill down into the method/function
> call I'm looking at and then pop back up (keeping a stack so I can
> drill down arbitrarily deep to follow the flow of the code)
> * Interactive help, so when, say, I type foo.blah( then the status line
> displays the first line of the docstring/python doc/preceding comment
> for foo.blah.  E.g. if I type "cmp(" then the status line shows "cmp(x,
> y) Compare the two objects X and Y and return an integer according to
> ..." and if I hit F1 then I get the full help text
> * Editor control for uncaught errors--if I code I'm debugging raises an
> uncaught exception, the editor jumps directly to it.  Even works for
> web development, if I hit a page in my dev server that raises an
> exception, it brings my editor right there.
>
> and lots more (version control integration, easy mapping of keys to
> restart the webserver after I make changes, etc).  And there's some
> internal crap (e.g. we work on lots of clients who have client-specific
> versions of some objects; I have a client menu so that if I pick one,
> then I'll jump to their client-specific version of the current file (or
> the base generic version if there isn't a specific one), tags will
> follow the right client versions, etc).
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [ANN] NumPy 1.0b4 now available

2006-08-28 Thread Bruce Who
Hi, Travis

I can pack my scripts into an executable with py2exe, but errors occur
once it runs:

No scipy-style subpackage 'random' found in D:\test\dist\numpy.
Ignoring: No module named info
import core -> failed: No module named _internal
import lib -> failed: 'module' object has no attribute '_ARRAY_API'
import linalg -> failed: 'module' object has no attribute '_ARRAY_API'
import dft -> failed: 'module' object has no attribute '_ARRAY_API'
Traceback (most recent call last):
  File "main.py", line 9, in ?
  File "numpy\__init__.pyc", line 49, in ?

  File "numpy\add_newdocs.pyc", line 2, in ?
gkDc
  File "numpy\lib\__init__.pyc", line 5, in ?

  File "numpy\lib\type_check.pyc", line 8, in ?

  File "numpy\core\__init__.pyc", line 6, in ?

  File "numpy\core\umath.pyc", line 12, in ?

  File "numpy\core\umath.pyc", line 10, in __load

AttributeError: 'module' object has no attribute '_ARRAY_API'


This is the main.py file:
#===
# filename:main.py
import wx
import numpy

class myFrame(wx.Frame):
def __init__(self, *args, **kwds):
wx.Frame.__init__(self, *args, **kwds)
##-- your widgets
##-- put stuff into sizer
self.sizer_ = wx.BoxSizer(wx.VERTICAL)
## self.sizer_.Add(your_ctrl, proportion = 1, flag = wx.EXPAND)

## apply sizer
self.SetSizer(self.sizer_)
self.SetAutoLayout(True)

def main():## {{{
app = wx.PySimpleApp(0)
frame = myFrame(None, -1, title = '')
frame.Show(True)
app.SetTopWindow(frame)
app.MainLoop()
##   }}}

if __name__ == "__main__":main()
#===
# filename:setup.py
import glob
import sys

from distutils.core import setup
import py2exe

includes = ["encodings",
"encodings.*",
   ]

excludes = ["javax.comm"]

options = {
"py2exe":
{
#"compressed": 1,
#"optimize": 0,
#"bundle_files":2,
"skip_archive":1,
"includes": includes,
'excludes': excludes
}
  }

setup(
version = "0.1",
description = "",
name = "test",
options = options,
windows = [
{
"script":"main.py",
}
],
#zipfile = None,
)


and I run this command to compile the scripts:
python setup.py py2exe

and all packages I use are:
python2.4.3
numpy-0.98
py2exe-0.6.5
wxpython-2.6.3.2

I unistalled Numeric before I compiled scripts.

If you google "numpy py2exe", you can find others guys stumbled by the
same issue with ease:

http://aspn.activestate.com/ASPN/Mail/Message/py2exe-users/3249182
http://www.nabble.com/matplotlib,-numpy-and-py2exe-t1901429.html

I just hope this can be fixed in the next table release of numpy.

On 8/29/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:
> bruce.who.hk wrote:
> > Hi, Travis
> >
> > I just wonder if NumPy 1.0b4 can get along with py2exe? Just a few weeks 
> > ago I made a application in Python. At first I used Numpy, it works OK, but 
> > I cannot pack it into a workable executable with py2exe and the XXX.log 
> > saied that numpy cannot find some module. I found some hints in py2exe 
> > wiki, but it still doesn't work. At Last I tried Numeric instead and it got 
> > OK. I just hope that you donnot stop the maintenance of Numeric before you 
> > are sure that Numpy can work with py2exe.
> >
> We've already stopped maintenance of Numeric nearly 1 year ago.If
> NumPy doesn't work with py2exe then we need help figuring out why.  The
> beta-release period is the perfect time to fix that.  I've never used
> py2exe myself, but I seem to recall that some have been able to make it
> work.
>
> The problem may just be listing the right set of modules to carry along
> because you may not be able to get that with just the Python-side
> imports.  Post any errors you receive to
> [email protected]
>
> Thanks,
>
>
> -Travis
>
>


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


File locking

2007-03-12 Thread Dr. Who
I'm always disappointed when I find something that Python doesn't
handle in a platform independent way.  It seems to me that file
locking is in that boat.

1. I don't see a way to atomically open a file for writing if and only
if it doesn't exist without resorting to os.open and specialized
platform O_XXX flags.

2. I don't see a way to atomically open a file for writing and obtain
a lock on the file.

3. I don't see a platform independent way to obtain a lock on a file.
You have to do something goofy like
if sys.platform == win32:
import msvcrt
else:
import fcntl
and then similar things to call the correct functions with the correct
flags.

Please let me know if I'm missing something since they seem like
normal file operations that I would hope Python would abstract away.
If not, are there any PEPs concerning this for Python3K?

Thanks,
Jeff

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


Re: On Java's Interface (the meaning of interface in computer programing)

2007-03-21 Thread Dr. Who
Don't Feed The Trolls :-)

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


Re: What about this?

2007-01-12 Thread Dr. Who
What's more amazing is that anyone would click on the link at all given
the increasing number of website that provide hidden content that tries
to deliver spyware or viruses just by getting visitors.

Jeff

Bjoern Schliessmann wrote:
> new wrote:
>
> > www.magicoz.com
> > amazing
>
> Yeah, it *is* really amazing that someone dares to spam for such an
> unprofessional homepage. Even too stupid to include a doctype ...
> 
> 
> Björn
> 
> -- 
> BOFH excuse #61:
> 
> not approved by the FCC

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


Re: Is Welfare Part of Capitalism?

2006-05-10 Thread Dr. Who
Technically, I would call it a manfesto.  The manifesto module is
probably the most facinating module in Python since it's the only one
whose functions consist entirely of doc strings followed by a pass and
do no useful work.

Jeff

Tim Daneliuk wrote:
> [EMAIL PROTECTED] wrote:
> > This article is dedicated to:
> >
> 
> 
> 
> But I am still confused:  Is this a statement or an expression?

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


I get the error: ImportError: No module named ffnet

2010-03-11 Thread Cal Who


I have the .py file in Eclipse
#...@pydevcodeanalysisignore
from ffnet import ffnet, mlgraph
topology = mlgraph( (2, 3, 1) )
nn = ffnet(topology)

I select RunAs / Python Run

I get the error
from ffnet import ffnet, mlgraph
ImportError: No module named ffnet

In the folder Python26\lib\site-packages I see
ffnet-0.6.2-py2.6.egg-info

also a folder ffnet
in that folder there is a folder Examples
If I click one of the examples pyrhon.exe opens and runs it OK.

Is there enough in the above for you to tell me how to procede?

Thanks in advance for any help at all



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


Re: I get the error: ImportError: No module named ffnet

2010-03-11 Thread Cal Who
I ran this:
import sys

from pprint import pprint as pp

pp(sys.path)



The output included:

'E:\\Program Files\\Python26',

'E:\\Program Files\\Python26\\DLLs',

'E:\\Program Files\\Python26\\lib',

'E:\\Program Files\\Python26\\lib\\lib-tk',

'E:\\Program Files\\Python26\\lib\\plat-win',

'E:\\Program Files\\Python26\\lib\\site-packages',



Python is at

E:\Python26

but other things like java are at E:\Program Files

Showhow it is looking in the wrong place and I don't know how to fix it.

I checked the registry. The entries all look good there.



Thanks







" Cal Who"  wrote in message 
news:[email protected]...
>
>
> I have the .py file in Eclipse
> #...@pydevcodeanalysisignore
> from ffnet import ffnet, mlgraph
> topology = mlgraph( (2, 3, 1) )
> nn = ffnet(topology)
>
> I select RunAs / Python Run
>
> I get the error
> from ffnet import ffnet, mlgraph
> ImportError: No module named ffnet
>
> In the folder Python26\lib\site-packages I see
> ffnet-0.6.2-py2.6.egg-info
>
> also a folder ffnet
> in that folder there is a folder Examples
> If I click one of the examples pyrhon.exe opens and runs it OK.
>
> Is there enough in the above for you to tell me how to procede?
>
> Thanks in advance for any help at all
>
>
> 


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


Re: I get the error: ImportError: No module named ffnet

2010-03-11 Thread Cal Who
I found out I had something installed wrong.

" Cal Who"  wrote in message 
news:[email protected]...
>
>
> I have the .py file in Eclipse
> #...@pydevcodeanalysisignore
> from ffnet import ffnet, mlgraph
> topology = mlgraph( (2, 3, 1) )
> nn = ffnet(topology)
>
> I select RunAs / Python Run
>
> I get the error
> from ffnet import ffnet, mlgraph
> ImportError: No module named ffnet
>
> In the folder Python26\lib\site-packages I see
> ffnet-0.6.2-py2.6.egg-info
>
> also a folder ffnet
> in that folder there is a folder Examples
> If I click one of the examples pyrhon.exe opens and runs it OK.
>
> Is there enough in the above for you to tell me how to procede?
>
> Thanks in advance for any help at all
>
>
> 


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


Where can I find documentation for data[:,9]

2010-03-11 Thread Cal Who
data = readdata( 'data/input.dat', delimiter = ',' )

input = data[:, :9]#nine data columns



Where can I find documentation for the

data[:,9]

in the code above.

Been looking and found many examples but would like to know the definition.

I need to skip the first column and then read 9



I would also like to print the data in ihe variable "input"



Thanks


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


Re: Where can I find documentation for data[:,9]

2010-03-11 Thread Cal Who

"Robert Kern"  wrote in message 
news:[email protected]...
> On 2010-03-11 13:01 PM,  Cal Who wrote:
>> data = readdata( 'data/input.dat', delimiter = ',' )
>>
>> input = data[:, :9]#nine data columns
>>
>>
>>
>> Where can I find documentation for the
>>
>> data[:,9]
>>
>> in the code above.
>>
>> Been looking and found many examples but would like to know the 
>> definition.
>
> When asking questions like this, it helps *a lot* to provide a complete 
> example, not just a snippet. If I weren't already intimately familiar with 
> the library you are using, I would have no idea how to help you.
>
> However, I do know that input object is a numpy array, and the syntax you 
> are asking about is multidimensional slicing.
>
> http://docs.scipy.org/doc/numpy/reference/arrays.indexing.html
>
>> I need to skip the first column and then read 9
>
> data[:, 1:10]
>
>> I would also like to print the data in ihe variable "input"
>
> print input
>
> -- 
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless 
> enigma
>  that is made terrible by our own mad attempt to interpret it as though it 
> had
>  an underlying truth."
>   -- Umberto Eco
>
Thanks, that helped a lot.

I'm having trouble knowing what to search for to find documenatation. For 
example, is print a Python command, a numpy command or a java command?

I like to read the documentation even if the command is working for me.


Thanks again 


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


Re: Where can I find documentation for data[:,9]

2010-03-11 Thread Cal Who

"Martin P. Hellwig"  wrote in message 
news:[email protected]...
> On 03/11/10 22:08,  Cal Who wrote:
> 
>> Thanks, that helped a lot.
>>
>> I'm having trouble knowing what to search for to find documenatation. For
>> example, is print a Python command, a numpy command or a java command?
>>
>> I like to read the documentation even if the command is working for me.
>>
>>
>> Thanks again
>>
>>
> Probably for you the right way would be to familiarize yourself with the 
> namespace concept of Python, this makes it easier to identify whether 
> something is built-in, a standard module or an external module.
> Which makes it much easier to feed google the right clues.
>
> -- 
> mph

Thanks a lot, I'll look that up now. 


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


What does Error: 'module' object is not callable Mean?

2010-03-14 Thread Cal Who

The below code produces the error as indicated. But, in
 E:\Python26\Lib\site-packages\ffnet\tools I see:
drawffnet.py
drawffnet.pyc
drawffnet.pyo
Is that what it is looking for?

I'm not sure what "not callable" means.
Could it be referencing to "nn" rather than drawffnet?
What should I do to investigate this?

Thanks
from ffnet import ffnet, mlgraph, readdata

...snipped working code here ...

output, regression = nn.test(inputs2, targets2, iprint = 2)

from ffnet.tools import drawffnet
import pylab
drawffnet(nn)   #Error: 'module' object is not callable
pylab.show()
except ImportError, e:
print "Cannot make drawffnet plot." 


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


Re: What does Error: 'module' object is not callable Mean?

2010-03-14 Thread Cal Who

  - Original Message - 
  From: Stephen Hansen 
  To: Cal Who 
  Cc: [email protected] 
  Sent: Sunday, March 14, 2010 2:33 PM
  Subject: Re: What does Error: 'module' object is not callable Mean?


  On Sun, Mar 14, 2010 at 10:20 AM, Cal Who  wrote:
from ffnet.tools import drawffnet
import pylab
drawffnet(nn)   #Error: 'module' object is not callable


  First and foremost, please please please: don't describe or paraphrase 
tracebacks when asking for help, show them. The whole thing. It doesn't 
-really- matter here, but it still applies. 


  I'll keep that in mind but in this instance I simply cut and pasted the 
message.




  That said, "drawffnet" is a module.


  You can't call -- put () on the end of -- a module. Its not a function. Its a 
file containing code.


  Perhaps you mean drawffnet.drawffnet()?



  I copied that code from an example and what you suggested fixed it. 
  Thanks.




  --S


--



  No virus found in this incoming message.
  Checked by AVG - www.avg.com 
  Version: 9.0.733 / Virus Database: 271.1.1/2746 - Release Date: 03/14/10 
03:33:00
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What does Error: 'module' object is not callable Mean?

2010-03-14 Thread Cal Who
Thanks for the replies.
That fixed it but produced another problem.

There are two plotting routines below.
Either one will work without error.
But the combo produces:
The exception unknown software exception (0x4015) occurred in the 
application at location 0x1e05b62a.
in a dialog box and the following in the console
Fatal Python error: PyEval_RestoreThread: NULL tstate


This application has requested the Runtime to terminate it in an unusual 
way.

Please contact the application's support team for more information.

Do you see what isa wrong?

Second question: Is it common to group all the "from" statements at the top 
of the program
or to put them by the relavent code as I have here?

Thanks a lot


try:

#Or we can use the two commented statements

#from ffnet.tools import drawffnet

from ffnet.tools.drawffnet import drawffnet

import pylab

#drawffnet.drawffnet(nn)

drawffnet(nn)

pylab.show()

except ImportError, e:

print "Cannot make drawffnet plot.\n%s" % e


?

?

# Plot adapted from

# http://ffnet.sourceforge.net/examples/stock.html

# Make plot if matplotlib is avialble

try:

from pylab import *

plot( targets2, 'b--' )

plot( output, 'k-' )

legend(('target', 'output'))

xlabel('pattern'); ylabel('benign or malignant')

title('Outputs vs. target of trained network.')

grid(True)

show()

except ImportError, e:

print "Cannot make plots. For plotting install matplotlib.\n%s" % e



?

?


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


Re: What does Error: 'module' object is not callable Mean?

2010-03-14 Thread Cal Who

"MRAB"  wrote in message 
news:[email protected]...
>  Cal Who wrote:
>> The below code produces the error as indicated. But, in
>>  E:\Python26\Lib\site-packages\ffnet\tools I see:
>> drawffnet.py
>> drawffnet.pyc
>> drawffnet.pyo
>> Is that what it is looking for?
>>
>> I'm not sure what "not callable" means.
>> Could it be referencing to "nn" rather than drawffnet?
>> What should I do to investigate this?
>>
>> Thanks
>> from ffnet import ffnet, mlgraph, readdata
>>
>> ...snipped working code here ...
>>
>> output, regression = nn.test(inputs2, targets2, iprint = 2)
>>
>> from ffnet.tools import drawffnet
>> import pylab
>> drawffnet(nn)   #Error: 'module' object is not callable
>> pylab.show()
>> except ImportError, e:
>> print "Cannot make drawffnet plot."
> You're importing the module 'drawffnet' and then trying to call it in:
>
> drawffnet(nn)
>
> but, as the traceback says, modules can't be called.
>
> I had a quick look at the documentation and it looks like you should be
> calling a function called 'drawffnet' that's defined in the module
> called 'drawffnet'. Try doing:
>
> from ffnet.tools.drawffnet import drawffnet
>
> instead.

Thanks, Works great - please see my other post 


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


Re: What does Error: 'module' object is not callable Mean?

2010-03-14 Thread Cal Who

"Terry Reedy"  wrote in message 
news:[email protected]...
> On 3/14/2010 2:20 PM,  Cal Who wrote:
>>
>> The below code produces the error as indicated. But, in
>>   E:\Python26\Lib\site-packages\ffnet\tools I see:
>>  drawffnet.py
>
> drawffnet is a module initialized from drawffnet.py (or either of the 
> below)
>
>>  drawffnet.pyc
>>  drawffnet.pyo
>> Is that what it is looking for?
>>
>> I'm not sure what "not callable" means.
>> Could it be referencing to "nn" rather than drawffnet?
>> What should I do to investigate this?
>>
>> Thanks
>> from ffnet import ffnet, mlgraph, readdata
>>
>> ...snipped working code here ...
>>
>> output, regression = nn.test(inputs2, targets2, iprint = 2)
>>
>> from ffnet.tools import drawffnet
>
> here you create drawffnet from one of the files.
>
>> import pylab
>> drawffnet(nn)   #Error: 'module' object is not callable
>
> This is an attempt to call the module as if it were a functions, which it 
> is not. You probably want to call a function within the module.
Exactly. Thanks it works now. Please see my other post.

>
>
>> pylab.show()
>> except ImportError, e:
>> print "Cannot make drawffnet plot."
>>
>>
>
> 


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


Re: What does Error: 'module' object is not callable Mean?

2010-03-14 Thread Cal Who
I cleaned up the code by moving all the imports to the top.
 There are two plotting routines shown below.
 Either one will work without error.
 But when I include both,  running produces:
 The exception unknown software exception (0x4015) occurred in the
 application at location 0x1e05b62a.
 In a dialog box and the following in the console:
 Fatal Python error: PyEval_RestoreThread: NULL tstate
  This application has requested the Runtime to terminate it in an unusual
 way.
  Please contact the application's support team for more information.

 Do you see what is wrong?

 Thanks a lot

from pylab import plot, legend, title, grid, show, xlabel, ylabel
...snip

#FIRST PLOT
plot( targets2, 'b--' )
plot( output, 'k-' )
legend(('target', 'output'))
xlabel('pattern'); ylabel('benign or malignant')
title('Outputs vs. target of trained network.')
grid(True)
show()

#SECOND PLOT
drawffnet(nn)
show() 


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


Re: What does Error: 'module' object is not callable Mean?

2010-03-14 Thread Cal Who
I found it. Had to use "figure" to create a new figure!


" Cal Who"  wrote in message 
news:[email protected]...
>I cleaned up the code by moving all the imports to the top.
> There are two plotting routines shown below.
> Either one will work without error.
> But when I include both,  running produces:
> The exception unknown software exception (0x4015) occurred in the
> application at location 0x1e05b62a.
> In a dialog box and the following in the console:
> Fatal Python error: PyEval_RestoreThread: NULL tstate
>  This application has requested the Runtime to terminate it in an unusual
> way.
>  Please contact the application's support team for more information.
>
> Do you see what is wrong?
>
> Thanks a lot
>
> from pylab import plot, legend, title, grid, show, xlabel, ylabel
> ...snip
>
> #FIRST PLOT
> plot( targets2, 'b--' )
> plot( output, 'k-' )
> legend(('target', 'output'))
> xlabel('pattern'); ylabel('benign or malignant')
> title('Outputs vs. target of trained network.')
> grid(True)
> show()
>
> #SECOND PLOT
> drawffnet(nn)
> show()
> 


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