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
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
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
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ø
> > 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
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
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
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
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
> 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
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
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
___
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
>> 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
>> 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
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?
>
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:
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
"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
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
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
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
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
[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),["
>
> 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.
_
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
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*.
__
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,
28 matches
Mail list logo