On Mon, Jun 20, 2016 at 3:36 AM, Peter Otten <__pete...@web.de> wrote:
> I'm now really sorry that I wrote that comment. It should have been
> something like
>
> # I know that the following code is inefficient and produces
> # underwhelming results. As its only purpose is to illustrate
> # the vie
boB Stepp wrote:
> I have (Finally!) gotten a bit of time to look at Peter's answer to my
> Model-View-Controller question from May 29th, particularly his
> CircleImageView class to which he added a "#FIXME" comment.
I'm now really sorry that I wrote that comment. It should have been
something l
On Sun, Nov 22, 2015 at 11:19:17PM -0500, bruce wrote:
> Hi.
>
> Doing a 'simple' test with linux command line curl, as well as pycurl
> to fetch a page from a server.
>
> The page has a charset of >>AL32UTF8.
I had never heard of that before, so I googled for it. No surprise, it
comes from Or
Hi.
Doing a 'simple' test with linux command line curl, as well as pycurl
to fetch a page from a server.
The page has a charset of >>AL32UTF8.
Anyway to conert this to straight ascii. Python is throwing a
notice/error on the charset in another part of the test..
The target site is US based, so
On Tue, Jan 31, 2012 at 4:06 AM, Russel Winder wrote:
> On Tue, 2012-01-31 at 07:33 +0200, Christian Witts wrote:
>> [...]o with
>> `type(y) == int`, and to get the ASCII value of a character you can use
>> `ord` like `ord('a') == 97`. And how to avoid your ValueError with a bad
>> conversion, do
On Tue, 2012-01-31 at 07:33 +0200, Christian Witts wrote:
> [...]o with
> `type(y) == int`, and to get the ASCII value of a character you can use
> `ord` like `ord('a') == 97`. And how to avoid your ValueError with a bad
> conversion, do your type checking before hand.
isinstance ( y , int )
Peter Otten wrote:
> if isint and y < -1 or y > 1:
Sorry, I forgot the parentheses.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Michael Lewis wrote:
> I am trying to do a simple test but am not sure how to get around ASCII
> conversion of characters. I want to pass in y have the function test to
> see if y is an integer and print out a value if that integer satisfies the
> if statement. However, if I pass in a string, it's
On 31/01/2012 05:33, Christian Witts wrote:
On 2012/01/31 06:50 AM, Michael Lewis wrote:
I am trying to do a simple test but am not sure how to get around
ASCII conversion of characters. I want to pass in y have the function
test to see if y is an integer and print out a value if that integer
sa
On 2012/01/31 06:50 AM, Michael Lewis wrote:
I am trying to do a simple test but am not sure how to get around
ASCII conversion of characters. I want to pass in y have the function
test to see if y is an integer and print out a value if that integer
satisfies the if statement. However, if I pas
On Tue, Jan 31, 2012 at 15:50, Michael Lewis wrote:
> ... However, if I pass in a string, it's converted to ASCII and will
> still satisfy the if statement and print out value. How do I ensure that a
> string is caught as a ValueError instead of being converted?
It depends on what you want to do
I am trying to do a simple test but am not sure how to get around ASCII
conversion of characters. I want to pass in y have the function test to see
if y is an integer and print out a value if that integer satisfies the if
statement. However, if I pass in a string, it's converted to ASCII and will
s
On 1/28/11, Dave Angel wrote:
> On 01/28/2011 08:02 AM, Alex Hall wrote:
>> On 1/28/11, Dave Angel wrote:
>>> On 01/-10/-28163 02:59 PM, Alex Hall wrote:
I tried both of those and got a different error. I have since fixed it
so I no longer have the exact text, but it was something
On 01/28/2011 08:02 AM, Alex Hall wrote:
On 1/28/11, Dave Angel wrote:
On 01/-10/-28163 02:59 PM, Alex Hall wrote:
I tried both of those and got a different error. I have since fixed it
so I no longer have the exact text, but it was something about not
supporting convertion from unicode. I fi
On 1/28/11, Dave Angel wrote:
> On 01/-10/-28163 02:59 PM, Alex Hall wrote:
>>
>> I tried both of those and got a different error. I have since fixed it
>> so I no longer have the exact text, but it was something about not
>> supporting convertion from unicode. I finally ended up doing this:
>> s
On 01/-10/-28163 02:59 PM, Alex Hall wrote:
I tried both of those and got a different error. I have since fixed it
so I no longer have the exact text, but it was something about not
supporting convertion from unicode. I finally ended up doing this:
self.title�ta.find("title").text.encode("utf-8"
Alex Hall wrote:
> Hello again:
> I have never seen this message before. I am pulling xml from a site's
> api and printing it, testing the wrapper I am writing for the api. I
> have never seen this error until just now, in the twelfth result of my
> search:
> UnicodeEncodeError: 'ASCII' codec can'
On 01/-10/-28163 02:59 PM, Alex Hall wrote:
Hello again:
I have never seen this message before. I am pulling xml from a site's
api and printing it, testing the wrapper I am writing for the api. I
have never seen this error until just now, in the twelfth result of my
search:
UnicodeEncodeError: 'A
On 1/27/11, Steven D'Aprano wrote:
> Alex Hall wrote:
>> Hello again:
>> I have never seen this message before. I am pulling xml from a site's
>> api and printing it, testing the wrapper I am writing for the api. I
>> have never seen this error until just now, in the twelfth result of my
>> search
Alex Hall wrote:
Hello again:
I have never seen this message before. I am pulling xml from a site's
api and printing it, testing the wrapper I am writing for the api. I
have never seen this error until just now, in the twelfth result of my
search:
UnicodeEncodeError: 'ASCII' codec can't encode ch
Hello again:
I have never seen this message before. I am pulling xml from a site's
api and printing it, testing the wrapper I am writing for the api. I
have never seen this error until just now, in the twelfth result of my
search:
UnicodeEncodeError: 'ASCII' codec can't encode character u'\u2019' i
Hello members:
I need your help, I'm developing a python script to make an excel file...
I've been working in this for a long time. The module will write some data
from a .shp file. Unfortuanely that information has some characters
unrecorgnized by ascii. I tried to fix this adding an unicode sent
On Wed, Mar 29, 2006 at 01:51:30PM +0530, Kaushal Shriyan wrote:
> > How do i use this ASCII values in my day to day activities, I am going
> > through learning python,
>
> Its a very general question not related to python at all, I have a
> minimum knowledge in ASCII just wanted to know how it i
Hello,Basicaly, You use ASCII or Unicode when you have to deal with character conversion for example coding with a different language symbol, chinese letter etc. Sincerely Yours,Pujo
On 3/29/06, Kaushal Shriyan <[EMAIL PROTECTED]> wrote:
On 3/29/06, Pujo Aji <[EMAIL PROTECTED]> wrote:>> Hi Kaushal,
On 3/29/06, Pujo Aji <[EMAIL PROTECTED]> wrote:
>
> Hi Kaushal,
>
> Please clarify the problem more specific.
> Or you can tell us that you have a problem and want to use python to solve
> it?
>
> Sincerely Yours,
> pujo
>
>
> On 3/29/06, Kaushal Shriyan <[EMAIL PROTECTED]> wrote:
> >
> Hi All
>
>
Hi Kaushal,Please clarify the problem more specific.Or you can tell us that you have a problem and want to use python to solve it?Sincerely Yours,pujoOn 3/29/06,
Kaushal Shriyan <[EMAIL PROTECTED]> wrote:
Hi AllHow do i use this ASCII values in my day to day activities, I am going throughlearning
Hi All
How do i use this ASCII values in my day to day activities, I am going through
learning python,
Please illustrate with examples
Thanks in Advance
Regards
Kaushal
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/t
On Tue, 24 May 2005, Kent Johnson wrote:
> D. Hartley wrote:
> > I have a question: what is the "opposite" of hex()? (i.e., like ord
> > and chr). If I have
> >
> > '0x73', how can I get back to 115 or s?
>
> I don't know a really clean way to do this because '0x73' is not a legal
> input value
D. Hartley wrote:
> I have a question: what is the "opposite" of hex()? (i.e., like ord
> and chr). If I have
>
> '0x73', how can I get back to 115 or s?
I don't know a really clean way to do this because '0x73' is not a legal input
value for int().
The simplest way is to use eval():
>>> eva
I have a question: what is the "opposite" of hex()? (i.e., like ord
and chr). If I have
'0x73', how can I get back to 115 or s?
Thanks!
~Denise
> You need the ord() function and maybe hex() also:
> >>> ord('s')
> 115
> >>> hex(ord('s'))
> '0x73'
>
> Kent
>
>
John Carmona wrote:
> Thanks Kent for the reply, I am actually having trouble to find the
> solution of the following exercise:
>
> ## Write a for loop that prints the ASCII code of each character in a
> string name S.##
>
> I am ok with the for loop, put I don't know how get to print the ASCII
Thanks Kent for the reply, I am actually having trouble to find the solution
of the following exercise:
## Write a for loop that prints the ASCII code of each character in a string
name S.##
I am ok with the for loop, put I don't know how get to print the ASCII code
of each character with a st
John Carmona wrote:
> I need to print all the ASCII characters within a string, how would I
> delimit for example to print the first 100 only? Many thanks
A string is a sequence and supports sequence operations including slices. So
s[:100]
gives the first 100 chars of a string.
You might be i
I need to print all the ASCII characters within a string, how would I
delimit for example to print the first 100 only? Many thanks
JC
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
> Whether or not it's positive or negative depends on which side of
GMT/UTC
> you are, of course :) Note that the result in is seconds, too:
Which is insane since timezones have nothing to do with time offsets.
Especially at the second level!
Oh well, nothing is perfect!
Alan G.
(Feeling picky
On Jan 26, 2005, at 02:56, Luis N wrote:
In other words I have to do some arithmetic:
import time
time.timezone
0
The server is located in Dallas, Texas.
Which means it's not properly configured. On UNIX systems, to
configure the timezone, you must adjust /etc/localtime so that it's a
symlink th
On Jan 26, 2005, at 02:44, Tony Meyer wrote:
time.timezone gives you, I think, the offset between
your current timezone and GMT. However, being myself in the GMT zone,
I don't know exactly if the returned offset is positive or negative
(it returns 0 here, which makes sense :D ).
Whether or not it's
In other words I have to do some arithmetic:
>>> import time
>>> time.timezone
0
The server is located in Dallas, Texas.
On Wed, 26 Jan 2005 15:44:48 +1300, Tony Meyer <[EMAIL PROTECTED]> wrote:
> > time.timezone gives you, I think, the offset between
> > your current timezone and GMT. However,
> time.timezone gives you, I think, the offset between
> your current timezone and GMT. However, being myself in the GMT zone,
> I don't know exactly if the returned offset is positive or negative
> (it returns 0 here, which makes sense :D ).
Whether or not it's positive or negative depends on wh
On Jan 26, 2005, at 00:50, Luis N wrote:
Ok, urllib.quote worked just fine, and of course so did
urllib.pathname2url.
I should have run a dir() on urllib. Those functions don't appear in
http://docs.python.org/lib/module-urllib.html
Now, how might one go about calculating the New York time off-se
Ok, urllib.quote worked just fine, and of course so did urllib.pathname2url.
I should have run a dir() on urllib. Those functions don't appear in
http://docs.python.org/lib/module-urllib.html
Now, how might one go about calculating the New York time off-set from
GMT? The server is in the U.S. but
Kent Johnson wrote:
>>> import re
>>> def hexify(match):
... return '%%%X' % ord(match.group(0))
Ah, should be '%%%02X' ...
Kent
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Luis N wrote:
How would I best turn this string:
'2005-01-24 00:00:00.0'
into this string:
'2005%2D01%2D24%2000%3A00%3A00%2E0'
In order to call a URL.
urllib.quote_plus() is intended for this purpose though it doesn't have the
result you ask for:
>>> import urllib
>>> s='2005-01-24 00:00:00.0'
I got this from spyce
http://spyce.sourceforge.net
_url_ch = re.compile(r'[^A-Za-z0-9_.!~*()-]') # RFC 2396 section 2.3
def url_encode(o, **kwargs):
'''Return URL-encoded string.'''
return _url_ch.sub(lambda match: "%%%02X" % ord(match.group(0)),
str(o))
It was just the first thing I found in
On Jan 24, 2005, at 23:29, Luis N wrote:
How would I best turn this string:
'2005-01-24 00:00:00.0'
into this string:
'2005%2D01%2D24%2000%3A00%3A00%2E0'
In order to call a URL.
I've hunted through the standard library, but nothing seemed to jump
out.
The pathname2url in urllib seems to do wha
How would I best turn this string:
'2005-01-24 00:00:00.0'
into this string:
'2005%2D01%2D24%2000%3A00%3A00%2E0'
In order to call a URL.
I've hunted through the standard library, but nothing seemed to jump out.
Thank You.
___
Tutor maillist - Tuto
I ran a program with a "£" sign, and I got this
message :-
"sys:1: DeprecationWarning: Non-ASCII character '\xc2'
in file birdgame32a.py on line 93, but no encoding
declared; see http://www.python.org/peps/pep-0263.html
for details'
I looked at the message but I am not sure what
encoding to use fo
47 matches
Mail list logo