[Tutor] The name of the module

2007-10-17 Thread János Juhász
Dear Tutors, there was a thread some weeks ago about how can we find out what is the name of the current module, where the function was loaded from, where the function running from or so, with some magic. I can't find it in the archive. May someone help me with some reference about it ? Your

Re: [Tutor] symbol encoding and processing problem

2007-10-17 Thread Timmie
I tried your advice yesterday evening. > And see if you get a ç. I see this character. from easygui import easygui raw = unicode("121ø 55' 5.55''", 'utf-8') => gets a encoding error raw = unicode("121ø 55' 5.55''", 'cp1250') => this works while coding on windows. How do I make it work really cro

Re: [Tutor] The name of the module

2007-10-17 Thread Rolando Pereira
János Juhász wrote: > Dear Tutors, > > there was a thread some weeks ago about > how can we find out > what is the name of the current module, > where the function was loaded from, > where the function running from or so, > with some magic. > > I can't find it in the archive. > > May someone

Re: [Tutor] symbol encoding and processing problem

2007-10-17 Thread Kent Johnson
Timmie wrote: > I tried your advice yesterday evening. > >> And see if you get a ç. > I see this character. > > from easygui import easygui > raw = unicode("121ø 55' 5.55''", 'utf-8') > => gets a encoding error Then your source file is not really in UTF-8. BTW you can simply say raw = u"121ø

Re: [Tutor] symbol encoding and processing problem

2007-10-17 Thread Timmie
> > from easygui import easygui > > raw = unicode("121ø 55' 5.55''", 'utf-8') > > => gets a encoding error > > Then your source file is not really in UTF-8. This really helped! > Get an editor on Windows that can edit UTF-8 text files and file > transfer software that doesn't change the text e

Re: [Tutor] symbol encoding and processing problem

2007-10-17 Thread Tim Golden
Timmie wrote: >>> from easygui import easygui >>> raw = unicode("121ø 55' 5.55''", 'utf-8') >>> => gets a encoding error >> Then your source file is not really in UTF-8. > This really helped! > > >> Get an editor on Windows that can edit UTF-8 text files and file >> transfer software that doesn

Re: [Tutor] symbol encoding and processing problem

2007-10-17 Thread Kent Johnson
Timmie wrote: >> Get an editor on Windows that can edit UTF-8 text files and file >> transfer software that doesn't change the text encoding. Work with UTF-8 >> exclusively. > Thanks. This sounds really trivial but the thing is that one cannot define > file > encoding in PythonWin. Really! Tha

Re: [Tutor] symbol encoding and processing problem

2007-10-17 Thread Timmie
OK, I found out. > Since it didn't work in IPython as well I assume that I need to change the > encoding of the IPython shell to UTF-8, too. Still need to find out where. Put a file called 'sitecustomize.py' into any directory on your PYTHONPATH. write the folowing two lines in that file: import

Re: [Tutor] symbol encoding and processing problem

2007-10-17 Thread Kent Johnson
Timmie wrote: > OK, I found out. >> Since it didn't work in IPython as well I assume that I need to change the >> encoding of the IPython shell to UTF-8, too. Still need to find out where. > Put a file called 'sitecustomize.py' into any directory on your PYTHONPATH. > > write the folowing two line

[Tutor] OT [Re: symbol encoding and processing problem]

2007-10-17 Thread Timmie
> I'm sure there'll be lots of other suggestions, but the SciTE > editor (whose name I'm never sure how to prononunce without > blushing) understands the same encoding directive as Python. > It's quite lightweight, and also allows you to run Python scripts > directly, although there are limitations

Re: [Tutor] OT [Re: symbol encoding and processing problem]

2007-10-17 Thread Tim Golden
Timmie wrote: >> I'm sure there'll be lots of other suggestions, but the SciTE >> editor (whose name I'm never sure how to prononunce without >> blushing) understands the same encoding directive as Python. >> It's quite lightweight, and also allows you to run Python scripts >> directly, although th

[Tutor] aBSOLUTE BEGINNER

2007-10-17 Thread Abhishek Negi
Hello all, I am an absolute beginner for python.currently i am working under mainframe technologybut getting kinda bored from it and want to learn a good scripting language...so chose python...please give me link to a pdf which is suitable for beginners. -- take care bye Abhishek Negi ___

Re: [Tutor] aBSOLUTE BEGINNER

2007-10-17 Thread Kent Johnson
Abhishek Negi wrote: > Hello all, > I am an absolute beginner for python.currently i am working under > mainframe technologybut getting kinda bored from it and want to > learn a good scripting language...so chose python...please give me link > to a pdf which is suitable for beginners. I

Re: [Tutor] aBSOLUTE BEGINNER

2007-10-17 Thread Scott
>> Hello all, >> I am an absolute beginner for python.currently i am working under >> mainframe technologybut getting kinda bored from it and want to >> learn a good scripting language...so chose python...please give me link >> to a pdf which is suitable for beginners. This is my favouri

Re: [Tutor] symbol encoding and processing problem

2007-10-17 Thread Evert Rol
>> raw = unicode("125° 15' 5.55''", 'utf-8') > > Again, I think this can be simplified to >raw = u"125° 15' 5.55''" It does, but it's getting confusing when I compare the following: >>> raw = u"125° 15' 5.55''" 125° 15' 5.55'' >>> print u"125° 15' 5.55''" UnicodeEncodeError: 'ascii' codec

Re: [Tutor] symbol encoding and processing problem

2007-10-17 Thread Kent Johnson
Evert Rol wrote: >>> raw = unicode("125° 15' 5.55''", 'utf-8') >> Again, I think this can be simplified to >>raw = u"125° 15' 5.55''" > > It does, but it's getting confusing when I compare the following: > > >>> raw = u"125° 15' 5.55''" > 125° 15' 5.55'' Where does that output come from? >

Re: [Tutor] symbol encoding and processing problem

2007-10-17 Thread Evert Rol
raw = unicode("125° 15' 5.55''", 'utf-8') >>> Again, I think this can be simplified to >>>raw = u"125° 15' 5.55''" >> It does, but it's getting confusing when I compare the following: >> >>> raw = u"125° 15' 5.55''" >> 125° 15' 5.55'' > > Where does that output come from? sorry, my bad:

Re: [Tutor] symbol encoding and processing problem

2007-10-17 Thread Kent Johnson
Evert Rol wrote: >>> >>> print unicode("125° 15' 5.55''", 'utf-8') >>> UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in >>> position 3: ordinal not in range(128) >> >> This is the same as the first encode error. > > This is the thing I don't get; or only partly: I'm sending a

Re: [Tutor] aBSOLUTE BEGINNER

2007-10-17 Thread Alan Gauld
"Abhishek Negi" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello all, > I am an absolute beginner for python.currently i am working > under > mainframe technologybut getting kinda bored from it and want to > learn a > good scripting language...so chose python...please

[Tutor] String module; Count

2007-10-17 Thread ddm2
I am having trouble getting the string.count function to work. I want it to count the amount of digits (0 or 1) in the string, but I keep getting an error stating the string.count was expecting a character buffer object. CODE: count = string.count(conversion(n),["0","1"]) ERROR: Traceback (most re

Re: [Tutor] Help with packages and namespaces please

2007-10-17 Thread Andrew Wu
Thanks again for your help. I guess I should ask a more basic question about hierarchical directory structures and packages. If I have a bunch of files in a flat (single) directory structure that I want to reorganize into a hierarchical directory structure, do I necessarily have to turn them into

Re: [Tutor] Help with packages and namespaces please

2007-10-17 Thread Kent Johnson
Andrew Wu wrote: > Thanks again for your help. > > I guess I should ask a more basic question about hierarchical directory > structures and packages. If I have a bunch of files in a flat (single) > directory structure that I want to reorganize into a hierarchical > directory structure, do I ne

Re: [Tutor] String module; Count

2007-10-17 Thread Ben Sherman
You can only count one at a time. count = conversion(n).count("0") + conversion(n).count("1") count is a string method, so it operates directly on the string - you don't have to call it like you did. import string string.count(mystr, "cheese") is the same as mystr.count("cheese") At least it

Re: [Tutor] String module; Count

2007-10-17 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > I am having trouble getting the string.count function to work. I want it to > count the amount of digits (0 or 1) in the string, but I keep getting an > error stating the string.count was expecting a character buffer object. > CODE: > count = string.count(conversion(n),["

Re: [Tutor] aBSOLUTE BEGINNER

2007-10-17 Thread jon vspython
> > This is my favourite all time beginner book > http://ibiblio.org/obp/thinkCS/python/english2e/html/index.html. IT is > in html, I don't know if you can get it in pdf. > You can find an revised PDF version here: http://www.greenteapress.com/thinkpython/ It should be more up to date. _

Re: [Tutor] aBSOLUTE BEGINNER

2007-10-17 Thread bhaaluu
On 10/17/07, Abhishek Negi <[EMAIL PROTECTED]> wrote: > Hello all, > I am an absolute beginner for python.currently i am working under > mainframe technology What does that mean... "mainframe technology"? Are you a programmer? If so, which programming languages are you 'working' with? If y

[Tutor] accessing data in a usable format

2007-10-17 Thread Bryan Fodness
I have a data file 'data1.dat', *a* *b**c* *d* 1 0.10.110.111 2 0.20.220.222 3 0.30.330.333 9 0.90.990.999 and I want to be able to access the values of *b*, *c*, or *d* depending on a value of *a*. __

Re: [Tutor] accessing data in a usable format

2007-10-17 Thread John Fouhy
On 18/10/2007, Bryan Fodness <[EMAIL PROTECTED]> wrote: > I have a data file 'data1.dat', > > a bc d > > 1 0.10.110.111 > 2 0.20.220.222 > 3 0.30.330.333 > > 9 0.90.990.999 > > and I want to be able to access the values of b, c,