Re: [Tutor] Need a solution.
"David" wrote class GuessError(Exception): pass class GuessedNumber: def __init__(self,tries=None,limits=None):... def generate(self, limits=None):... def __cmp__(self, aNumber): if self.count >= self.tries: raise GuessError Thanks always for the feedback, i came up with this, not sure if it is much better but I am learning as I prod along :) The big problem from an OO point of view is that you are not making the objects do any work. You are extracting the data from inside them and you are doing all the work in your main function. In OOP we should be trying to make the objects do everything and the main function just does some high level coordination. If you make your GuessedNumber class have comparison methods you can avoid much of that. And if you put the counting code inside the comparison that could save a lot of effort in main too. Remember that in theory you shold not know what data is inside the object. You should only interact with objects via their published operations. #!/usr/bin/python from random import randrange from sys import exit class GuessedNumber: def __init__(self, attempts=None): self.attempts = attempts self.number = randrange(1,99) Any time you have a class that just has an __init__ it means its not doing anything. And that's a bad sign. Classes are there to *do* things not just store data. We can use a tuple or dictionary to do that. class Counter: def __init__(self): self.value = 0 def step(self): self.value += 1 def current(self): return self.value Whilst this is OK,, because it does something, its a lot of code to wrap an integer. I personally wouldn't bother. But at least it is doing things :-) def play(): c = Counter() guessit = GuessedNumber(attempts=5) target_number = guessit.number attempts = guessit.attempts See, here is the problem, you create an object then immediately extract all the data and then just ignore the object. You might as well just assign the values to variables guess = int(raw_input('Guess-> ')) c.step() while c.current() < attempts: So why not while c.current() < guessit.attempts use the object, thats why its there try: if guess == target_number: Whereas this could have been if guess == guessIt print "Well Done" play_again() elif guess < target_number: and elif guess < guessit print 'Higher ... ' guess = int(raw_input('Guess Again-> ')) c.step() elif guess > target_number: print 'Lower ... ' guess = int(raw_input('Guess Again-> ')) c.step() except ValueError: print 'You must enter a number' pass print 'Too many attempts, the number was', target_number play_again() def play_again(): answer = raw_input('Do you want to try again? y/n ') answer = answer.lower() if answer == 'y': play() else: exit() This recursive approach will work most of the time but remember that Python does limit recursion to 1000 levels so if your player was very keen you could run out of levels. A normal loop would be safer. HTH, Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Best Python Editor
Hi guys, What would you regard as the best free Python editor to use on Windows for a new guy? Searching Google i see that there is quite a few out there and is "VIM" the best one to go with? Regards Eddie ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Need a solution.
Le Sat, 13 Jun 2009 09:20:36 +0100, "Alan Gauld" s'exprima ainsi: > Any time you have a class that just has an __init__ it means > its not doing anything. And that's a bad sign. Classes are there > to *do* things not just store data. We can use a tuple or > dictionary to do that. While this is probably true for _single_ objects in most case, I guess it really makes sense to create a common structure for object collections. Eg Position, with x & y attributes, for a very simple case. But indeed there are complex ones, possibly with nested structures such as eg Point inlcluding position, color,... In addition, doing this helps readibility by clearly exposing the object (type) structure in a single & visible place. All of this applies both to "value" objects (pure information, such as a position) and "real" objects (distinct things, such as a point). What do you think? Denis -- la vita e estrany ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Best Python Editor
2009/6/13 Eddie : > Hi guys, > > What would you regard as the best free Python editor to use on Windows > for a new guy? Searching Google i see that there is quite a few out > there and is "VIM" the best one to go with? Vim is a general purpose programmer's editor with python support, rather than a python-specific editor. Vim has incredibly powerful at editing text, but the learning curve is steep. Personally, I think it's great, though :-) But really, if you ask ten programmers what the best editor is, you'll probably get twelve answers. I'm sure you could find many discussions on this topic in the list archives. -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Best Python Editor
Eddie wrote: Hi guys, What would you regard as the best free Python editor to use on Windows for a new guy? Searching Google i see that there is quite a few out there and is "VIM" the best one to go with? Regards Eddie This is such a common question on the python forums it ought to be in a FAQ, and maybe it is. VI and EMACS are the two "standard" Unix editors, going back decades. Somebody used to the flexibility of either of those two, who is now stuck on Windows, would naturally not want to give up any of the "customizability" of these. And people have posted macros for each to automate some of the things you'd like for Python, such as auto-indent. VIM is an editor in that heritage. Somebody who's used Windows for 20 years, however, might expect that Ctrl-S, Ctrl-F4, Alt-F4, etc. have standard meanings. So they might be more comfortable in an editor that starts with the Windows interface, and builds on it. I use metapad for many things, though not for Python. Others use Notepad++. Next question is whether you want an IDE. The ability to single-step in the debugger, locate and fix a problem in source, and start again, in a single environment is appealing. When I have a stack trace showing in the debugger, I can use the debugger to locate the source at any level of that stack without having to explicitly load the file and jump to the specified line number. And no risk that the same file is already loaded into some other editor and I'm going to lose changes if some are made one place and some another. And of course, it's nice to have a locals window, a globals window, a watch window, ... People that do not like an IDE cite the advantage of using a single editor for several programming languages, for word processing, and for web design. If such an editor is highly programmable, that would seem very good as well. So then it comes down to opinion. I use the (not-free) Komodo IDE. There is a free Komodo-Edit with most of the same features, but I really don't know what subset it includes. It is programmable with many canned add-ins, or you can customize it yourself with recorded macros and with scripts in Python or (I think) Javascript. Its addin technology is related somehow to Firefox, and I think it used a lot of the Mozilla code in its engine. The default UI is very familiar to people with Windows experience, though I don't know how it works on Mac and Linux http://www.activestate.com/komodo/Komodo IDE http://www.activestate.com/komodo_edit/ opensource Komodo Edit http://www.activestate.com/komodo_edit/comparison/comparison between the two ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Best Python Editor
For Windows check out PyScripter. Its IDE is similar to Borland Delphi and I find it very easy to use. Whatever works for you would be "best" for you. PyScripter is FREE and I would highly recommend it for people who are new to Python or people with programming experience that are used to programming in a IDE. Regards, T. Green On Sat, Jun 13, 2009 at 6:52 AM, Dave Angel wrote: > Eddie wrote: > > Hi guys, >> >> What would you regard as the best free Python editor to use on Windows >> for a new guy? Searching Google i see that there is quite a few out >> there and is "VIM" the best one to go with? >> >> Regards >> Eddie >> >> >> > This is such a common question on the python forums it ought to be in a > FAQ, and maybe it is. > > VI and EMACS are the two "standard" Unix editors, going back decades. > Somebody used to the flexibility of either of those two, who is now stuck > on Windows, would naturally not want to give up any of the "customizability" > of these. And people have posted macros for each to automate some of the > things you'd like for Python, such as auto-indent. VIM is an editor in that > heritage. > > Somebody who's used Windows for 20 years, however, might expect that > Ctrl-S, Ctrl-F4, Alt-F4, etc. have standard meanings. So they might be more > comfortable in an editor that starts with the Windows interface, and builds > on it. I use metapad for many things, though not for Python. Others use > Notepad++. > > Next question is whether you want an IDE. The ability to single-step in > the debugger, locate and fix a problem in source, and start again, in a > single environment is appealing. When I have a stack trace showing in the > debugger, I can use the debugger to locate the source at any level of that > stack without having to explicitly load the file and jump to the specified > line number. And no risk that the same file is already loaded into some > other editor and I'm going to lose changes if some are made one place and > some another. And of course, it's nice to have a locals window, a globals > window, a watch window, ... > > People that do not like an IDE cite the advantage of using a single editor > for several programming languages, for word processing, and for web design. > If such an editor is highly programmable, that would seem very good as > well. > > So then it comes down to opinion. I use the (not-free) Komodo IDE. There > is a free Komodo-Edit with most of the same features, but I really don't > know what subset it includes. It is programmable with many canned add-ins, > or you can customize it yourself with recorded macros and with scripts in > Python or (I think) Javascript. Its addin technology is related somehow to > Firefox, and I think it used a lot of the Mozilla code in its engine. The > default UI is very familiar to people with Windows experience, though I > don't know how it works on Mac and Linux > > http://www.activestate.com/komodo/Komodo IDE > http://www.activestate.com/komodo_edit/ opensource Komodo Edit > http://www.activestate.com/komodo_edit/comparison/comparison between > the two > > > > > ___ > 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] Need a solution.
"spir" wrote Any time you have a class that just has an __init__ it means its not doing anything. And that's a bad sign. Classes are there to *do* things not just store data. We can use a tuple or dictionary to do that. While this is probably true for _single_ objects in most case, I guess it really makes sense to create a common structure for object collections. I'd say that's valid for a very small number of cases which would normally be addressed using a record in Pascal or struct in C/C++. Mainly for the advantage of self documenting data. But a dictionary can do that too, albeit you need to specify the field names on construction. But in the vast majority of such cases I'd still use a tuple. Where it gets more valid is where we have deeply nested data structures. But then, I've never seen such a structure that didn't have methods too. And then it becomes a valid class... Position, with x & y attributes, for a very simple case. I'd use a tuple here even if p[0] is slightly less readable than p.x But indeed there are complex ones, possibly with nested structures such as eg Point inlcluding position, color,... In that case there will almost always be associated methods to be created. Even a "simple" x,y point often has comparison methods or draw() or move()... In addition, doing this helps readibility by clearly exposing the object (type) structure in a single & visible place. The visibility and naming aspect referred to above is the most valid reasopn I can think of for using a non behavioural class. But in most cases, non behavioural classes quickly become behavioural! After all what is the point(sic) of data if you don't do something to it? All of this applies both to "value" objects (pure information, such as a position) and "real" objects (distinct things, such as a point). What do you think? I think that you have a valid point but that "pure value" objects occur far less often than you might think. I always treat a value object as a sign that I've probably put some processing code in the wrong place! Only when I've checked and convinced myself I'm wrong would I proceed. For example, what do we do with the values? Do we print them? Then maybe we should have a __str__ method? Do we save them in a file? Then maybe we need a save() method? Do we do some calculations? Maybe we should have a calculate() method? Do we draw them... well, I'm sure you get the idea :-) -- Alan Gauld Author of the Learn to Program web site http://www.alan-g.me.uk/ ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Best Python Editor
"Eddie" wrote What would you regard as the best free Python editor to use on Windows for a new guy? Searching Google i see that there is quite a few out there and is "VIM" the best one to go with? vim is a great editor, especially if you use multiple OS, but it has a steep learning curve. I'd recommend Pythonwin for a newbie learning Python. Or Scite as a general purpoase programmers editor - it has the advantage of tabbed editing windows for working with multiple windows, but otherwise is the same basic editing widget that Pythonwin uses. (Notepad++ also uses the same components and is very similar to scite) But there are zillions of programmers editors and choice is extremely personal. Other popular choices for Windows include Eclipse, Winedit, emacs, etc... But for Python specific work I'd go with Pythonwin. -- Alan Gauld Author of the Learn to Program web site http://www.alan-g.me.uk/ ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Best Python Editor
"Tom Green" wrote For Windows check out PyScripter. I just did, Wow!, this looks like a superb IDE. Thanks for posting, its a new one for me although its been out for quite a while. And the P4D delphi plugin looks useful too. Thanks again, Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Best Python Editor
"Alan Gauld" wrote I just did, Wow!, this looks like a superb IDE. I spoke a wee bit too soon. The editor is nice but the debugger and some of the other tools windows (eg variables) are broken. Pity, lots of potential here. Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Best Python Editor
Alan, > I spoke a wee bit too soon. The editor is nice but the debugger and some of > the other tools windows (eg variables) are broken. Pity, lots of potential > here. The current release of Pyscripter is not stable. Drop back one release and you'll find a very solid product. Malcolm ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Best Python Editor
-Original Message- >From: pyt...@bdurham.com >Sent: Jun 13, 2009 10:16 AM >To: Alan Gauld , tutor@python.org >Subject: Re: [Tutor] Best Python Editor > >Alan, > >> I spoke a wee bit too soon. The editor is nice but the debugger and some of >> the other tools windows (eg variables) are broken. Pity, lots of potential >> here. > >The current release of Pyscripter is not stable. > >Drop back one release and you'll find a very solid product. > >Malcolm Sounds interesting. What is the stable version and where can it be found? . ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Need a solution.
Alan Gauld wrote: "David" wrote class GuessError(Exception): pass class GuessedNumber: def __init__(self,tries=None,limits=None):... def generate(self, limits=None):... def __cmp__(self, aNumber): if self.count >= self.tries: raise GuessError Thanks always for the feedback, i came up with this, not sure if it is much better but I am learning as I prod along :) The big problem from an OO point of view is that you are not making the objects do any work. You are extracting the data from inside them and you are doing all the work in your main function. In OOP we should be trying to make the objects do everything and the main function just does some high level coordination. If you make your GuessedNumber class have comparison methods you can avoid much of that. And if you put the counting code inside the comparison that could save a lot of effort in main too. Remember that in theory you shold not know what data is inside the object. You should only interact with objects via their published operations. #!/usr/bin/python from random import randrange from sys import exit class GuessedNumber: def __init__(self, attempts=None): self.attempts = attempts self.number = randrange(1,99) Any time you have a class that just has an __init__ it means its not doing anything. And that's a bad sign. Classes are there to *do* things not just store data. We can use a tuple or dictionary to do that. class Counter: def __init__(self): self.value = 0 def step(self): self.value += 1 def current(self): return self.value Whilst this is OK,, because it does something, its a lot of code to wrap an integer. I personally wouldn't bother. But at least it is doing things :-) def play(): c = Counter() guessit = GuessedNumber(attempts=5) target_number = guessit.number attempts = guessit.attempts See, here is the problem, you create an object then immediately extract all the data and then just ignore the object. You might as well just assign the values to variables guess = int(raw_input('Guess-> ')) c.step() while c.current() < attempts: So why not while c.current() < guessit.attempts use the object, thats why its there try: if guess == target_number: Whereas this could have been if guess == guessIt print "Well Done" play_again() elif guess < target_number: and elif guess < guessit print 'Higher ... ' guess = int(raw_input('Guess Again-> ')) c.step() elif guess > target_number: print 'Lower ... ' guess = int(raw_input('Guess Again-> ')) c.step() except ValueError: print 'You must enter a number' pass print 'Too many attempts, the number was', target_number play_again() def play_again(): answer = raw_input('Do you want to try again? y/n ') answer = answer.lower() if answer == 'y': play() else: exit() This recursive approach will work most of the time but remember that Python does limit recursion to 1000 levels so if your player was very keen you could run out of levels. A normal loop would be safer. HTH, Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor Ok, I think I am getting somewhere now :) #!/usr/bin/python from random import randrange from sys import exit class GuessedNumber: def __init__(self, count=0, attempts=None): self.attempts = attempts self.number = randrange(1,99) self.count = count def step(self): self.count += 1 def current(self): return self.count def play(): guessit = GuessedNumber(attempts=5) guess = int(raw_input('Guess-> ')) guessit.step() while guessit.current() < guessit.attempts: try: if guess == guessit.number: print "Well Done" play_again() elif guess < guessit.number: print 'Higher ... ' guess = int(raw_input('Guess Again-> ')) guessit.step() elif guess > guessit.number: print 'Lower ... ' guess = int(raw_input('Guess Again-> ')) guessit.step() except ValueError: print 'You must enter a number' pass print 'Too many attempts, the number was', guessit.number play_again() def play_again(): answer = raw_input('Do you want to try again? y/n ') answer = answer.lower() if answer == 'y': play() else: exit() if __name__ == "__main__": play() -- Powered by Gentoo GNU/Linux http://linuxcrazy.com ___ Tutor maillist - Tutor@python.org http://
Re: [Tutor] Best Python Editor
>> The current release of Pyscripter is not stable. Drop back one release and >> you'll find a very solid product. > Sounds interesting. What is the stable version and where can it be found? Ken, Here's the version we use: Version 1.7.2, Oct 2006 http://mmm-experts.com/Downloads.aspx?ProductId=4 The most current release (w/2.6.x and 3.x support) can be found here: http://code.google.com/p/pyscripter/ We tried running newer releases earlier this year and had lots of problems. The very latest versions on code.google may be better, but we haven't looked at them. I am interested in hearing feedback on anyone running the most recent release of Pyscripter. Malcolm . ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Need a solution.
> Ok, I think I am getting somewhere now :) A lot better, now add the comparison methods: > class GuessedNumber: > def __init__(self, count=0, attempts=None): > self.attempts = attempts > self.number = randrange(1,99) > self.count = count > def step(self): > self.count += 1 > def current(self): > return self.count def __lt__(self,other): return self.number < other def __gt__(self,other): return self.number > other def __eq__(self,other): return self.numer == other [caveat: There are better ways of doing this but this illustrates the principle most clearly!] And now you can write your tests as > def play(): > guessit = GuessedNumber(attempts=5) > guess = int(raw_input('Guess-> ')) > guessit.step() > while guessit.current() < guessit.attempts: > try: if guess == guessit etc... HTH, Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Best Python Editor
Hi All, I have been using komodo from last two yrs. Its really very good open source editor. we can use this editor to edit python, php, Ruby, html On Sat, Jun 13, 2009 at 9:52 PM, wrote: >>> The current release of Pyscripter is not stable. Drop back one release and >>> you'll find a very solid product. > >> Sounds interesting. What is the stable version and where can it be found? > > Ken, > > Here's the version we use: > > Version 1.7.2, Oct 2006 > http://mmm-experts.com/Downloads.aspx?ProductId=4 > > The most current release (w/2.6.x and 3.x support) can be found here: > http://code.google.com/p/pyscripter/ > > We tried running newer releases earlier this year and had lots of > problems. The very latest versions on code.google may be better, but we > haven't looked at them. > > I am interested in hearing feedback on anyone running the most recent > release of Pyscripter. > > Malcolm > > > . > ___ > Tutor maillist - tu...@python.org > http://mail.python.org/mailman/listinfo/tutor > -- Ataulla SH web:www.kring.com personal blog:www.ataulla.objectis.net KRING Technologies India Pvt. Ltd. 1st Floor, Tower B, Infinity Towers, DLF II, Gurgaon-122 002 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Best Python Editor
Thanks for the input guys. I think I'll give PyScripter (the previous version that was linked to) and Komodo a try and see which I like best. Eddie 2009/6/14 Ataulla S H : > Hi All, > > I have been using komodo from last two yrs. > > Its really very good open source editor. > > we can use this editor to edit python, php, Ruby, html > > On Sat, Jun 13, 2009 at 9:52 PM, wrote: The current release of Pyscripter is not stable. Drop back one release and you'll find a very solid product. >> >>> Sounds interesting. What is the stable version and where can it be found? >> >> Ken, >> >> Here's the version we use: >> >> Version 1.7.2, Oct 2006 >> http://mmm-experts.com/Downloads.aspx?ProductId=4 >> >> The most current release (w/2.6.x and 3.x support) can be found here: >> http://code.google.com/p/pyscripter/ >> >> We tried running newer releases earlier this year and had lots of >> problems. The very latest versions on code.google may be better, but we >> haven't looked at them. >> >> I am interested in hearing feedback on anyone running the most recent >> release of Pyscripter. >> >> Malcolm >> >> >> . >> ___ >> Tutor maillist - tu...@python.org >> http://mail.python.org/mailman/listinfo/tutor >> > > > > -- > Ataulla SH > > web:www.kring.com > personal blog:www.ataulla.objectis.net > KRING Technologies India Pvt. Ltd. > 1st Floor, Tower B, Infinity Towers, DLF II, Gurgaon-122 002 > ___ > Tutor maillist - tu...@python.org > http://mail.python.org/mailman/listinfo/tutor > ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Best Python Editor
On Saturday 13 June 2009 04:44, Eddie wrote: > Hi guys, > > What would you regard as the best free Python editor to use on Windows > for a new guy? Searching Google i see that there is quite a few out > there and is "VIM" the best one to go with? > > Regards > Eddie I've tried a lot of editors, and my current favorite (cross platform, many languages/just text) is Kate (http://www.kate-editor.org/kate), available on windoze via KDE on Windows (http://windows.kde.org/), select kdesdk-msvc from the list of packages while in the installion tool. Cheers ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Best Python Editor
wrote The current release of Pyscripter is not stable. Drop back one release and you'll find a very solid product. Sounds interesting. What is the stable version and where can it be found? Here's the version we use: Version 1.7.2, Oct 2006 http://mmm-experts.com/Downloads.aspx?ProductId=4 Thats the version I downloaded. The debugger was very iffy and the variables pane just threw up Windows exception dialogs. The core editor and shell windows seemed fine though Alan G ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Best Python Editor
Try out Vim. It may take you a week to get used to it. Best thing I ever did was finally get started on Vim. Once I got used to it I was very happy. Google around for Vim tutorials. There is a #VIM channel on freenode I believe. There is also a VIM mailing list that is very helpful. You won't need these for long. Once you get used to it and think you've learned all you can you find out there's even more stuff you can do with it. If you wanna try Emacs go for it. You don't need an IDE for python. In the very beginning of writing python I wrote on windows using notepad and Linux using Gedit. While Gedit was better it was nothing compared to Vim. My favorite thing to do is open vim one one document I'm working on, then split the screen horizonatally for each other relevent document I'm working on. I can thing split it vertically as well. I also know that once you have saved your python document in vim you can test out your code by typing :!python % and it invokes the python interpreter in a shell for that script. Then when the program is done it returns to Vim. It also indents and colors syntax for my other languages as well: C/Java/HTML/CSS. So it's something that you use for life once you get that feeling of enlightenment that comes from never having to remove your hands from the keyboard. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Best Python Editor
On Sat, Jun 13, 2009 at 7:40 PM, Mike Hoy wrote: > Try out Vim. It may take you a week to get used to it. Best thing I ever > did was finally get started on Vim. Once I got used to it I was very happy. > Google around for Vim tutorials. There is a #VIM channel on freenode I > believe. There is also a VIM mailing list that is very helpful. You won't > need these for long. Once you get used to it and think you've learned all > you can you find out there's even more stuff you can do with it. > > > So it's something that you use for life once you get that feeling of > enlightenment that comes from never having to remove your hands from the > keyboard. I'm another viim fanatic; I use two terminals - one with vim and one with ipython (I write most of my code on linux). When I'm on windows I have a cmd window open with Ipython and I have a gVim window open. I'm sure I barely scratch the surface of things I can do and I know I've stopped using some things that I'm sure I'll start using the more I code. I really like using F5 to run my code, so you can put in your .vimrc so you don't have to type it, or just type it every time: map :!python % and every time you hit it will run your current script. Of course I also write code in c++ for school, so I have a few different keys that will change the F5 bindings. Anyhow, the best way to write code is in what you're most comfortable with and enjoy. And of course I believe that everyone should enjoy vim ;) But you should give all the aforementioned tools a try and see what works best for you. HTH! Wayne ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Best Python Editor
> > > > I really like using F5 to run my code, so you can put in your .vimrc so you > don't have to type it, or just type it every time: > > map :!python % > > and every time you hit it will run your current script. > > Thanks for that. It's even better than typing :!python % because it doesn't spawn a shell separate from the Vim window. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Best Python Editor
I downloaded the previous version of PyScripter although couldn't get it to work and after googling it, I downloaded Python Portable 1.1 (Python 2.6.1 as most sites/books recommend this and not 3) which has PySCripter included and this then works fine.Ii also downloaded Komod0 5.1 and after messing around with these, I think I prefer PyScripter and will use that for the mean time. I'll also take a look at VIM as being able to use the same program for PHP/CSS/HTML (and Basic if it supports it) as well as hopefully Python (I've only just started learning it) would be an advantage. Thanks guys Eddie 2009/6/14 Mike Hoy : >> >> >> I really like using F5 to run my code, so you can put in your .vimrc so >> you don't have to type it, or just type it every time: >> >> map :!python % >> >> and every time you hit it will run your current script. >> > Thanks for that. It's even better than typing :!python % because it doesn't > spawn a shell separate from the Vim window. > > ___ > Tutor maillist - tu...@python.org > http://mail.python.org/mailman/listinfo/tutor > > ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor