* Jay Loden <[EMAIL PROTECTED]> [2005-07-11 22:30]:
> I have an app that takes a command line argument of -l or --list. It uses
> the
> getopt module to parse the arguments, and I just noticed that for some
> reason, getopt is matching "--lis" or "--li" etc to "--list". (Code pasted in
> below
I have an app that takes a command line argument of -l or --list. It uses the
getopt module to parse the arguments, and I just noticed that for some
reason, getopt is matching "--lis" or "--li" etc to "--list". (Code pasted in
below)
Is this normal behavior, and if so, is there any way to avoi
I have an app that takes a command line argument of -l or --list. It uses the
getopt module to parse the arguments, and I just noticed that for some reason,
getopt is matching "--lis" or "--li" etc to "--list". (Code pasted in below)
Is this normal behavior, and if so, is there any way to avoid
Alessandro Brollo wrote:
> Abnormal \r characters inside a .csv text file raise
> an error when the file is read by csv.reader() (Python
> 2.3).
>
> This is a warning to newbies like me and a question
> for experts: is it a bug into csv module?
This has been reported as a bug.
http://sourceforge.
So I have been trying to figure out how to get around doing getters
and setters and still have an oo way to inherit and apply business
rules. This is what I have some up with so far. Is there any better
way?
class RuleViolationError(Exception):
def __init__(self, msg):
self.msg = msg
Abnormal \r characters inside a .csv text file raise
an error when the file is read by csv.reader() (Python
2.3).
I'm sending the following files:
test.txt : a "csv"-like text file with a \r
character;
test1.txt : same file, with an x replacing \r;
example.txt: the hard copy of my Python shell
> module import name': is there a performance hit to consider when
> importing the entire module rather than just getting the specific
> niceFunction()?
Not significant. Basically import module puts the module name
into the local names dictionary. "from m import f" puts f into
the dictionar
> I guess it could be easier to replace the implementation,
> for example if you split a module you could change
> from module import Name1, Name1
> to
> from module1 import Name1
> from module2 import Name2
> and the rest of the client code wouldn't have to change.
Thats true, but OTOH it's nmuc
> I'm confused. I was just reading the URL below..
>
> http://jaynes.colorado.edu/PythonGuidelines.html
Me too. :-)
> and this statement confused me: "Always use from module import Name,
> Name2, Name3.. syntax instead of import module or from module import
> *. This is more efficient, reduces
> Subject:
> Re: [Tutor] Confused "from module import Name" better than "import module"?
> From:
> Kent Johnson <[EMAIL PROTECTED]>
> Date:
> Mon, 11 Jul 2005 12:30:16 -0400
>
> CC:
> tutor@python.org
>
>
> Mike Hansen wrote:
>
>> I'm confused. I was just reading the URL below..
>>
>> http://ja
Kent Johnson wrote:
>
> This is good stuff to understand, but really, it isn't going to make an
> appreciable difference in most applications. Where it does matter, for
> example if func() is called many times in a loop, the best solution will
> probably be to bind func to a local variable whi
Danny Yoo wrote:
>>nltk is looking for a module called numarray that is not part of the
>>standard Python distribution. Do you have numarray installed? Look for
>>C:\Python24\Lib\site-packages\numarray. If you don't have it then
>>download numarray from C:\Python24\Lib\site-packages\numarray and
>>
Matt Richardson wrote:
> I have a question about 'import module' versus 'from
> module import name': is there a performance hit to consider when
> importing the entire module rather than just getting the specific
> niceFunction()?
I can't imagine that there is a performance difference that wou
> nltk is looking for a module called numarray that is not part of the
> standard Python distribution. Do you have numarray installed? Look for
> C:\Python24\Lib\site-packages\numarray. If you don't have it then
> download numarray from C:\Python24\Lib\site-packages\numarray and
> install it accord
Kent Johnson wrote:
> from module import * is problematic and discouraged. It causes namespace
> pollution and makes it harder to find out where a name is defined.
>
> Other than that I think it is personal preference.
>
I have avoided the 'from module import *' style for the reasons you
ment
Mike Hansen wrote:
> I'm confused. I was just reading the URL below..
>
> http://jaynes.colorado.edu/PythonGuidelines.html
>
> and this statement confused me: "Always use from module import Name, Name2,
> Name3.. syntax instead of import module or from module import *. This is more
> efficient,
I'm confused. I was just reading the URL below..
http://jaynes.colorado.edu/PythonGuidelines.html
and this statement confused me: "Always use from module import Name, Name2,
Name3.. syntax instead of import module or from module import *. This is more
efficient, reduces typing in the rest of th
Hey all
I had some problems with this module too but I aas able with your help to
make a script that works
Here it is:
from distutils.core import setup
import py2exe, sys, os
sys.argv.append('py2exe')
##setup(
##windows = [{'script': "NovusExtension.pyw"}],
##)
setup(
console = [{'scrip
enas khalil wrote:
> when i write a code to import some module like the following :
>
>
> from nltk.probability import ConditionalFreqDist
>
> I got the error :
>
> Traceback (most recent call last):
> File "C:\Python24\toky.py", line 1, in -toplevel-
> from nltk.probability import Co
when i write a code to import some module like the following :
from nltk.probability import ConditionalFreqDist
I got the error :
Traceback (most recent call last): File "C:\Python24\toky.py", line 1, in -toplevel- from nltk.probability import ConditionalFreqDist File "C:\Python24\Lib
Alan G wrote:
>> Here's an error message:
>>
>> File "D:\GC.py", line 78
>> cal_opt = cal_menu()
>> ^
>> SyntaxError: invalid syntax
>>
>> The relevant code:
>>
>> option = main_menu()
>> if option == 1:
>> cal_menu()
>> cal_opt = cal_menu()
>
>
> Consistent indentation is
21 matches
Mail list logo