Tkfont.families does not list all installed fonts
Hi, I have installed a truetype font (.ttf) on a linux machne (SUSE linux 10, KDE) by copying it to my .fonts folder. I can use the font in all applications like open-office and firefox browser. However, I cannot use the font in a python app that I am writing. The list returned by Tkfont.families does not contain this particular font. Any suggestions ? Regards, -- http://mail.python.org/mailman/listinfo/python-list
Announcing WERD (1.0), the Phonetic Transliterator to Indic scripts
WERD is a phonetic transliterator that helps users write english text but read the same in the chosen Devanagari (Indic) font. WERD is expected to make it easy for Indians wanting to communicate over chat or email in their native language. Checkout http://werd.sourceforge.net/ WERD is written in Python and Tkinter, is open source software released under GPL, and is hosted by SourceForge (www.sourceforge.net) Thanks and Regards, -- Atul -- http://mail.python.org/mailman/listinfo/python-list
file open fails.
Hi I am using IDLE on Windows Vista and I have a small code.
title = 'C:\Thesis\refined_title.txt'
file = open(title)
I get the following error from Python.
file = open(title)
IOError: [Errno 22] invalid mode ('r') or filename: 'C:\\Thesis
\refined_title.txt'
Now, I can not understand the problem here I have all the permissions
set for the folder, file as well. I can not understand why would it
happen. Is it known on Windows Vista or am I missing something really
simple and stupid? Please help.
Regards,
Atul.
--
http://mail.python.org/mailman/listinfo/python-list
Encoding for Devanagari Script.
Hello All, I wanted to know what encoding should I use to open the files with Devanagari characters. I was thinking of UTF-8 but was not sure, any leads on this? Anyone used it earlier? Thanks in Advance. Regards, Atul. -- http://mail.python.org/mailman/listinfo/python-list
Re: Encoding for Devanagari Script.
Hi Fredrik and Terry,
Well I got this on IDLE I think I have done something wrong.
>>> import codecs
>>> f = open("C:\Documents and Settings\admin\My Documents\corpus\dainaikAikya
>>> collected by sushant.txt","r", "utf_8")
Traceback (most recent call last):
File "", line 1, in
f = open("C:\Documents and Settings\admin\My Documents\corpus
\dainaikAikya collected by sushant.txt","r", "utf_8")
TypeError: an integer is required
after that I tried the read binary mode and tried reading the firt 32
bytes and this is what I got.
>>> f = open("C:\Documents and Settings\\admin\\My
>>> Documents\\corpus\\dainaikAikya collected by sushant.txt","rb")
>>> f.read(32)
'\xef\xbb\xbf\xe0\xa4\xa8\xe0\xa4\xb5\xe0\xa5\x80
\xe0\xa4\xa6\xe0\xa4\xbf\xe0\xa4\xb2\xe0\xa5\x8d
\xe0\xa4\xb2\xe0\xa5\x80,'
Now based on my knowledge of Unicode I think this is a utf-8 file (the
first 3 bytes \xef\xbb\xbf), please correct me if I am wrong. How do I
read this?
Atul.
PS: the above code I wrote using the information from the Library
Reference pdf section 4.8 "Codecs". Something wrong I am doing? Please
do let me know.
On Jul 25, 6:21 am, Terry Reedy <[EMAIL PROTECTED]> wrote:
> Atul. wrote:
> > Hello All,
>
> > I wanted to know what encoding should I use to open the files with
> >Devanagaricharacters. I was thinking of UTF-8 but was not sure, any
> > leads on this? Anyone used it earlier?
>
> You cannot hurt your machine by giving that a try.
>
> This is a general comment for all beginners. Before posting, open the
> interactive interpreter (or IDLE) and try something(s). If the result
> puzzles you, copy and paste into a post. Or if more appropriate, open
> the Python manuals and search a bit, or try a search engine.
--
http://mail.python.org/mailman/listinfo/python-list
Re: Encoding for Devanagari Script.
Thanks, Tim that did work. I will proceed with my playing around now.
Thanks a ton.
Atul.
>
> Only slightly. You're importing the codecs module
> but you're not using it. So you're *actually* using
> the built-in open function, which doesn't have an
> encoding parameter. It does have a third param
> which is to do with the buffer size.
>
> Just change your code to use codecs.open ("...")
> and, I suggest, either use raw strings for your
> filename (r"c:\docume...") or use the other kind
> of slash ("c:/documen..."). Otherwise you might
> run into some problems.
>
> TJG
--
http://mail.python.org/mailman/listinfo/python-list
Tkinter Entry widgets 'font' property (API ?) changed in Python 2.5.2 ?
Hi,
The snippet :
entryFontDescr = Entry()["font"]
print self.entryFontDescr
On Windows XP it displays
{MS Sans Serif} 8
On Suse Linux 10.2 it used to display
TkTextFont 10
I upgraded to OpenSuse 11 and now it shows
TkTextFont
I used this snippet to obtain the default font size for an Entry
widget. Now with an OS upgrade, my code is broken.
The python version on the upgraded box is
~> python
Python 2.5.2 (r252:60911, Jun 6 2008, 23:32:27)
[GCC 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision 135036]] on
linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
I dont remember the exact version of Python on the earlier Suse 10.2
box
My questions:
1. Is this not an API change ? I looked up Python's release
documentation and didn't find any mention of the same.
2. How can I achieve what I want alternatively ?
Regards,
-- Atul
--
http://mail.python.org/mailman/listinfo/python-list
regular expressions.
Hey All, I have been playing around with REs and could not get the following code to run. import re vowel = r'[aeiou]' re.findall(vowel, r"vowel") anything wrong I have done? Regards, Atul. -- http://mail.python.org/mailman/listinfo/python-list
Re: regular expressions.
> Yes. You didn't paste the traceback into your message. > > >>> import re > >>> vowel = r'[aeiou]' > >>> re.findall(vowel, r"vowel") > > ['o', 'e'] > > It works as expected here. > > Peter When I key this input in IDLE it works but when I try to run the module it wont work. -- http://mail.python.org/mailman/listinfo/python-list
Re: regular expressions.
On Aug 8, 4:22 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > Atul. wrote: > > >> Yes. You didn't paste the traceback into your message. > > >> >>> import re > >> >>> vowel = r'[aeiou]' > >> >>> re.findall(vowel, r"vowel") > > >> ['o', 'e'] > > >> It works as expected here. > > >> Peter > > > When I key this input in IDLE it works but when I try to run the > > module it wont work. > > What's the name of your script? What happens when you run it? Does it print > a traceback? If so, what does it say? Please cut and paste, don't > paraphrase. > > Peter This is something get when I run it like below. it does not print any output. [EMAIL PROTECTED]:~/Work/work/programs$ python fourth.py [EMAIL PROTECTED]:~/Work/work/programs$ -- http://mail.python.org/mailman/listinfo/python-list
Re: regular expressions.
On Aug 8, 4:33 pm, "Atul." <[EMAIL PROTECTED]> wrote: > On Aug 8, 4:22 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > > > > > Atul. wrote: > > > >> Yes. You didn't paste the traceback into your message. > > > >> >>> import re > > >> >>> vowel = r'[aeiou]' > > >> >>> re.findall(vowel, r"vowel") > > > >> ['o', 'e'] > > > >> It works as expected here. > > > >> Peter > > > > When I key this input in IDLE it works but when I try to run the > > > module it wont work. > > > What's the name of your script? What happens when you run it? Does it print > > a traceback? If so, what does it say? Please cut and paste, don't > > paraphrase. > > > Peter > > This is something get when I run it like below. it does not print any > output. > > [EMAIL PROTECTED]:~/Work/work/programs$ python fourth.py > [EMAIL PROTECTED]:~/Work/work/programs$ ok I get it thats coz, I dont print it. right? when I print it does she it. -- http://mail.python.org/mailman/listinfo/python-list
Re: regular expressions.
The same file when I use with the following does not work. import re vowel = r'[u"\u093e"u"\u093f"u"\u0940"u"\u0941"u"\u0942"u"\u0943"u"\u0944"u"\u0945"u"\u0946"u"\u0947"u"\u0948"u"\u0949"u"\u094a"u"\u094b"u"\u094c"]' print re.findall(vowel, u"\u092f\u093e\u0902\u091a\u094d\u092f\u093e", re.UNICODE) [EMAIL PROTECTED]:~/Work/work/programs$ python fourth.py [] [EMAIL PROTECTED]:~/Work/work/programs$ is this the way to use Unicode in REs? Regards, Atul. -- http://mail.python.org/mailman/listinfo/python-list
Re: Tkinter Entry widgets 'font' property (API ?) changed in Python 2.5.2 ?
Hi Eric,
Thanks for your response.
> Tkinter is a very thin wrapper over an embedded tcl/tk interpreter. So I
> guess the API change is caused by a tcl/tk version change, not by a Python
> one. You can check the version of the tcl/tk interpreter you're using from
> Python via:
>
> root = Tkinter.Tk()
> root.tk.eval('puts $tcl_patchLevel')
> root.tk.eval('puts $tk_patchLevel')
>
The Windows box reports 8.4.12 whereas the OpenSuze 11 box reports
8.5.2
I suppose the Suze 10.2 box had a lesser version and hence the API
change.
> > 2. How can I achieve what I want alternatively ?
>
> I'd use this way:
>
> import tkFont
> entryFontDescr = Entry()["font"]
> entry_font = tkFont.Font(font=entryFontDescr)
> print entry_font.actual()
>
This works very well, thank you :)
Regards,
-- Atul
--
http://mail.python.org/mailman/listinfo/python-list
Python on the web, how to?
Hello All, Needless to say I am new to python and web programming. I am looking for a quick Python-101 course / tutorial for "using python to implement dynamic content on web" under some web server. Any pointers what should I be reading? Regards, Atul. -- http://mail.python.org/mailman/listinfo/python-list
exit ThreadPoolExecutor immediately
I am looking for a way to stop a ThreadPoolExecutor immediately under the assumption that I don't care about what's currently running or pending. ``` limit = 2 executor = ThreadPoolExecutor(10) posts = itertools.islice(mygen(executor=executor, **kwargs), 0, limit) for post in posts: print(post) executor.shutdown(wait=False) ``` Basically I have a generator, mygen, which is using the executor to submit many tasks in parallel and yield the result one at a time. I would like to be able to limit the generator and have the executor stop processing immediately. I was considering clearing the _work_queue or iterating over it and running future.cancel() on each future but both seem to be quite hacky and didn't work in my initial try. https://github.com/python/cpython/blob/master/Lib/concurrent/futures/thread.py#L83 Any ideas? - Al -- https://mail.python.org/mailman/listinfo/python-list
directory listing
hi how do i get a full listing of permissions for files and directories in linux? Something like rwx-r--r-- i have managed to get it using the os.access modes as of now but it gives me the permissions of the current user. regards Atul Kamat Visionael Labs Bangalore -- http://mail.python.org/mailman/listinfo/python-list
Missing fpconst?
Hi All, I im searching for fpconst. I had gone thru both the links mentioned below. But both seem to be broken.. Can any body point me to correct one. Thanks in advance.. Atul phansen wrote: >I was trying to start some experiments with SOAP, but >fairly quickly discovered that SOAPpy (required by >twisted.web.soap and other things) relies on something >called fpconst, which was apparently available from the >page http://www.analytics.washington.edu/Zope/projects/fpconst/ >which no longer exists. Attempts to find the project >in other ways have so far failed. > Hi Peter, you can download fpconst from http://www.analytics.washington.edu/statcomp/projects/testfolder/rzope/fpconst HTH Rainer -- http://mail.python.org/mailman/listinfo/python-list
import error on solaris
Hello, I am embedding python in C++ using SWIG. * The appication runs as a server. * Mutiple clients send requests which execute some python scripts with import statements. * Each request is handled in a separate thread which has its own interepreter for script execution. * Requests are succesfully completed fine for some time and then I see some "ImportErrors" for example "ImportError: No module named string" Apart from these python replated errors I see some "too many files open" errors in my other server code. Other than solaris things work fine on other unix platforms and windos too. One additional thing I do for solaris is "import DLFCN; sys.setdlopenflags(DLFCN.RTLD_NOW | DLFCN.RTLD_PARENT);" One of my question is, is importing some module create a file handle ? Any help on this is appreciated. Thanks, Atul Kshirsagar __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- http://mail.python.org/mailman/listinfo/python-list
highly einteractive editor for python
Does anybody know an editor that facilitates, interactive python development. Where GUI etc developed will be possible to see in real time mode. Thanks Atul -- http://mail.python.org/mailman/listinfo/python-list
Re: highly einteractive editor for python
What I want to see is that it is possible to create a python based application in a environment where I can see the results as I am creating it, specifically gui widgets (from say TK). This will provide a robust mechanism to see gui layout as well. Thanks Atul "Josiah Carlson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Atul Bhingarde wrote: >> Does anybody know an editor that facilitates, interactive python >> development. Where GUI etc developed will be possible to see in real time >> mode. > > Boa Constructor? wxGlade embedded in some other software (SPE?) XRCed? > What do you mean by "real time mode"? > > - Josiah -- http://mail.python.org/mailman/listinfo/python-list
Re: highly einteractive editor for python
I liked what the Wing IDE provides, one question though will it provide facility like creating the GUI widgets (say using TK) and facilitaate layout for the same and then run the script ? Thanks Atul "Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Atul Bhingarde wrote: >> Does anybody know an editor that facilitates, interactive python >> development. Where GUI etc developed will be possible to see in real time >> mode. >> >> Thanks >> >> Atul > Wind IDE is great for debugging GUI-based programs - you can set > breakpoints in event-handling routines and see them activate when your > program responds to mouse clicks and so on. > > http://wingware.com/ > > regards > Steve > -- > Steve Holden+1 571 484 6266 +1 800 494 3119 > Holden Web LLC/Ltd http://www.holdenweb.com > Skype: holdenweb http://del.icio.us/steve.holden > --- Asciimercial -- > Get on the web: Blog, lens and tag the Internet > Many services currently offer free registration > --- Thank You for Reading - > -- http://mail.python.org/mailman/listinfo/python-list
