Re: [Tutor] program hangs in while loop using wx.yield

2010-11-14 Thread Alan Gauld
"Alex Hall" wrote I had this working back in the summer, but have since had to restructure some things in the code. Now, my program is hanging while it waits for the human player to take his/her turn, and I am not sure how to free it; I don't really understand this concept in a GUI? Why wo

Re: [Tutor] Creating one file out of all the files in a directory

2010-11-14 Thread Josep M. Fontana
Hi Kushal, First of all, thanks a lot for your help. > > Your current code adds the marker line to the original files. Is that > intended? Well, no, this wasn't intended. The part of the code that did that was introduced in one of the many attempts to solve the problem. I knew that this was an

Re: [Tutor] Creating one file out of all the files in a directory

2010-11-14 Thread Josep M. Fontana
Hi Evert, Again, thanks a lot. Too bad you and Kushal don't live close. I would like to invite you to a beer or a coffe or something. >> >> - code >> import os >> path = '/Volumes/DATA/MyPath' >> os.chdir(path) >> file_names = glob.glob('*.txt') > > You don't use file_nam

Re: [Tutor] Creating one file out of all the files in a directory

2010-11-14 Thread Evert Rol
> Again, thanks a lot. Too bad you and Kushal don't live close. I would > like to invite you to a beer or a coffe or something. Thanks for the offer. Some time ever in the far, far future perhaps ;-). > >> So close ;-). >> What you're missing is the next write statement: >> f.write(data) >> >>

Re: [Tutor] Creating one file out of all the files in a directory

2010-11-14 Thread Alan Gauld
"Josep M. Fontana" wrote OK, I ask you (or anybody reading this) the same question I asked Kushal: why is it better to open the output file outside the entire loop. Because you only need to open it once and leave it open. You are opening it each and every time which is wasteful. It could on

Re: [Tutor] Creating one file out of all the files in a directory

2010-11-14 Thread Josep M. Fontana
Thanks Alan, why is it better to open the output file outside the entire >> loop. > > Because you only need to open it once and leave it open. > You are opening it each and every time which is wasteful. > It could on some OSDS also lead to problems. And if you > were writing a new file rather tha

Re: [Tutor] program hangs in while loop using wx.yield

2010-11-14 Thread Alex Hall
On 11/14/10, Alan Gauld wrote: > "Alex Hall" wrote > >> I had this working back in the summer, but have since had to >> restructure some things in the code. Now, my program is hanging >> while >> it waits for the human player to take his/her turn, and I am not >> sure >> how to free it; > > I don

Re: [Tutor] Creating one file out of all the files in a directory

2010-11-14 Thread Josep M. Fontana
>> Again, thanks a lot. Too bad you and Kushal don't live close. I would >> like to invite you to a beer or a coffe or something. > > Thanks for the offer. Some time ever in the far, far future perhaps ;-). Well, if you or the other people who have been so helpful to me in this list ever happen to

[Tutor] python at midnight

2010-11-14 Thread ingo
While processing weather data from the http://www.knmi.nl/ and building a small domotica system I ran into the following 'shortcomming' from the python doc: "class datetime.datetime(year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]) The year, month and day arguments are requir

[Tutor] Recommend a MVC framework

2010-11-14 Thread Tim Johnson
I've been web programming for 15 years now. 8 of it using python. Lately I have been 'studying' PHP via the CodeIgnitor Framework. Since python remains my first choice, but since I am also impressed with the concept of CodeIgnitor, I would welcome recommendations on a python MVC framework. One r

Re: [Tutor] Recommend a MVC framework

2010-11-14 Thread Evert Rol
> I've been web programming for 15 years now. 8 of it using python. > > Lately I have been 'studying' PHP via the CodeIgnitor Framework. > > Since python remains my first choice, but since I am also > impressed with the concept of CodeIgnitor, I would welcome > recommendations on a python MVC fra

Re: [Tutor] Recommend a MVC framework

2010-11-14 Thread leo kirotawa
take a look at web2py. [1] http://www.web2py.com/ On Sun, Nov 14, 2010 at 5:26 PM, Tim Johnson wrote: > I've been web programming for 15 years now. 8 of it using python. > > Lately I have been 'studying' PHP via the CodeIgnitor Framework. > > Since python remains my first choice, but since I a

Re: [Tutor] Recommend a MVC framework

2010-11-14 Thread Alan Gauld
"Tim Johnson" wrote Since python remains my first choice, but since I am also impressed with the concept of CodeIgnitor, I would welcome recommendations on a python MVC framework. Don;t know CodeIgnitor but almost every web framework is MVC based from Struts in Jave through Rails on Ruby t

Re: [Tutor] Recommend a MVC framework

2010-11-14 Thread Walter Prins
Additionally to what's already been said, you may also want to have a look at the Pyjamas project (which can work in conjunction with Django as a back-end), there's a short article about implementing an MVC architecture in Pyjamas here: http://pyjs.org/wiki/modelviewcontroller/ Also you may want t

[Tutor] While Loops: Coin Flip Game

2010-11-14 Thread Dawn Samson
Greetings, I'm a Python beginner and working my way through Michael Dawson's Python Programming for the Absolute Beginner. I'm stuck in a particular challenge that asks me to write a program that "flips a coin 100 times and then tells you the number of heads and tails." I've been trying to work

Re: [Tutor] program hangs in while loop using wx.yield

2010-11-14 Thread Alan Gauld
"Alex Hall" wrote The problem is that I want to go until there is a winner. You are right about just letting the mainloop of the gui handle input (I forgot the gui is already looping and waiting for input) but I would like to make the user pause while the computer goes, this way the user cann

Re: [Tutor] Recommend a MVC framework

2010-11-14 Thread Tim Johnson
* Alan Gauld [101114 13:12]: > Not quite sure how you defione your terms there. > But all of the above can be used with Apache. Hi Alan. See my reply to Evert where I refer to situations where I would have neither SSH nor root access. thanks -- Tim tim at johnsons-web.com or akwebsoft.com

Re: [Tutor] Recommend a MVC framework

2010-11-14 Thread Tim Johnson
* Evert Rol [101114 12:12]: > Django can run be run through mod_wsgi (or mod_python if you > really want). And other web servers than Apache will also work. > Don't know what you mean with "shared server", but if you mean > multiple accounts running their web apps through one Apache > server, t

[Tutor] What was your strategy?

2010-11-14 Thread Jorge Biquez
Hello all. Quick question. I know some of you are with Python since started, some other maybe later. I was wondering if you can share what was the strategy you followed to master Python (Yes I know I have to work hard study and practice a lot). I mean did you use special books, special sites,

Re: [Tutor] Recommend a MVC framework

2010-11-14 Thread Evert Rol
>> Django can run be run through mod_wsgi (or mod_python if you >> really want). And other web servers than Apache will also work. > >> Don't know what you mean with "shared server", but if you mean >> multiple accounts running their web apps through one Apache >> server, that can work (provided

Re: [Tutor] While Loops: Coin Flip Game

2010-11-14 Thread Hugo Arts
On Sun, Nov 14, 2010 at 11:16 PM, Dawn Samson wrote: > Greetings, > I'm a Python beginner and working my way through Michael Dawson's Python > Programming for the Absolute Beginner. I'm stuck in a particular challenge > that asks me to write a program that "flips a coin 100 times and then tells >

Re: [Tutor] Recommend a MVC framework

2010-11-14 Thread Tim Johnson
* Tim Johnson [101114 11:45]: > > One restriction: must *not* need an application server, I.E. works > thru Apache and is adaptable to a shared server. > thanks for all of who responded. I should clarify: I have been considering django as a first choice for most of the deployment environments I

Re: [Tutor] python at midnight

2010-11-14 Thread Steven D'Aprano
ingo wrote: [...] Questions, Is there a date time library that accepts the 24:00? mxDateTime doesn't. I don't know of any. Is there a way to set the limit 'from the outside' (subclassing???) or a simple way around? Write a wrapper function: #Untested def datetime24(*args): try:

Re: [Tutor] While Loops: Coin Flip Game

2010-11-14 Thread Steven D'Aprano
Dawn Samson wrote: I've been trying to work on this challenge for a while now and can't get it to work (either it has 100 heads or 100 tails). Unfortunately your code has been mangled in the email, but I can guess your problem: you need to set coin = random.randrange(2) each time through

Re: [Tutor] While Loops: Coin Flip Game

2010-11-14 Thread Stephanie Dawn Samson
Thanks everyone! I should be using algorithms for even such programs at my level. The solution to reiterate the coin flip every time in the loop works. Thanks a lot! Dawn ___ Tutor maillist - Tutor@python.

Re: [Tutor] While Loops: Coin Flip Game

2010-11-14 Thread Adam Bark
On 14/11/10 22:16, Dawn Samson wrote: Greetings, I'm a Python beginner and working my way through Michael Dawson's Python Programming for the Absolute Beginner. I'm stuck in a particular challenge that asks me to write a program that "flips a coin 100 times and then tells you the number of he

Re: [Tutor] What was your strategy?

2010-11-14 Thread Steven D'Aprano
Jorge Biquez wrote: I was wondering if you can share what was the strategy you followed to master Python (Yes I know I have to work hard study and practice a lot). I started by working through the book "Learning Python" by Mark Lutz and David Ascher. I wrote lots and lots of little Python

Re: [Tutor] While Loops: Coin Flip Game

2010-11-14 Thread Robert Berman
From: tutor-bounces+bermanrl=cfl.rr@python.org [mailto:tutor-bounces+bermanrl=cfl.rr@python.org] On Behalf Of Dawn Samson Sent: Sunday, November 14, 2010 5:17 PM To: tutor@python.org Subject: [Tutor] While Loops: Coin Flip Game Greetings, I'm a Python beginner and working my way throu

Re: [Tutor] program hangs in while loop using wx.yield

2010-11-14 Thread Alex Hall
On 11/14/10, Alan Gauld wrote: > "Alex Hall" wrote > >> The problem is that I want to go until there is a winner. You are >> right about just letting the mainloop of the gui handle input (I >> forgot the gui is already looping and waiting for input) but I would >> like to make the user pause whil

Re: [Tutor] What was your strategy?

2010-11-14 Thread Alan Gauld
"Jorge Biquez" wrote I was wondering if you can share what was the strategy you followed to master Python I started with Python 1.3 around early 1998 but switched to 1.5 very soon after. I started with the standard tutorial (I was already a pro programmer so it was easy to follow) then im

Re: [Tutor] While Loops: Coin Flip Game :p:

2010-11-14 Thread Thomas C. Hicks
On Sun, 14 Nov 2010 17:16:36 -0500 Dawn Samson wrote: > Greetings, > > I'm a Python beginner and working my way through Michael Dawson's > Python Programming for the Absolute Beginner. I'm stuck in a > particular challenge that asks me to write a program that "flips a > coin 100 times and then t

Re: [Tutor] program hangs in while loop using wx.yield

2010-11-14 Thread Walter Prins
On 15 November 2010 00:12, Alex Hall wrote: > Again: is there a basic tutorial that would explain how control works > when dealing with a gui, especially one that is meant to last a long > time but occasionally block input? > Normally the way is for the GUI controls (e.g. widgets, grids, objects

Re: [Tutor] Programs for Newbies?

2010-11-14 Thread R. Alan Monroe
> Any suggestions for a newbie to program while learning python? I am new to > programming and python. Port one of the old games from http://www.atariarchives.org/basicgames/ or similar antique books. Alan ___ Tutor maillist - Tutor@python.org To u

Re: [Tutor] python at midnight

2010-11-14 Thread ingo
On Sun, Nov 14, 2010 at 11:48 PM, Steven D'Aprano wrote: > > Write a wrapper function: > Thanks Steve, with this in hand I think I can solve the main problems for now i. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription opt