New to group

2008-03-24 Thread pythonnubie
Hi  Everyone

I  am new to programming in general although I  have  read alot and
done alot of experimentation  as well  as researched afew languages
namely java python and visual basic . My conclusion  is that  python
is one of the best because it  eliminates the need to learn about
access  modifiers  and  form handlers so  a user can concentrate
primarliy on the nuts and bolts of the language .

i  have  come across my first exeption using randrange . The exeption
is " no such  attribute " in  module random

platform  is xp  home  and the python  build is activestate 2.5

All help much appreciated !

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


Re: New to group

2008-03-24 Thread pythonnubie
On Mar 24, 11:57 am, Jeff <[EMAIL PROTECTED]> wrote:
> What does the code look like?

# Random Access
# Demonstrates string indexing
# Michael Dawson - 1/27/03

import random

word = "index"
print "The word is: ", word, "\n"

high = len(word)
low = -len(word)
for i in range(10):
position = random.randrange(low, high)
print "word[", position, "]\t", word[position]

raw_input("\n\nPress the enter key to exit.")

The  code is an exerp from  a  chm file . I  am petty sutre I  am
nmot  getting  a  char  map error from  the copy/paste ! it looks
simple enough !

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


Re: New to group

2008-03-24 Thread pythonnubie
>
> > i  have  come across my first exeption using randrange . The exeption
> > is " no such  attribute " in  module random
>
> > platform  is xp  home  and the python  build is activestate 2.5
>
> Welcome aboard!
>
> There's definitely a randrange function in the random module, so
> something else must be wrong. To get the most out of this list and
> minimize wasted bandwidth, the most effective way usually consists of
> copying and pasting:
> 1. The offending code (or just the relevant part if it's too big).
> 2. The full traceback of the raised exception.
>
> Regards,
> George

Hwere is the complete traceback ! >>> The word is:  index

Traceback (most recent call last):
  File "F:\Python25\Lib\site-packages\pythonwin\pywin\framework
\scriptutils.py", line 307, in RunScript
debugger.run(codeObject, __main__.__dict__, start_stepping=0)
  File "F:\Python25\Lib\site-packages\pythonwin\pywin\debugger
\__init__.py", line 60, in run
_GetCurrentDebugger().run(cmd, globals,locals, start_stepping)
  File "F:\Python25\Lib\site-packages\pythonwin\pywin\debugger
\debugger.py", line 631, in run
exec cmd in globals, locals
  File "F:\Documents and Settings\Mark\My Documents\rand.py", line 5,
in 
import random
  File "F:\Documents and Settings\Mark\My Documents\random.py", line
13, in 
distributions on the real line:
AttributeError: 'module' object has no attribute 'randrange'
>>>
Why  would it say  it can't find the function ?

Mark


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


Re: New to group

2008-03-24 Thread pythonnubie
On Mar 24, 12:18 pm, George Sakkis <[EMAIL PROTECTED]> wrote:
> On Mar 24, 3:13 pm, pythonnubie <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > > > i  have  come across my first exeption using randrange . The exeption
> > > > is " no such  attribute " in  module random
>
> > > > platform  is xp  home  and the python  build is activestate 2.5
>
> > > Welcome aboard!
>
> > > There's definitely a randrange function in the random module, so
> > > something else must be wrong. To get the most out of this list and
> > > minimize wasted bandwidth, the most effective way usually consists of
> > > copying and pasting:
> > > 1. The offending code (or just the relevant part if it's too big).
> > > 2. The full traceback of the raised exception.
>
> > > Regards,
> > > George
>
> > Hwere is the complete traceback ! >>> The word is:  index
>
> > Traceback (most recent call last):
> >   File "F:\Python25\Lib\site-packages\pythonwin\pywin\framework
> > \scriptutils.py", line 307, in RunScript
> >     debugger.run(codeObject, __main__.__dict__, start_stepping=0)
> >   File "F:\Python25\Lib\site-packages\pythonwin\pywin\debugger
> > \__init__.py", line 60, in run
> >     _GetCurrentDebugger().run(cmd, globals,locals, start_stepping)
> >   File "F:\Python25\Lib\site-packages\pythonwin\pywin\debugger
> > \debugger.py", line 631, in run
> >     exec cmd in globals, locals
> >   File "F:\Documents and Settings\Mark\My Documents\rand.py", line 5,
> > in 
> >     import random
> >   File "F:\Documents and Settings\Mark\My Documents\random.py", line
> > 13, in 
> >     distributions on the real line:
> > AttributeError: 'module' object has no attribute 'randrange'
>
> > Why  would it say  it can't find the function ?
>
> Because you named your file 'random.py' and it shadows the standard
> random module! Change the name to something else, say foo.py, and try
> it again.
>
> George- Hide quoted text -
>
> - Show quoted text -

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


Re: New to group

2008-03-24 Thread pythonnubie
On Mar 24, 12:18 pm, George Sakkis <[EMAIL PROTECTED]> wrote:
> On Mar 24, 3:13 pm, pythonnubie <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > > > i  have  come across my first exeption using randrange . The exeption
> > > > is " no such  attribute " in  module random
>
> > > > platform  is xp  home  and the python  build is activestate 2.5
>
> > > Welcome aboard!
>
> > > There's definitely a randrange function in the random module, so
> > > something else must be wrong. To get the most out of this list and
> > > minimize wasted bandwidth, the most effective way usually consists of
> > > copying and pasting:
> > > 1. The offending code (or just the relevant part if it's too big).
> > > 2. The full traceback of the raised exception.
>
> > > Regards,
> > > George
>
> > Hwere is the complete traceback ! >>> The word is:  index
>
> > Traceback (most recent call last):
> >   File "F:\Python25\Lib\site-packages\pythonwin\pywin\framework
> > \scriptutils.py", line 307, in RunScript
> >     debugger.run(codeObject, __main__.__dict__, start_stepping=0)
> >   File "F:\Python25\Lib\site-packages\pythonwin\pywin\debugger
> > \__init__.py", line 60, in run
> >     _GetCurrentDebugger().run(cmd, globals,locals, start_stepping)
> >   File "F:\Python25\Lib\site-packages\pythonwin\pywin\debugger
> > \debugger.py", line 631, in run
> >     exec cmd in globals, locals
> >   File "F:\Documents and Settings\Mark\My Documents\rand.py", line 5,
> > in 
> >     import random
> >   File "F:\Documents and Settings\Mark\My Documents\random.py", line
> > 13, in 
> >     distributions on the real line:
> > AttributeError: 'module' object has no attribute 'randrange'
>
> > Why  would it say  it can't find the function ?
>
> Because you named your file 'random.py' and it shadows the standard
> random module! Change the name to something else, say foo.py, and try
> it again.
>
> George- Hide quoted text -
>
> - Show quoted text -

Hi that was the problem  I shoaswoed the  random  module .

Thanks to  everyone for  their support  !

Mark

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


Where can I find :

2008-03-29 Thread pythonnubie
Hi  All :
Does anyone know where I  can find  either a book or a website  that
explains  beginning  python  by actually  building a  project  line by
line and explaining  it indepth . I  am primarily interested in
understading  flowcontrol as well  as syntax .

If it was related to  netwoprking  then that would be a great
addition  although not required  because that is my primary field of
interest .

All help greatly appreciated !

Mark

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