default argument in method

2010-12-12 Thread ernest
Hi,

I'd like to have a reference to an instance attribute as
default argument in a method. It doesn't work because
"self" is not defined at the time the method signature is
evaluated. For example:

class C(object):
def __init__(self):
self.foo = 5
def m(self, val=self.foo):
return val

Raises NameError because 'self' is not defined.
The obvious solution is put val=None in the signature
and set val to the appropriate value inside the method
(if val is None: ...), but I wonder if there's another way.

Cheers,
Ernest
-- 
http://mail.python.org/mailman/listinfo/python-list


__getattribute__ hook and len() problem

2010-07-15 Thread ernest
Hi!

I have this class that overrides the __getattribute__ method,
so that it returns the attributes of str(self) instead of the
attributes of self.

class Part(object):
def __init__(self):
self.content = []
def __str__(self):
return str.join('\n', self.content)
def __getattribute__(self, name):
if name in ['content', 'write', '__str__']:
return object.__getattribute__(self, name)
else:
return str(self).__getattribute__(name)
def write(self, data):
self.content.append(data)

Then I do:

In [50]: p = Part()

In [51]: p.write('foo')

In [52]: p.upper()
Out[56]: 'FOO'

This is okay, works as expected.

However, len(p) fails:

TypeError: object of type 'Part' has no len()

And yet, p.__len__() returns 3. I though len(object) simply
called object.__len__.

Can somebody shed some light on this??

Many thanks in advance.

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


Re: __getattribute__ hook and len() problem

2010-07-15 Thread ernest
Thanks Chris & Christian.
Mistery solved :)

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


Re: Q for Emacs users: code-folding (hideshow)

2010-07-16 Thread ernest
On 15 Jul, 18:45, kj  wrote:
> This is a question _for Emacs users_ (the rest of you, go away :)  ).
>
> How do you do Python code-folding in Emacs?
>
> Thanks!
>
> ~K

I tried the outline-mode and it seemed to work. It can
collapse different blocks of code, such as functions,
classes, etc.

However, I never got used to it because of the bizarre
key bindings.

Bye.

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


expression in an if statement

2010-08-18 Thread ernest
Hi,

In this code:

if set(a).union(b) == set(a): pass

Does Python compute set(a) twice?
Thanks in advance.

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


Re: expression in an if statement

2010-08-19 Thread ernest
On 19 Ago, 08:40, Frederic Rentsch  wrote:
> On Thu, 2010-08-19 at 00:12 +0200, Thomas Jollans wrote:
> > On Wednesday 18 August 2010, it occurred to John Nagle to exclaim:
> > > On 8/18/2010 11:24 AM, ernest wrote:
> > > > Hi,
>
> > > > In this code:
>
> > > > if set(a).union(b) == set(a): pass
>
> > > > Does Python compute set(a) twice?
>
> > >     CPython does.  Shed Skin might optimize.  Don't know
> > > about Iron Python.
>
> > I doubt any actual Python implementation optimizes this -- how could it?
>
> And why should it if a programmer uses its facilities inefficiently. I
> would write
>
> >>> if set(a).issuperset (b): pass
>
> Frederic

Yes, maybe the example is silly, but situations like this arise
frequently and it's good to know.

Thanks for the answers.

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


in place functions from operator module

2010-08-29 Thread ernest
Hi,

The operator module provides separate functions for
"in place" operations, such as iadd(), isub(), etc.
However, it appears that these functions don't really
do the operation in place:

In [34]: a = 4

In [35]: operator.iadd(a, 3)
Out[35]: 7

In [36]: a
Out[36]: 4

So, what's the point? If you have to make the
assignment yourself... I don't understand.

Cheers,
Ernest
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: in place functions from operator module

2010-08-29 Thread ernest
On 29 Ago, 17:00, Peter Otten <[email protected]> wrote:
> ernest wrote:
> > The operator module provides separate functions for
> > "in place" operations, such as iadd(), isub(), etc.
> > However, it appears that these functions don't really
> > do the operation in place:
>
> > In [34]: a = 4
>
> > In [35]: operator.iadd(a, 3)
> > Out[35]: 7
>
> > In [36]: a
> > Out[36]: 4
>
> > So, what's the point? If you have to make the
> > assignment yourself... I don't understand.
>
> Integers are immutable, and for instances a of immutable types
>
> a += b
>
> is equivalent to
>
> a = a + b
>
> For mutable types like list add() and iadd() may differ:
>
> >>> a = ["first"]
> >>> operator.iadd(a, [42])
> ['first', 42]
> >>> a
>
> ['first', 42]
>
> >>> a = ["first"]
> >>> operator.add(a, [42])
> ['first', 42]
> >>> a
>
> ['first']

It makes sense now. Thank you :)

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


what should __iter__ return?

2010-09-03 Thread ernest
Hi,

What is better:

def __iter__(self):
for i in len(self):
yield self[i]

or

def __iter__(self):
return iter([self[i] for i in range(len(self))])

The first one, I would say is more correct,
however what if in a middle of an iteration
the object changes in length? Then, the
iterator will fail with IndexError (if items
have been removed), or it will fail to iterate
over the whole sequence (if items have
been added).

What do you think?

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


raise Exception or raise Exception()

2010-11-14 Thread ernest
I have seen both forms and I'm not sure if they're
both correct, or one is right and the other wrong.
In practical terms, the two of them seem to have
the same effect.

Cheers,
Ernest
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: TextWrangler "run" command not working properly

2011-04-14 Thread Ernest Obusek
I'm not a python expert, but you might trying running 'print sys.path' inside 
your script and run that from TextWrangler to see where it's looking for 
modules.

- Ernest


On Apr 14, 2011, at 5:01 PM, Jon Clements wrote:

> On Apr 14, 9:52 pm, Fabio  wrote:
>> Hi to all,
>> I have troubles with TextWrangler "run" command in the "shebang" (#!)
>> menu.
>> I am on MacOSX 10.6.7.
>> I have the "built-in" Python2.5 which comes installed by "mother Apple".
>> Then I installed Python2.6, and left 2.5 untouched (I was suggested to
>> leave it on the system, since "something might need it").
>> 
>> I ran the "Update Shell Profile.command", and now if I launch "python"
>> in the terminal it happily launches the 2.6 version.
>> Then I installed some libraries (scipy and matplotlib) on this newer 2.6
>> version.
>> They work, and everything is fine.
>> 
>> Then, I started to use TexWrangler, and I wanted to use the "shebang"
>> menu, and "run" command.
>> I have the "#! first line" pointing to the 2.6 version.
>> It works fine, as long as I don't import the libraries, in which case it
>> casts an error saying:
>> 
>> ImportError: No module named scipy
>> 
>> Maybe for some reason it points to the old 2.5 version.
>> But I might be wrong and the problem is another...
>> 
>> I copy here the first lines in the terminal window if i give the "run in
>> terminal" command
>> 
>> Last login: Thu Apr 14 22:38:26 on ttys000
>> Fabio-Mac:~ fabio$
>> /var/folders/BS/BSS71XvjFKiJPH3Wqtx90k+++TM/-Tmp-/Cleanup\ At\
>> Startup/untitled\ text-324506443.860.command ; exit;
>> Traceback (most recent call last):
>>   File "/Users/fabio/Desktop/test.py", line 3, in 
>> import scipy as sp
>> ImportError: No module named scipy
>> logout
>> 
>> [Process completed]
>> 
>> where the source (test.py) contains just:
>> 
>> #!/usr/bin/python2.6
>> 
>> import scipy as sp
>> 
>> print "hello world"
>> 
>> Any clue?
>> 
>> Thanks
>> 
>> Fabio
> 
> http://www.velocityreviews.com/forums/t570137-textwrangler-and-new-python-version-mac.html
> ?
> -- 
> http://mail.python.org/mailman/listinfo/python-list

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


Unicode strings as arguments to exceptions

2014-01-16 Thread Ernest Adrogué
Hi,

There seems to be some inconsistency in the way exceptions handle Unicode
strings.  For instance, KeyError seems to not have a problem with them

>>> raise KeyError('a')
Traceback (most recent call last):
  File "", line 1, in 
KeyError: 'a'
>>> raise KeyError(u'ä')
Traceback (most recent call last):
  File "", line 1, in 
KeyError: u'\xe4'

On the other hand ValueError doesn't print anything.

>>> raise ValueError('a')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: a
>>> raise ValueError(u'ä')
Traceback (most recent call last):
  File "", line 1, in 
ValueError

I'm using Python 2.7.6 on a Unix machine.
-- 
https://mail.python.org/mailman/listinfo/python-list


Fwd: Re: Cannot remove this program from my computer

2006-08-21 Thread ERNEST SMITH
Note: forwarded message attached.--- Begin Message ---
Please send to the correct address: [EMAIL PROTECTED]

On 08/14/2006 08:21 AM, ERNEST SMITH wrote:
> Everytime I try to remove this Python program from my Add or Remove
> Program List, the error comes up saying could not open INSTALL.Log
> File.  There are 2 Python programs on my computer, they are , Python
> 2.2.1, and Python 2.2 combined Win32 extensions.  What is going on?
>  
> Thanks for any help that you can give me.  I'm not even sure how these
> programs were installed on my computer nor do I know what they are for.?
>  
> sincerely,
>  
> Consuella


-- 
Sjoerd Mullender



signature.asc
Description: OpenPGP digital signature
--- End Message ---
-- 
http://mail.python.org/mailman/listinfo/python-list

how do I write a scliceable class?

2010-02-13 Thread Ernest Adrogué
Hello everybody,

I'm designing a container class that supports slicing.
The problem is that I don't really know how to do it.

class MyClass(object):
def __init__(self, input_data):
self._data = transform_input(input_data)
def __getitem__(self, key):
if isinstance(key, slice):
# return a slice of self
pass
else:
# return a scalar value
return self._data[key]

The question is how to return a slice of self.
First I need to create a new instance... but how? I can't
use MyClass(self._data[key]) because the __init__ method
expects a different kind of input data.

Another option is

out = MyClass.__new__(MyClass)
out._data = self._data[key]
return out

But then the __init__ method is not called, which is
undesirable because subclasses of this class might need
to set some custom settings in their __init__ method.

So what is there to do? Any suggestion?

Cheers.

Ernest

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


Re: how do I write a scliceable class?

2010-02-13 Thread Ernest Adrogué
Hi,

Thanks a lot for your comments. I think I've got enough
information to make a decision now.

13/02/10 @ 15:16 (+0100), thus spake Peter Otten:
> Ernest Adrogué wrote:
> 
> > I'm designing a container class that supports slicing.
> > The problem is that I don't really know how to do it.
> > 
> > class MyClass(object):
> > def __init__(self, input_data):
> > self._data = transform_input(input_data)
> > def __getitem__(self, key):
> > if isinstance(key, slice):
> > # return a slice of self
> > pass
> > else:
> > # return a scalar value
> > return self._data[key]
> > 
> > The question is how to return a slice of self.
> > First I need to create a new instance... but how? I can't
> > use MyClass(self._data[key]) because the __init__ method
> > expects a different kind of input data.
> > 
> > Another option is
> > 
> > out = MyClass.__new__(MyClass)
> > out._data = self._data[key]
> > return out
> > 
> > But then the __init__ method is not called, which is
> > undesirable because subclasses of this class might need
> > to set some custom settings in their __init__ method.
> > 
> > So what is there to do? Any suggestion?
> 
> Either 
> 
> (1) make transform_input() idempotent, i. e. ensure that
> 
> transform_input(transform_input(data)) == transform_input(data)
> 
> and construct the slice with MyClass(self._data[key])
> 
> or 
> 
> (2) require it to be invertible with
> 
> inverse_transform_input(transform_input(data)) == data
> 
> and make the slice with MyClass(inverse_transform_input(self._data[key]))
> 
> Just stating the obvious...
> 
> Peter
> -- 
> http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Error running the exe file in Windows "Failed to execute script pyi_rth_pkgres"

2016-08-10 Thread Ernest Bonat, Ph.D.
Hi,

I have fixed this problem by following the steps:

1. Uninstall the PyInstaller downloaded from http://www.pyinstaller.org/
pip install pyinstaller

2. Install the PyInstaller from the GitHub developer repository
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip

Still not clear to me why the main site http://www.pyinstaller.org/ does
not have the latest release?

Thanks

Ernest Bonat, Ph.D.
Senior Software Engineer
Senior Data Scientist

On Sun, Aug 7, 2016 at 8:03 AM, Ernest Bonat, Ph.D. 
wrote:

>  Hi,
>
>  I have created a simple Python program including the following packages:
>
> import numpy as np
>  import matplotlib.pyplot as plt
>  import pandas as pd
>
>  if __name__ == '__main__':
> print("Hi!")
>
>  I have created the installation package using PyInstaller with the
> following command line:
>
>  pyinstaller --onedir --name=appname --windowed "C:\appname.py"
>
>  The required folders (build and dist) and the spec file are created
> properly with no errors. When I run the appname.exe file I got the error
> "Failed to execute script pyi_rth_pkgres".
>
>  I'm using the following now:
>
>- Anaconda3 4.1.1.64-bit
>- Python 3.5.2
>- PyInstaller 3.2
>- Windows 10 64-bit
>
>  Any help is very appreciated. Feel free to contact me at any time you
> need.
>
>  Thank you,
>
>  Ernest Bonat, Ph.D.
>  Senior Software Engineer
>  Senior Data Scientist
>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Generate reports in Python

2016-08-10 Thread Ernest Bonat, Ph.D.
Hi,

I'm looking for best modules/practices to generate reports (HTML, PDF, etc)
in Python. Good ideas are very appreciated.

Thanks

Ernest Bonat, Ph.D.
Senior Software Engineer
Senior Data Scientist
-- 
https://mail.python.org/mailman/listinfo/python-list


Error running an exe file in Windows with reportlab import

2016-08-12 Thread Ernest Bonat, Ph.D.
I have created a simple Python program including the following packages:



import numpy as np

import matplotlib.pyplot as plt

import pandas as pd

from reportlab.pdfgen import canvas



if __name__ == '__main__':

print("Hi!")



I have created the installation package (PyInstaller) using the following
command line:



pyinstaller --onedir --name=runatestapp --noupx
"C:\Users\Ernest\workspace\bars\src\run_a_test.py"



The required folders (build and dist) and the spec file are created
properly with no errors. When I run the runatestapp.exe file in the command
prompt I got the error "Failed to execute script run_a_test".



I'm using the following software versions now:



Anaconda3 4.1.1.64-bit

Python 3.5.2

PyInstaller 3.2

Windows 10 64-bit



Here is the Traceback info



Traceback (most recent call last):

  File "run_a_test.py", line 4, in 

from reportlab.pdfgen import canvas

  File "", line 969, in _find_and_load

  File "", line 958, in _find_and_load_unlocked

  File "", line 664, in _load_unlocked

  File "", line 634, in
_load_backward_compatible

  File
"C:\Users\Ernest\AppData\Local\Continuum\lib\site-packages\PyInstaller\loader\pyimo

d03_importers.py", line 389, in load_module

exec(bytecode, module.__dict__)

  File "site-packages\reportlab\pdfgen\canvas.py", line 19, in 

  File "", line 969, in _find_and_load

  File "", line 958, in _find_and_load_unlocked

  File "", line 664, in _load_unlocked

  File "", line 634, in
_load_backward_compatible

  File
"C:\Users\Ernest\AppData\Local\Continuum\lib\site-packages\PyInstaller\loader\pyimo

d03_importers.py", line 389, in load_module

exec(bytecode, module.__dict__)

  File "site-packages\reportlab\rl_config.py", line 131, in 

  File "site-packages\reportlab\rl_config.py", line 102, in _startUp

  File "site-packages\reportlab\lib\utils.py", line 695, in rl_isdir

AttributeError: 'FrozenImporter' object has no attribute '_files'

Failed to execute script run_a_test



Any help is much appreciated. Feel free to contact me at any time you need.



Thank you,



Ernest Bonat, Ph.D.

Senior Software Engineer

Senior Data Scientist
-- 
https://mail.python.org/mailman/listinfo/python-list


Error running the exe file in Windows "Failed to execute script pyi_rth_pkgres"

2016-08-07 Thread Ernest Bonat, Ph.D.
 Hi,

 I have created a simple Python program including the following packages:

import numpy as np
 import matplotlib.pyplot as plt
 import pandas as pd

 if __name__ == '__main__':
print("Hi!")

 I have created the installation package using PyInstaller with the
following command line:

 pyinstaller --onedir --name=appname --windowed "C:\appname.py"

 The required folders (build and dist) and the spec file are created
properly with no errors. When I run the appname.exe file I got the error
"Failed to execute script pyi_rth_pkgres".

 I'm using the following now:

   - Anaconda3 4.1.1.64-bit
   - Python 3.5.2
   - PyInstaller 3.2
   - Windows 10 64-bit

 Any help is very appreciated. Feel free to contact me at any time you need.

 Thank you,

 Ernest Bonat, Ph.D.
 Senior Software Engineer
 Senior Data Scientist
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The possibility integration in Python without an equation, just an array-like file

2014-05-16 Thread Ernest Bonat, Ph.D.
Hi Enlong

You may try standard numerical integration solutions based on the E and
T(E) columns data provided.

Ernest Bonat, Ph.D.



On Fri, May 16, 2014 at 1:49 AM, Enlong Liu  wrote:

> Dear All,
>
> I have a question about the integration with Python. The equation is as
> below:
> and I want to get values of I with respect of V. E_F is known. But for
> T(E), I don't have explicit equation, but a .dat file containing
> two columns, the first is E, and the second is T(E). It is also in the
> attachment for reference. So is it possible to do integration in Python?
>
> Thanks a lot for your help!
>
> Best regards,
> ​
>
> --
> Faculty of [email protected]. Leuven
> BIOTECH@TU Dresden
> Email: [email protected]; [email protected];
> [email protected]
> Mobile Phone: +4917666191322
> Mailing Address: Zi. 0108R, Budapester Straße 24, 01069, Dresden, Germany
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
>


-- 
Thanks

Ernest Bonat, Ph.D.
Senior Software Engineer
Senior Business Statistics Analyst
Mobile: 503.730.4556
Email: [email protected]
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The possibility integration in Python without an equation, just an array-like file

2014-05-16 Thread Ernest Bonat, Ph.D.
1. There are a lot of spinet codes in many languages for numerical
integration. I may find a good one in Python for you? try SciPy.org (
http://www.scipy.org/about.html) you may find something there.

2. Look at the wiki too: https://wiki.python.org/moin/NumericAndScientific.

I hope this help a bit!

Ernest Bonat, Ph.D.



On Fri, May 16, 2014 at 10:55 AM, Terry Reedy  wrote:

> On 5/16/2014 4:49 AM, Enlong Liu wrote:
>
>> Dear All,
>>
>> I have a question about the integration with Python.
>>
>
> For numerical integration, you should look as numpy and scipy and perhaps
> associated packages.
>
> --
> Terry Jan Reedy
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>



-- 
Thanks

Ernest Bonat, Ph.D.
Senior Software Engineer
Senior Business Statistics Analyst
Mobile: 503.730.4556
Email: [email protected]
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: IDE for python

2014-05-28 Thread Ernest Bonat, Ph.D.
I believe in IDE with a complete project structure development and
debugging tool. I have to time for a lot of typing. Mi option is Eclipse
IDE with PyDev plugin.

Thanks


On Wed, May 28, 2014 at 9:24 AM, Wolfgang Keller  wrote:

> > With python I got IDLE, but I am not very comfortable with this.
> >
> > Please suggest, if we have any free ide for python development.
>
> There are a lot of IDEs for Python.
>
> One classic is WingIDE. Available for free is a "101" edition. Runs on
> all major operating systems. Implemented itself in Python.
>
> An editor that's completely implemented in Python is Editra. With
> plugins you can turn it into an "almost IDE" as well.
>
> Sincerely,
>
> Wolfgang
> --
> https://mail.python.org/mailman/listinfo/python-list
>



-- 
Thanks

Ernest Bonat, Ph.D.
Senior Software Engineer
Senior Business Statistics Analyst
Mobile: 503.730.4556
Email: [email protected]
-- 
https://mail.python.org/mailman/listinfo/python-list


Is MVC Design Pattern good enough?

2014-06-01 Thread Ernest Bonat, Ph.D.
Hi All,

I had developed many database business applications using MVC design
pattern with different programming languages like PHP, Java EE, VB.NET, C#,
VB 6.0, VBA, etc. All of them defined the Model layer as the data
management of the application domain and business logic implementation. I
ready don’t understand what the data has to do with applications business
logic. Nothing? Can we implement the application business logic in another
layer? Yes or no? Why? Explain?

Thank you all for the inputs!
-- 
Thanks

Ernest Bonat, Ph.D.
Senior Software Engineer
Senior Business Statistics Analyst
Mobile: 503.730.4556
Email: [email protected]
-- 
https://mail.python.org/mailman/listinfo/python-list


Python Error: ImportError: No module named ''folder_name’ at Command Prompt

2015-07-11 Thread Ernest Bonat, Ph.D.
Hi All,


I’m doing a CSV data analysis in Python using Eclipse IDE/PyDev. I have
organized my project using the standard MVC architecture. In Eclipse IDE
everything is working properly. When I run my main.py file it at Command
Prompt I got an error: ImportError: No module named 'folder_name'. It’s
like the location path of the ‘'folder_name’ was not found. Do I need to
update my main.py file to run it at the Command Prompt?


Thank you for all your help,


Thanks

Ernest Bonat, Ph.D.
Senior Software Engineer | Senior Data Analyst
Visual WWW, Inc. | President and CEO
115 NE 39th Avenue | Hillsboro, OR 97124
Cell: 503.730.4556 | Email: [email protected]

*The content of this email is confidential. It is intended only for the use
of the persons named above. If you are not the intended recipient, you are
hereby notified that any review, dissemination, distribution or duplication
of this communication is strictly prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message.*
-- 
https://mail.python.org/mailman/listinfo/python-list


Fwd: Python Error: ImportError: No module named ''folder_name’ at Command Prompt

2015-07-11 Thread Ernest Bonat, Ph.D.
Thanks

Ernest Bonat, Ph.D.
Senior Software Engineer | Senior Data Analyst
Visual WWW, Inc. | President and CEO
115 NE 39th Avenue | Hillsboro, OR 97124
Cell: 503.730.4556 | Email: [email protected]

*The content of this email is confidential. It is intended only for the use
of the persons named above. If you are not the intended recipient, you are
hereby notified that any review, dissemination, distribution or duplication
of this communication is strictly prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message.*

-- Forwarded message --
From: Terry Reedy 
Date: Sat, Jul 11, 2015 at 8:59 PM
Subject: Re: Python Error: ImportError: No module named ''folder_name’ at
Command Prompt
To: "Ernest Bonat, Ph.D." 


Please send this followup to python-list.

On 7/11/2015 11:26 PM, Ernest Bonat, Ph.D. wrote:

> Hey Terry,
>
> Thanks for your help. I had follow the link: How to add a Python module
> to syspath?
> <
> http://askubuntu.com/questions/470982/how-to-add-a-python-module-to-syspath
> >
> and I could not make it work. I did use sys.path.insert() and
> sys.path.append() as:
>
> Examples: sys.path.append('/python_mvc_calculator/calculator/') or
> sys.path.insert(0, "/python_mvc_calculator/calculator")
>
> I did try it to:
> sys.path.append('/python_mvc_calculator/calculator/controller') or
> sys.path.insert(0, "/python_mvc_calculator/calculator/controller") too!
>
> The main.py file is in python_mvc_calculator/calculator folder and I
> need to import a module calculatorcontroller.py in
> "python_mvc_calculator/calculator/controller"
>
> I hope this explanation helps a bit!
>
> <
> http://askubuntu.com/questions/470982/how-to-add-a-python-module-to-syspath
> >
>
> Thanks
>
> Ernest Bonat, Ph.D.
> Senior Software Engineer | Senior Data Analyst
> Visual WWW, Inc. | President and CEO
> 115 NE 39th Avenue | Hillsboro, OR 97124
> Cell: 503.730.4556 | Email: [email protected]
> <mailto:[email protected]>
>
> /The content of this email is confidential. It is intended only for the
> use of the persons named above. If you are not the intended recipient,
> you are hereby notified that any review, dissemination, distribution or
> duplication of this communication is strictly prohibited. If you are not
> the intended recipient, please contact the sender by reply email and
> destroy all copies of the original message./
>
> On Sat, Jul 11, 2015 at 5:02 PM, Terry Reedy  <mailto:[email protected]>> wrote:
>
> On 7/11/2015 11:15 AM, Ernest Bonat, Ph.D. wrote:
>
> Hi All,
>
>
> I’m doing a CSV data analysis in Python using Eclipse IDE/PyDev.
> I have
> organized my project using the standard MVC architecture. In
> Eclipse IDE
> everything is working properly. When I run my main.py file it at
> Command
> Prompt I got an error: ImportError: No module named
> 'folder_name'. It’s
> like the location path of the ‘'folder_name’ was not found. Do I
> need to
> update my main.py file to run it at the Command Prompt?
>
>
> 'import module' searches directories on sys.path for a file or
> directory named 'module'.  sys.path starts with '.', which
> represents the 'current' directory. If you start with the directory
> containing main.py as current directory and 'folder-name' is in the
> same directory, the import should work.  Otherwise ??? EclipseIDE
> probably modifies the current dir and/or path to make things work.
>
> For any more help, post the OS and locations of main.py,
> folder_name, and python.
>
> --
> Terry Jan Reedy
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Fwd: Python Error: ImportError: No module named ''folder_name’ at Command Prompt

2015-07-11 Thread Ernest Bonat, Ph.D.
Thanks for your help. I had follow the link: How to add a Python module
to syspath?

<http://askubuntu.com/questions/470982/how-to-add-a-python-module-to-syspath
>
and I could not make it work. I did use sys.path.insert() and
sys.path.append() as:

Examples: sys.path.append('/python_mvc_calculator/calculator/') or
sys.path.insert(0, "/python_mvc_calculator/calculator")

I did try it to:
sys.path.append('/python_mvc_calculator/calculator/controller') or
sys.path.insert(0, "/python_mvc_calculator/calculator/controller") too!

The main.py file is in python_mvc_calculator/calculator folder and I
need to import a module calculatorcontroller.py in
"python_mvc_calculator/calculator/controller"

I hope this explanation helps a bit!

<http://askubuntu.com/questions/470982/how-to-add-a-python-module-to-syspath
>

Thanks

Ernest Bonat, Ph.D.
Senior Software Engineer | Senior Data Analyst
Visual WWW, Inc. | President and CEO
115 NE 39th Avenue | Hillsboro, OR 97124
Cell: 503.730.4556 | Email: [email protected]
<mailto:[email protected]>

/The content of this email is confidential. It is intended only for the
use of the persons named above. If you are not the intended recipient,
you are hereby notified that any review, dissemination, distribution or
duplication of this communication is strictly prohibited. If you are not
the intended recipient, please contact the sender by reply email and
destroy all copies of the original message./
-- Forwarded message --
From: Terry Reedy 
Date: Sat, Jul 11, 2015 at 8:59 PM
Subject: Re: Python Error: ImportError: No module named ''folder_name’ at
Command Prompt
To: "Ernest Bonat, Ph.D." 


Please send this followup to python-list.

On 7/11/2015 11:26 PM, Ernest Bonat, Ph.D. wrote:

> Hey Terry,
>
> Thanks for your help. I had follow the link: How to add a Python module
> to syspath?
> <
> http://askubuntu.com/questions/470982/how-to-add-a-python-module-to-syspath
> >
> and I could not make it work. I did use sys.path.insert() and
> sys.path.append() as:
>
> Examples: sys.path.append('/python_mvc_calculator/calculator/') or
> sys.path.insert(0, "/python_mvc_calculator/calculator")
>
> I did try it to:
> sys.path.append('/python_mvc_calculator/calculator/controller') or
> sys.path.insert(0, "/python_mvc_calculator/calculator/controller") too!
>
> The main.py file is in python_mvc_calculator/calculator folder and I
> need to import a module calculatorcontroller.py in
> "python_mvc_calculator/calculator/controller"
>
> I hope this explanation helps a bit!
>
> <
> http://askubuntu.com/questions/470982/how-to-add-a-python-module-to-syspath
> >
>
> Thanks
>
> Ernest Bonat, Ph.D.
> Senior Software Engineer | Senior Data Analyst
> Visual WWW, Inc. | President and CEO
> 115 NE 39th Avenue | Hillsboro, OR 97124
> Cell: 503.730.4556 | Email: [email protected]
> <mailto:[email protected]>
>
> /The content of this email is confidential. It is intended only for the
> use of the persons named above. If you are not the intended recipient,
> you are hereby notified that any review, dissemination, distribution or
> duplication of this communication is strictly prohibited. If you are not
> the intended recipient, please contact the sender by reply email and
> destroy all copies of the original message./
>
> On Sat, Jul 11, 2015 at 5:02 PM, Terry Reedy  <mailto:[email protected]>> wrote:
>
> On 7/11/2015 11:15 AM, Ernest Bonat, Ph.D. wrote:
>
> Hi All,
>
>
> I’m doing a CSV data analysis in Python using Eclipse IDE/PyDev.
> I have
> organized my project using the standard MVC architecture. In
> Eclipse IDE
> everything is working properly. When I run my main.py file it at
> Command
> Prompt I got an error: ImportError: No module named
> 'folder_name'. It’s
> like the location path of the ‘'folder_name’ was not found. Do I
> need to
> update my main.py file to run it at the Command Prompt?
>
>
> 'import module' searches directories on sys.path for a file or
> directory named 'module'.  sys.path starts with '.', which
> represents the 'current' directory. If you start with the directory
> containing main.py as current directory and 'folder-name' is in the
> same directory, the import should work.  Otherwise ??? EclipseIDE
> probably modifies the current dir and/or path to make things work.
>
> For any more help, post the OS and locations of main.py,
> folder_name, and python.
>
> --
> Terry Jan Reedy
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Ossaudiodev in Windows

2006-03-12 Thread Ernest G Ngaruiya
I got some code for playin g sounds using python. The code was meant for 
alinux platform and so if I use it on Windows, it says there is no module 
named ossaudiodev. I'd like to try this out on windows. Could someone help 
me out? What's an alternative

Thanks,
Email me at [EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list