Re: [Tutor] easygui question, again

2007-06-11 Thread Alan Gauld

"Rafael Bejarano" <[EMAIL PROTECTED]> wrote

> that it would be a relatively simple matter to import the easygui
> module and call its functions using the terminal window, especially
> given that I have had success in the past importing other modules 
> and
> calling their functions.

I suspect that this is because you have been using
the standard library modules which Python knows how to find.
When you add a downloaded module, like easygui, you need
to let Python know how to find it. This is done in one of
three ways:
1) Put it in the same folder from which you run python
2) Put it in /lib/site-packages
3) Put in in some other folder and add that folder to
your PYTHONPATH environment variable setting

The easiest way for you is probably number 2.

Try following this procedure:

1) Start Python to get a >>> prompt
2) import sys
3) print sys.path
4) use the mouse to select one of the lines that contains 
"site-packages"
5) Open a Finder window
6) Navigate in Finder to the folder highlighted in your Python window
7) If necessary navigate back up to site-packages itself
8) Create a new sub folder and name it EasyGui
9) Copy easygui.py into the new folder
10) Create a new text file called EasyGui.pth
11) enter the single line "EasyGui" (without the quotes) and save/exit 
the editor
12) exit python and enter it again.
13) type import easygui at the Python prompt.

If no error messages appear you should have installed easygui
where python can see it.

NB I typed that at my PC so its from memory and untested but
hopefully its close enough that you can figure out any discrepancies.

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] easygui question, again

2007-06-11 Thread Alan Gauld
"Rafael Bejarano" <[EMAIL PROTECTED]> wrote

> As I understand it from the description of this list, that is 
> exactly
> its purpose--to help people who no relatively little python.

That's true, but usually the folks asking questions are
fairly expert at using their computers so they are familiar
with concepts like command lines, changing directories,
creating text files, setting environment variables etc.
I suspect you are too within the  confines of the MacOS GUI,
the problem is that MacOS is such a good GUI that Mac
users rarely need to use a command line!

Unfortunately programming on any computer requires a
reasonable knowledge of the technical underpinnings of
how the computer works, something many Mac users
don't necessarily have. The easiest way to access
these things is via the Terminal application and the
Unix command prompt. The others are suggesting
that before progressing further you should invest the
time to learn the basics of using the MacOS Unix
command prompt.

In fact I think the only problem here is that you are trying
to use a non-standard module and something is wrong
with how it is set up. (See my other post). If you stick to
the standard Python modules you will be fine.

> Naturally, if the list collectively deems my questions 
> inappropriate,

The questions are fine, unfortunately the solutions require
some skills and knowledge that you apparently don't
possess yet. That's OK but this list is not the best place
to learn how to drive MacOS since most members don't
use it. But enough of us do that we should be able to give
you some pointers at least.

Regards,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] easygui question, again

2007-06-11 Thread Thorsten Kampe
* Rafael Bejarano (Sun, 10 Jun 2007 20:49:40 -0500)
> As I understand it from the description of this list, that is exactly  
> its purpose--to help people who no relatively little python.

That's correct. But your problem (or the solution to your problem) is 
more related to _Operating System_ basics as to Python basics (see 
also Alan Gaulds response).

And please don't send me private email.

Thanks, Thorsten

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] looking for some general advice

2007-06-11 Thread Michael Klier
Alan Gauld wrote:
> I'm not surecwhy but your messages are coming through to me 
> as text attachments which makes quoting them tricky...

Hmmm, I did a group reply in mutt the last time, lets see if a direct
reply and manuall CC: works right.

> > Also, what would be the right exception to raise if not 
> > enough arguments were passed to a programm?
> 
> I don't think there is a right answer, you can decide 
> for yourself, buty in general I try using the >>> prompt 
> with a deliberate error to see what Python does, thus:
> 
> >>> range()
> Traceback (most recent call last):
>   File "", line 1, in ?
> TypeError: range expected at least 1 arguments, got 0

That`s a very useful hint :) (makes me ask myself why I didn`t thought
about that yet ;)).

> So it looks like TypeError but personally I'm not so sure 
> that works for argv... I think a simple usage message and 
> exit with non zero is fine.

Well, that`s an option I didn`t thought of yet, I think I`ll do it that
way then.

Thanks or all your feedback.

Best Regards
Michael

-- 
Michael Klier


signature.asc
Description: Digital signature
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] easygui question, again

2007-06-11 Thread Kent Johnson
Alan Gauld wrote:
> "Rafael Bejarano" <[EMAIL PROTECTED]> wrote
> 
>> that it would be a relatively simple matter to import the easygui
>> module and call its functions using the terminal window, especially
>> given that I have had success in the past importing other modules 
>> and
>> calling their functions.
> 
> I suspect that this is because you have been using
> the standard library modules which Python knows how to find.
> When you add a downloaded module, like easygui, you need
> to let Python know how to find it. This is done in one of
> three ways:
> 1) Put it in the same folder from which you run python
> 2) Put it in /lib/site-packages
> 3) Put in in some other folder and add that folder to
> your PYTHONPATH environment variable setting
> 
> The easiest way for you is probably number 2.
> 
> Try following this procedure:
> 
> 1) Start Python to get a >>> prompt

Which means,
1a) Open Terminal
1b) type python and press return

> 2) import sys
> 3) print sys.path
> 4) use the mouse to select one of the lines that contains 
> "site-packages"

It won't be a line, it will be a long list. Depending on how your Python 
is installed site-packages will be at a location like
/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages
or
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages
> 5) Open a Finder window
> 6) Navigate in Finder to the folder highlighted in your Python window
> 7) If necessary navigate back up to site-packages itself
> 8) Create a new sub folder and name it EasyGui
> 9) Copy easygui.py into the new folder
> 10) Create a new text file called EasyGui.pth
> 11) enter the single line "EasyGui" (without the quotes) and save/exit 
> the editor

This will work but instead of 8-11 I would just copy easygui.py into 
site-packages.

Kent

> 12) exit python and enter it again.
> 13) type import easygui at the Python prompt.
> 
> If no error messages appear you should have installed easygui
> where python can see it.
> 
> NB I typed that at my PC so its from memory and untested but
> hopefully its close enough that you can figure out any discrepancies.
> 
> HTH,
> 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Ipython and refreshing changed modules

2007-06-11 Thread Andy Cheesman
Dear People

Silly question, I'm using Ipython and importing python modules  which
I've written. After a code modification, is there an easy, quick way to
refresh changed modules?
I've googled for the solutions but the answers does not seem clear!

Andy
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Ipython and refreshing changed modules

2007-06-11 Thread Alan Gauld

"Andy Cheesman" <[EMAIL PROTECTED]> wrote

> I've written. After a code modification, is there an easy, quick way 
> to
> refresh changed modules?

Look at the reload() function.

Alan G 


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Ipython and refreshing changed modules

2007-06-11 Thread Thorsten Kampe
* Alan Gauld (Mon, 11 Jun 2007 13:27:41 +0100)
> "Andy Cheesman" <[EMAIL PROTECTED]> wrote
> 
> > I've written. After a code modification, is there an easy, quick way 
> > to
> > refresh changed modules?
> 
> Look at the reload() function.

...and the deep reload option (which is the primary functional 
enhancement to the standard Python console)...

(Of course that's all pretty much documented in IPython's docs)

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Correct use of range function..

2007-06-11 Thread adam urbas
I see... Very Intriguing.> To: tutor@python.org> From: [EMAIL PROTECTED]> Date: 
Sun, 10 Jun 2007 18:16:00 +0100> Subject: Re: [Tutor] Correct use of range 
function..> > > "Adam Urbas" <[EMAIL PROTECTED]> wrote> >I discovered something 
about your revers word program here.  I used> > the "for c in word" one.> > if 
you type an indented print after print c, then it will print the> > words 
vertically.  Just thought I'd share that with you.> > You can achieve the same 
by missing out the comma at the end> of the print statement too. The comma 
suppresses a newline> character. By using a second print you put it back! So 
just> missing the comma achieves the same end result.> > Alan G.> > > On 
6/10/07, Kent Johnson <[EMAIL PROTECTED]> wrote:> >> David Hamilton wrote:> >> 
> I just finished doing an exercise in a tutorial on the range > >> > function> 
>> > and while I got it to work, my answer seems ugly. I'm wondering > >> > if 
I'm> >> > missing something in the way I'm using the range function.> >> > The 
tutorial ask me to print a string backwards. My solution > >> > works, but> >> 
> it it just doesn't "feel" right :).  My result is difficult to > >> > read 
and> >> > I feel like I'm probably over complicating the solution. > >> > 
Suggestions?> >> >> >> > word="reverse"> >> > #Start at the end of the string, 
count back to the start, > >> > printing each> >> > letter> >> > for  i in 
range(len(word)-1,-1,-1):> >> > print word[i],> >>> >> That's probably the 
best you can do using range(). You could write> >> ln = len(word)> >> for i in 
range(ln):> >>print word[ln-i-1],> >>> >> but that is not much different.> 
>>> >> You can do better without using range; you can directly iterate the> >> 
letters in reverse:> >>> >> for c in word[::-1]:> >>print c,> >>> >> Kent> 
>> ___> >> Tutor maillist  -  
Tutor@python.org> >> http://mail.python.org/mailman/listinfo/tutor> >>> > 
___> > Tutor maillist  -  
Tutor@python.org> > http://mail.python.org/mailman/listinfo/tutor> > > > > 
___> Tutor maillist  -  
Tutor@python.org> http://mail.python.org/mailman/listinfo/tutor
_
Hotmail to go? Get your Hotmail, news, sports and much more! Check out the New 
MSN Mobile! 
http://mobile.msn.com___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Off-Topic - Mutt and mailing lists

2007-06-11 Thread Simon Hooper
Hi Michael,

* On 11/06/07, Michael Klier wrote:
> Alan Gauld wrote:
> > I'm not surecwhy but your messages are coming through to me 
> > as text attachments which makes quoting them tricky...
> 
> Hmmm, I did a group reply in mutt the last time, lets see if a direct
> reply and manuall CC: works right.

I don't know if you are aware, but mutt has a great list-reply command
(bound to L by default) which "does the right thing" for mailing lists.
Look up list-reply in the mutt manual.

HTH

Simon.

-- 
Simon Hooper
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] easygui question, again

2007-06-11 Thread Adam Urbas
Where did you get this easygui thing you are trying to install.  Is it
the thing that says Compiled Python File?  If so I have it.  I've
kinda been following your little chat here about it.  I want to see if
I could do it.

On 6/11/07, Kent Johnson <[EMAIL PROTECTED]> wrote:
> Alan Gauld wrote:
> > "Rafael Bejarano" <[EMAIL PROTECTED]> wrote
> >
> >> that it would be a relatively simple matter to import the easygui
> >> module and call its functions using the terminal window, especially
> >> given that I have had success in the past importing other modules
> >> and
> >> calling their functions.
> >
> > I suspect that this is because you have been using
> > the standard library modules which Python knows how to find.
> > When you add a downloaded module, like easygui, you need
> > to let Python know how to find it. This is done in one of
> > three ways:
> > 1) Put it in the same folder from which you run python
> > 2) Put it in /lib/site-packages
> > 3) Put in in some other folder and add that folder to
> > your PYTHONPATH environment variable setting
> >
> > The easiest way for you is probably number 2.
> >
> > Try following this procedure:
> >
> > 1) Start Python to get a >>> prompt
>
> Which means,
> 1a) Open Terminal
> 1b) type python and press return
>
> > 2) import sys
> > 3) print sys.path
> > 4) use the mouse to select one of the lines that contains
> > "site-packages"
>
> It won't be a line, it will be a long list. Depending on how your Python
> is installed site-packages will be at a location like
> /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages
> or
> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages
> > 5) Open a Finder window
> > 6) Navigate in Finder to the folder highlighted in your Python window
> > 7) If necessary navigate back up to site-packages itself
> > 8) Create a new sub folder and name it EasyGui
> > 9) Copy easygui.py into the new folder
> > 10) Create a new text file called EasyGui.pth
> > 11) enter the single line "EasyGui" (without the quotes) and save/exit
> > the editor
>
> This will work but instead of 8-11 I would just copy easygui.py into
> site-packages.
>
> Kent
>
> > 12) exit python and enter it again.
> > 13) type import easygui at the Python prompt.
> >
> > If no error messages appear you should have installed easygui
> > where python can see it.
> >
> > NB I typed that at my PC so its from memory and untested but
> > hopefully its close enough that you can figure out any discrepancies.
> >
> > HTH,
> >
>
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] easygui question, again

2007-06-11 Thread Kent Johnson
Adam Urbas wrote:
> Where did you get this easygui thing you are trying to install.  Is it
> the thing that says Compiled Python File?  If so I have it.  I've
> kinda been following your little chat here about it.  I want to see if
> I could do it.

Google 'python easygui'

You probably want the .py file and the readme, not just the .pyc 
(compiled) file. Though it should work with just the .pyc file you won't 
have docs or the source to look at.

Kent
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Off-Topic - Mutt and mailing lists

2007-06-11 Thread Michael Klier
Simon Hooper wrote:
> Hi Michael,
> 
> * On 11/06/07, Michael Klier wrote:
> > Alan Gauld wrote:
> > > I'm not surecwhy but your messages are coming through to me 
> > > as text attachments which makes quoting them tricky...
> > 
> > Hmmm, I did a group reply in mutt the last time, lets see if a direct
> > reply and manuall CC: works right.
> 
> I don't know if you are aware, but mutt has a great list-reply command
> (bound to L by default) which "does the right thing" for mailing lists.
> Look up list-reply in the mutt manual.

Actually I wasn`t aware of "L", so thanks for the tip :D (mutt has a
monster of a manpage ;) I am not surprised I missed that). I always use
"r" which works with mailing lists that have the "Reply-To" header set
(I know that`s not preferred, and I understand why ;)). I think there
was a long thread about this topic a while ago on this list (could be
another one too, can`t rember that on top of my head). And, maybe I got
it wrong, I thought it would be preferred on this list to use the
senders mail in To: and CC: to the list?

Best Regards
Michael

-- 
Michael Klier


signature.asc
Description: Digital signature
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Python IDE

2007-06-11 Thread scott
Hi,

I have been using Kdevelop so far to develop and a few bugs it inherits 
from Kate/Kwrite are really annoying me.  It does not collapse quotes 
properly and there are other graphical glitches as well.

Could someone suggest a few good IDE's for me to look at.  I would need 
a IDE that haves syntax highlighting and I also really like type 
completion where the IDE gives you suggestions as you type.

Extras like a good built in dictionary and anything else that makes 
coding faster or easier would be great.  I also prefer a IDE that is for 
multiple languages, but I am willing to use a IDE that is only Python 
for now until those bugs get fixed in Kdevelop.

Lastly, I am a Linux user, so the IDE would need to run natively on 
Linux.  Thanks.


-- 
Your friend,
Scott

Sent to you from a Linux computer using Kubuntu Version 7.04 (Feisty Fawn)
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python IDE

2007-06-11 Thread shawn bright

you can use gedit with some plugins that make it pretty much like an ide,
and its really fast.
another really cool one is JEdit. That is what i used before i switched to
vim to do everything.
runs on everything, has what you are looking for. Eclipse with PyDev is
cool, too. But a little heavy for me.

hth


On 6/11/07, scott <[EMAIL PROTECTED]> wrote:


Hi,

I have been using Kdevelop so far to develop and a few bugs it
inherits
from Kate/Kwrite are really annoying me.  It does not collapse quotes
properly and there are other graphical glitches as well.

Could someone suggest a few good IDE's for me to look at.  I would
need
a IDE that haves syntax highlighting and I also really like type
completion where the IDE gives you suggestions as you type.

Extras like a good built in dictionary and anything else that
makes
coding faster or easier would be great.  I also prefer a IDE that is for
multiple languages, but I am willing to use a IDE that is only Python
for now until those bugs get fixed in Kdevelop.

Lastly, I am a Linux user, so the IDE would need to run natively
on
Linux.  Thanks.


--
Your friend,
Scott

Sent to you from a Linux computer using Kubuntu Version 7.04 (Feisty Fawn)
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python IDE

2007-06-11 Thread Gordon
Try Komodo Edit from ActiveState.  It's free (as in beer), it's 
cross-platform, and it's pretty darn good.  I haven't used it on Linux 
myself, but it does have a Linux download.

If being closed-source bothers you, Eclipse+PyDev might be your best option.

scott wrote:
> Hi,
>
>   I have been using Kdevelop so far to develop and a few bugs it inherits 
> from Kate/Kwrite are really annoying me.  It does not collapse quotes 
> properly and there are other graphical glitches as well.
>
>   Could someone suggest a few good IDE's for me to look at.  I would need 
> a IDE that haves syntax highlighting and I also really like type 
> completion where the IDE gives you suggestions as you type.
>
>   Extras like a good built in dictionary and anything else that makes 
> coding faster or easier would be great.  I also prefer a IDE that is for 
> multiple languages, but I am willing to use a IDE that is only Python 
> for now until those bugs get fixed in Kdevelop.
>
>   Lastly, I am a Linux user, so the IDE would need to run natively on 
> Linux.  Thanks.
>
>
>   

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python IDE

2007-06-11 Thread Alan Gauld
"scott" <[EMAIL PROTECTED]> wrote

> Could someone suggest a few good IDE's for me to look at.

If you want to standardise on one environment that is industrial
strength and multi platform go for eclipse. its heavyweight
but does it all.

Not only is it open source IDE king but several commercial
companies are moving their in-house IDEs to it as well - Oracle,
Borland and IBM to name but three.

With pydev installed its pretty impressive, so far as I can tell
the only missing feature is a GUI builder!

> a IDE that haves syntax highlighting and I also really like type
> completion where the IDE gives you suggestions as you type.

Yep, Eclipse does both.

> Extras like a good built in dictionary

Not quite sure what you mean by that one.
Can you illustrate?

> coding faster or easier would be great.

It does folding, has a built in debugger and class browser.

> multiple languages, but I am willing to use a IDE
> that is only Python

It supports Java and C++ out of the box but there are
plug-ins for everything from SQL to UML and Lisp.

> Lastly, I am a Linux user, so the IDE would need to run natively on
> Linux.

It runs on most platforms so you can take your skills with you.

The only snag is that it is big asnd beefy and needs a powerful
box to run it well.

If you want something lighter then try SPE, or even Pythonwin.
I'm playing with wxPython's tools at the moment and ALa Mode
looks promising too. But ulitimately I'm a long term vim user
so tend to stick to the traditional Unix toolset personally...

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python IDE

2007-06-11 Thread Andreas Kostyrka
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



Alan Gauld wrote:
> "scott" <[EMAIL PROTECTED]> wrote
> 
>> Could someone suggest a few good IDE's for me to look at.
> 
> If you want to standardise on one environment that is industrial
> strength and multi platform go for eclipse. its heavyweight
> but does it all.
> 
> Not only is it open source IDE king but several commercial
> companies are moving their in-house IDEs to it as well - Oracle,
> Borland and IBM to name but three.
> 
> With pydev installed its pretty impressive, so far as I can tell
> the only missing feature is a GUI builder!

Well, the Subversion support is painful. Dogslow. Eclipse is slow, but
the svn plugin that I've seen my colleagues use was IMHO (a Linux based
developer, emacs + commandline svk, who complains that svk is painful
slow *g*) unuseable for work.

(With unusable I mean, that I was able to branch trunk, fix some small
errors, run the unittests, merge the branch with svk while eclipse was
still running an "Update Workspace" command.)

Andreas
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGbb3KHJdudm4KnO0RAkqDAJ4p0z+7KNm09jCgxp1CPnAI1AjatACfV0xn
Hn9Au6XYc/71zLRyBoEukGE=
=QzeR
-END PGP SIGNATURE-
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python IDE

2007-06-11 Thread Rob Andrews
Personally, I use and love Komodo (the full version, although Komodo
Edit is nice). I didn't *expect* to like it, but it won me over with
ease.

On 6/11/07, scott <[EMAIL PROTECTED]> wrote:
>Could someone suggest a few good IDE's for me to look at.
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python IDE

2007-06-11 Thread Alan Gauld
"Andreas Kostyrka" <[EMAIL PROTECTED]> wrote in

> Well, the Subversion support is painful. Dogslow. Eclipse is slow, 
> but
> the svn plugin that I've seen my colleagues use was IMHO (a Linux 
> based
> developer, emacs + commandline svk, who complains that svk is 
> painful
> slow *g*) unuseable for work.

Haven't used it with subversion, in fact I've never used subversion!
(We use Borland tools at work)

But I did say eclipse was heavyweight and needed a big PC. :-)

My old laptop didn't like it at all and my 600MHz G3 iBook goes
to sleep with it. but my nice new 3GHz dual core with 2G Ram
seems perfectly happy running it. So if you have a PC with that
general kind of spec Eclipse is worth a try.

Alan G. 


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python IDE

2007-06-11 Thread Alan Gauld

"Alan Gauld" <[EMAIL PROTECTED]> wrote 

> It supports Java and C++ out of the box but there are

Actually C++ is a plug-in too, but free ones are available...

Alan G.


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python IDE

2007-06-11 Thread johnf
On Monday 11 June 2007 13:01, scott wrote:
> Hi,
>
>   I have been using Kdevelop so far to develop and a few bugs it inherits
> from Kate/Kwrite are really annoying me.  It does not collapse quotes
> properly and there are other graphical glitches as well.
>
>   Could someone suggest a few good IDE's for me to look at.  I would need
> a IDE that haves syntax highlighting and I also really like type
> completion where the IDE gives you suggestions as you type.
>
>   Extras like a good built in dictionary and anything else that makes
> coding faster or easier would be great.  I also prefer a IDE that is for
> multiple languages, but I am willing to use a IDE that is only Python
> for now until those bugs get fixed in Kdevelop.
>
>   Lastly, I am a Linux user, so the IDE would need to run natively on
> Linux.  Thanks.
Others have suggested free IDE's.  But I like 'wing'.  Cost a little but works 
very well.
-- 
John Fabiani
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] cannot pickle instancemethod objects

2007-06-11 Thread hok kakada
Dear everyone,

I got a problem while pickling a class object. I have done something as below:
pickleFile = open(filename, 'wb')
pickle.dump(matcher, pickleFile)
pickleFile.close()

where matcher is  class object and I got the follow errors:
Traceback (most recent call last):
  File "/usr/lib/python2.5/pickle.py", line 1362, in dump
Pickler(file, protocol).dump(obj)
  File "/usr/lib/python2.5/pickle.py", line 224, in dump
self.save(obj)
  File "/usr/lib/python2.5/pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
  File "/usr/lib/python2.5/pickle.py", line 725, in save_inst
save(stuff)
  File "/usr/lib/python2.5/pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
  File "/usr/lib/python2.5/pickle.py", line 649, in save_dict
self._batch_setitems(obj.iteritems())
  File "/usr/lib/python2.5/pickle.py", line 663, in _batch_setitems
save(v)
  File "/usr/lib/python2.5/pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
  File "/usr/lib/python2.5/pickle.py", line 725, in save_inst
save(stuff)
  File "/usr/lib/python2.5/pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
  File "/usr/lib/python2.5/pickle.py", line 649, in save_dict
self._batch_setitems(obj.iteritems())
  File "/usr/lib/python2.5/pickle.py", line 663, in _batch_setitems
save(v)
  File "/usr/lib/python2.5/pickle.py", line 306, in save
rv = reduce(self.proto)
  File "/usr/lib/python2.5/copy_reg.py", line 69, in _reduce_ex
raise TypeError, "can't pickle %s objects" % base.__name__
TypeError: can't pickle instancemethod objects

Does anybody please point me what could be a problem here?

Thanks very much for your help!
da
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python IDE

2007-06-11 Thread Preecha Bundrikwong

Hi,

I'm supporting John's opinion. WingIDE rocks!! I use Linux at work, Windows
& Mac at home, I notice the Python editor on Windows also hints you the
syntax as you type.

Enjoy!
PB
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] clarification on os.path.walk

2007-06-11 Thread Chandrashekar
Hi,

I have a program like this.

import os,os.path
import re

def print_files(arg,dir,files):
'''print 'arg', arg
print 'dir', dir
print 'files',files'''
for file in files:
path = os.path.join(dir,file)
path = os.path.normcase(path)
if re.search(r".*\.txt",path):
print path
 

os.path.walk('.',print_files,1)

My doubt is that what does the argument stand for in this program?
os.path.walk('.',print_files,0)
os.path.walk('.',print_files,1)
os.path.walk('.',print_files,2)

all seems to be rendering the same output. Can anyone clarify when this 
argument is used.

Thanks,
Chandru



 
-
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] clarification on os.path.walk

2007-06-11 Thread Luke Paireepinart
Chandrashekar wrote:
> Hi,
>
> I have a program like this.
>
> import os,os.path
> import re
>
> def print_files(arg,dir,files):
> '''print 'arg', arg
> print 'dir', dir
> print 'files',files'''
> for file in files:
> path = os.path.join(dir,file)
> path = os.path.normcase(path)
> if re.search(r".*\.txt",path):
> print path
>  
>
> os.path.walk('.',print_files,1)
>
> My doubt is that what does the argument stand for in this program?
> os.path.walk('.',print_files,0)
> os.path.walk('.',print_files,1)
> os.path.walk('.',print_files,2)
>
> all seems to be rendering the same output. Can anyone clarify when 
> this argument is used.
 >>> import os
 >>> help(os.path.walk)
Help on function walk in module ntpath:

walk(top, func, arg)
Directory tree walk with callback function.
   
For each directory in the directory tree rooted at top (including top
itself, but excluding '.' and '..'), call func(arg, dirname, fnames).
dirname is the name of the directory, and fnames a list of the names of
the files and subdirectories in dirname (excluding '.' and '..').  func
may modify the fnames list in-place (e.g. via del or slice assignment),
and walk will only recurse into the subdirectories whose names remain in
fnames; this can be used to implement a filter, or to impose a specific
order of visiting.  No semantics are defined for, or required of, arg,
beyond that arg is always passed to func.  It can be used, e.g., to pass
a filename pattern, or a mutable object designed to accumulate
statistics.  Passing None for arg is common.


HTH,
-Luke
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor