Great source for Unicode lovers
On Wed, Jan 14, 2009 at 3:53 PM, Robert Berman wrote:
> Very good and most welcome.
>
> Robert Berman
>
> Vern Ceder wrote:
>
>> Since there was some interest in the question of how to get a full Python
>> 3.0, including Tkinter and IDLE, compiled on Ubuntu Intrep
On Wed, Jan 14, 2009 at 5:52 AM, Mr Gerard Kelly wrote:
> There is a little Tkinter program. It lets you type something in a box,
> and will display it at the command line.
>
>
> from Tkinter import *
>
> master = Tk()
>
> e = Entry(master)
> e.pack()
>
> e.focus_set()
>
> def callback():
> s=e.
On Tue, Jan 13, 2009 at 4:02 PM, Vern Ceder wrote:
> Hi,
>
> I have Python 3.0/Tkinter/IDLE working fine on Ubuntu 8.10, but it takes a
> certain amount of fiddling.
>
> 1. Make sure the stock Ubuntu Python 3.0 package is not installed
>
> 2. download the Python 3.0 source from python.org
>
> 3. i
t; default under Ubuntu before using it.
> YMMV.
>
> Robert Berman
>
> Emad Nawfal (عماد نوفل) wrote:
>
> Hi Tutors,I have downloaded Python3.0 and started playing with it. I like
> it because of the utf-8 default encoding, but I'm having trouble importing
> tkinte
Hi Tutors,I have downloaded Python3.0 and started playing with it. I like it
because of the utf-8 default encoding, but I'm having trouble importing
tkinter. I get the following:
>>> import turtle
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.0/turtle.py",
On Mon, Jan 12, 2009 at 5:23 PM, WM. wrote:
> # The natural numbers(natnum), under 1000, divisible by 3 or by 5 are to be
> added together.
> natnum = 0
> num3 = 0
> num5 = 0
> cume = 0
> # The 'and' is the 15 filter; the 'or' is the 3 or 5 filter.
> while natnum <= 999:
>num3 = natnum/3
>
2008/12/26 Kent Johnson
> On Fri, Dec 26, 2008 at 8:09 AM, Emad Nawfal (عماد نوفل)
> wrote:
> > suppose I have an external program that prints "testing the subprocess
> > module"
> > I know I can run it through the commands module like this:
> >
> >
On Fri, Dec 26, 2008 at 6:47 AM, Alan Gauld wrote:
>
> "Kent Johnson" wrote
>
>> for d in os.listdir():
>>> if MyString(d).upper().beginswith():
>>>
>>
>> But that won't work, the result of calling upper() will be a normal
>> str, not a MyString.
>>
>
> Ah yes. Immutability of strings strike
Hello Tutors, and Happy New Year and Holidays,
suppose I have an external program that prints "testing the subprocess
module"
I know I can run it through the commands module like this:
>>> a = commands.getoutput("python3.0 hello.py")
>>> a
'testing the subprocess module'
>>> len(a)
29
>>> b = a.sp
On 12/25/08, Kent Johnson wrote:
>
> On Wed, Dec 24, 2008 at 4:04 PM, Emad Nawfal (عماد نوفل)
> wrote:
> > Hi Tutors,
> > I want a function that acts like the startswith method, but can take
> > multiple prefixes. As an amateur programmer, I came up with this one, and
On 12/25/08, Bill Campbell wrote:
>
> On Wed, Dec 24, 2008, bob gailer wrote:
> > Emad Nawfal ( ) wrote:
> >> Hi Tutors,
> >> I want a function that acts like the startswith method, but can take
> >> multiple prefixes. As an amateur programmer, I c
Hi Tutors,
I want a function that acts like the startswith method, but can take
multiple prefixes. As an amateur programmer, I came up with this one, and it
works fine, but my experience tells me that my solutions are not always the
best ones around. Can you please tell me what a better option migh
Thank you so much. This has been very helpful.
On Fri, Dec 19, 2008 at 12:21 PM, Andreas Kostyrka wrote:
> Am Fri, 19 Dec 2008 09:01:24 -0500
> schrieb "Emad Nawfal (عماد نوفل)" :
>
> You are not supposed to compile the main script.
>
> pyc files are automatically g
Thank you so much everybody. I was just curious.
This has been very useful.
On Fri, Dec 19, 2008 at 12:21 PM, Andreas Kostyrka wrote:
> Am Fri, 19 Dec 2008 09:01:24 -0500
> schrieb "Emad Nawfal (عماد نوفل)" :
>
> You are not supposed to compile the main script.
>
>
Hi Tutors,
#! /usr/bin/env python
print "Hello Tutors"
I have this script saved as hello.py. Why can I execute it, but not the
compiled version? or am I doing something wrong? Just curious. Any help
appreciated.
For example :
e...@emad-laptop:~/Desktop/Programming/Haskell$ chmod +x hello.py
On Thu, Oct 16, 2008 at 4:25 AM, Visvaldas K. <[EMAIL PROTECTED]>wrote:
> Hi,
>
> I feel very stupid, but I am stuck. I could try some workaround, but I want
> to understand what I am doing wrong.
>
> The line:
>
> for line in open("parameterfile").readlines( ):
>print line.split()
Here is a solution:
>>> for line in open('DBAN1001.txt').readlines():
... line = line.split()
... if len(line) > 1: # This is what makes it work for me.
... print line[1]
...
it's
have
the
way
that
is
is
prison
we
It works fine. It seems that in the file you have there are lin
2008/10/15 Emad Nawfal (عماد نوفل) <[EMAIL PROTECTED]>
>
>
> 2008/10/15 John Fouhy <[EMAIL PROTECTED]>
>
>> 2008/10/16 Emad Nawfal (عماد نوفل) <[EMAIL PROTECTED]>:
>> > One more question,
>> > I'm a linguistics person, I know some Java
2008/10/15 John Fouhy <[EMAIL PROTECTED]>
> 2008/10/16 Emad Nawfal (عماد نوفل) <[EMAIL PROTECTED]>:
> > One more question,
> > I'm a linguistics person, I know some Java and some Python (and failed to
> > learn Prolog). What things do I need to learn to w
d's script was used, just look at the paper in this link:
http://jones.ling.indiana.edu/~skuebler/papers/vocal.pdf
Thank you so much,
Emad
2008/10/15 John Fouhy <[EMAIL PROTECTED]>
> 2008/10/16 Emad Nawfal (عماد نوفل) <[EMAIL PROTECTED]>:
> > The focus letter will alway
2008/10/15 John Fouhy <[EMAIL PROTECTED]>
> 2008/10/16 Emad Nawfal (عماد نوفل) <[EMAIL PROTECTED]>:
> > Dear Tutors,
> > I needed a program to go through a word like this "Almuta$r~id"
> >
> > 1- a, i,u, and o are the short vowels
> > 2-
Dear Tutors,
I needed a program to go through a word like this "Almuta$r~id"
1- a, i,u, and o are the short vowels
2- ~ is the double consonant.
I wanted the program to do the following:
- For each letter of the word, if the letter is not a short vowel, print the
letter with the 5 preceding l
Hello Kent, Bob, Steve
Thank you all for your help and suggestions. I believe I 'll have a good
program soon.
2008/8/17 Kent Johnson <[EMAIL PROTECTED]>
> On 8/16/08, Emad Nawfal (عماد نوفل) <[EMAIL PROTECTED]> wrote:
> > #! usr/bin/python
> > # Chi-squared collo
+ O12) * (O11 + O21)
* (O12 + O22) * (O21 + O22))
print "Chi-Squared = ", chi2
if chi2 > 3.841:
print "These two words form a collocation"
else:
print "These two words do not form a collocation"
On Sat, Aug 16, 2008 at 2:09 PM, Steve Willoughby <
racting my attention to the typo
On Sat, Aug 16, 2008 at 2:09 PM, Steve Willoughby <[EMAIL PROTECTED]> wrote:
> On Sat, Aug 16, 2008 at 01:55:36PM -0400, Emad Nawfal ( ) wrote:
> > Hello Tutors,
> > I'm trying to write a small scrip to find collocations using chi
Hello Tutors,
I'm trying to write a small scrip to find collocations using chi squared,
depending on a fairly big corpus.
The program below does a good job, but it's too slow, and I need to process
something like 50 million words.
How can I make it run fast?
Your help is appreciated.
E
On Thu, Aug 14, 2008 at 7:08 PM, Joseph Bae <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm new to Python (and programming in general) and need some help!
>
> Here is my code so far for a temperature conversion program (converts
> between Fahrenheit and Celsius):
>
>
>
> temp = input("Enter A Number
On Thu, Jul 31, 2008 at 8:07 AM, S Python <[EMAIL PROTECTED]> wrote:
> Hi Everyone,
>
> I am trying to read a comma-delimitted list ("aaa","bbb","ccc") from a text
> file and assign those values to a list, x, such that:
>
> x = ["aaa", "bbb", "ccc"]
>
> The code that I have come up with looks like
On Sun, Mar 9, 2008 at 6:38 PM, Marc Tompkins <[EMAIL PROTECTED]>
wrote:
> 2008/3/9 Emad Nawfal <[EMAIL PROTECTED]>:
>
> > Thank you so much Kent. It works. I have now realized the bad things
> > about self-learning.
> >
>
2008/3/9 Kent Johnson <[EMAIL PROTECTED]>:
> Emad Nawfal wrote:
> > Dear Tutors,
> > I'm trying to get the most frequent words in an Arabic text. I wrote the
> > following code and tried it on English and it works fine, but when I try
> > it on Ar
Dear Tutors,
> I'm trying to get the most frequent words in an Arabic text. I wrote the
> following code and tried it on English and it works fine, but when I try it
> on Arabic, all I get is the slashes and x's. I'm not familiar with Unicode.
> Could somebody please tell me what's wrong here, and
Dear Tutors,
I'm trying to get the most frequent words in an Arabic text. I wrote the
following code and tried it on English and it works fine, but when I try it
on Arabic, all I get is the slashes and x's. I'm not familiar with Unicode.
Could somebody please tell me what's wrong here, and how I ca
On Sun, Mar 9, 2008 at 8:16 AM, Julia <[EMAIL PROTECTED]> wrote:
> Message: 3
> > Date: Sat, 08 Mar 2008 16:39:16 -0500
> > From: Kent Johnson <[EMAIL PROTECTED]>
> > Subject: Re: [Tutor] self-learning Python
> > To: "Enrique Nieves, Jr." <[EMAIL PROTECTED]>
> > Cc: tutor@python.org
> > Message-ID
Hi Tutors,
Is there a way to get the index of every occurence of a certain element in a
list. listname.index(element) gives me the index of the first occurence. For
example:
>>> t = 'we are we are we we we'.split()
>>> t
['we', 'are', 'we', 'are', 'we', 'we', 'we']
>>> for word in t:
if word =='
Hi Tutors,
I've just realized that i forgot to thank Kent Johnson for his advise on
Unicode.
Thank you kent.
Best,
Emad
On 9/18/07, Kent Johnson <[EMAIL PROTECTED]> wrote:
>
> Emad Nawfal wrote:
> > *Hi All Tutors,*
> > *I'm new and I'm trying to use u
*Hi All Tutors,*
*I'm new and I'm trying to use unicode strings in my code (specifically
Arabic), but I get this:*
IDLE 1.2.1
>>> text = ur'المصريون'
Unsupported characters in input
>>> for letter in text:
print letter
Traceback (most recent call last):
File "", line 1, in
for letter i
Hi All,
I'm beginning to learn Python for linguistic research using the Natural
Language Toolkit. I want to write a small piece of code to count lengths of
words and print them a long with the words. I've tried this but it does not
work. What's wrong with it, and how can I fix it?
phrase2 = ['co
Dear Folks,
I'm new to Python and programming in general. I'm interested in using Python
for text processing, but whenever I enter Arabic text, it says the text is
not supported.
How can I use Python for dealing with Arabic?
Thank you
--
If everyone is thinking alike, then somebody isn't thinking
38 matches
Mail list logo