Re: Hide text in entry box when i click on it.(GUI using Tkinter in python)

2017-11-11 Thread tonysmart . ct
Thanks it was helpful
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue24387] json.loads should be idempotent when the argument is a dictionary

2015-06-05 Thread CT Radu

New submission from CT Radu:

Currently, json.loads expects a string as input and is expected to return a 
dictionary or raise an exception.

Proposal:
If the first argument of json.loads is a dictionary
return that dictionary, instead of raising a TypeError as it happens now.

There are some use cases where json.loads would be applied multiple times to 
the same object. Once the string has been parsed once, it shouldn't be reloaded.

--
components: Library (Lib)
messages: 244864
nosy: CT Radu
priority: normal
severity: normal
status: open
title: json.loads should be idempotent when the argument is a dictionary
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24387
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



trouble with Tkinter and Tix

2006-04-11 Thread CT
Hi,
I installed python 2.4.3, Tcl 8.4 Tk8.4 and also with Tix 8.4

I got some error like _tkinter.TclError:ambigous option -col: must be
column, etc with my LabelFrame from Tix.

It seems that the python interpreter is mixing my Tix with Tkinter? If
I put Tix.LabelFrame and use import Tix instead of from Tix import *,
the problem seems to be gone.

Any idea how to fix it without editing all the codes?

thanks,
CT

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


UnicodeDecodeError

2005-05-05 Thread thomas ct
Hi Fredrik

Sorry that I confused u 
Thomas Thomas wrote:there's no way the tuple creation will generate a UnicodeDecodeErrorall by itself. are you sure the error occurs on that line?u r right, the error is not generated in tuple creation . it generated where join the strings at the line 

body = CRLF.join(L)
what i was trying to saywas how the various tuples behave..if i use

file = ('file', filename, data) #it gives me unicode error
in this case I am using binary data..

file = ('file', filename, 'data'*100)but the same filename works fine if i pass text data

file = ('file', 'test.pdf', data)

so if hardcode the file name /use 
filename=filename.encode("ascii") things work with binary data as well..

I was wondering why..

thanks 
Thomasimport httplib, mimetypesimport os;def get_content_type(filename): return mimetypes.guess_type(filename)[0] or 'application/octet-stream'filepath= 'c:/Documents and Settings/Administrator/Desktop/tmp/test.pdf';f = open(filepath, "rb")data = "">f.close()(filedir, filename) = os.path.split(filepath)filename=unicode(filename);#file = ('file', filename, data) #This won't work will give a UnicodeDecodeError: 'ascii' codec can't decode byte 0xc7 in position 10: ordinal not in range(128)file = ('file', filename, 'data'*100) #this will work fine#file = ('file', 'test.pdf', data) #This also works finefiles = [file]CRLF = '\r\n'L = []for (key, filename, value) in files: L.append('Content-Disposition: form-data; name="%s"; filename="%s"' % (key, filename)) L.append(value)body = CRLF.join(L)
		Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search. Learn more.-- 
http://mail.python.org/mailman/listinfo/python-list