Re: [Tutor] Question about time.gmtime

2009-11-02 Thread Eduardo Vieira
On Tue, Sep 29, 2009 at 8:11 AM, Eduardo Vieira wrote: > Hello, I had a problem with a script yesterday that made me puzzled. > My time zone is US Mountain Time. This script was running nice last > week, but yesterday it reported the date of today instead > So, yesterday at 5:20pm this line: > hoj

Re: [Tutor] Can we unroll a loop?

2009-11-02 Thread Kent Johnson
On Mon, Nov 2, 2009 at 3:52 PM, Tino Dai wrote: > Hi Everybody, > > I am wondering about a better approach to doing this: > > for obj in groups: >        rVs = rVs + Event.objects.get(group=obj) >     rVs.sort() Assuming rVs is a list and Event.objects.get(group=obj) is also a list, you

[Tutor] Can we unroll a loop?

2009-11-02 Thread Tino Dai
Hi Everybody, I am wondering about a better approach to doing this: for obj in groups: rVs = rVs + Event.objects.get(group=obj) rVs.sort() Instead what I'm looking for is to have a construct that would expand out to this: rVs = Event.objects.get(group=groups[0]) |

Re: [Tutor] Retrieving information from a plain text file (WinXP/py2.6.2/Beginner)

2009-11-02 Thread Dave Angel
(Looks like maybe you hijacked another thread, instead of just creating a new message, with new topic, for the list) Katt wrote: Hello all, Thank you all for your help. I appreciate it alot. I have been trying to work with file IO alot recently and would like to improve my little program so

Re: [Tutor] Retrieving information from a plain text file (WinXP/py2.6.2/Beginner)

2009-11-02 Thread Serdar Tumgoren
Hi Katt, It appears you did not return the list of reminders that you extracted in the "read_reminders" function, but simply printed them from inside that function. If you modify your code as below to store the list in a variable called "reminders", you should be able to access the list in your

Re: [Tutor] Retrieving information from a plain text file (WinXP/py2.6.2/Beginner)

2009-11-02 Thread vince spicer
On Sun, Nov 1, 2009 at 5:37 PM, Katt wrote: > Hello all, > > Thank you all for your help. I appreciate it alot. > > I have been trying to work with file IO alot recently and would like to > improve my little program so that I no longer use a hard coded list, but a > text file that I can edit eas

Re: [Tutor] Retrieving information from a plain text file (WinXP/py2.6.2/Beginner)

2009-11-02 Thread Katt
Hello all, Thank you all for your help. I appreciate it alot. I have been trying to work with file IO alot recently and would like to improve my little program so that I no longer use a hard coded list, but a text file that I can edit easily. The text file is three lines long and looks exac

Re: [Tutor] CSS Minification

2009-11-02 Thread Kent Johnson
On Mon, Nov 2, 2009 at 6:38 AM, Stephen Nelson-Smith wrote: > Is there a Python CSS and/or javascript minifier available? cssutils can minify CSS: http://cthedot.de/cssutils/ jsmin has been ported to Python: http://www.crockford.com/javascript/jsmin.py.txt Kent _

Re: [Tutor] Can't find modules at command line

2009-11-02 Thread Christian Witts
Sam Stout wrote: I'm using Python on Mac OS X. I usually run IDLE and get this result: IDLE 1.2 >>> import gun Bang! >>> However, when I try this from Terminal: Jacks-Mac:~ Sam$ python ActivePython 2.5.0.0 (ActiveState Software Inc.) based on Python 2.5 (r25:51908, Mar 9 2007, 17:40

[Tutor] Can't find modules at command line

2009-11-02 Thread Sam Stout
I'm using Python on Mac OS X. I usually run IDLE and get this result: IDLE 1.2 >>> import gun Bang! >>> However, when I try this from Terminal: Jacks-Mac:~ Sam$ python ActivePython 2.5.0.0 (ActiveState Software Inc.) based on Python 2.5 (r25:51908, Mar 9 2007, 17:40:37) [GCC 4.0.1 (App

[Tutor] CSS Minification

2009-11-02 Thread Stephen Nelson-Smith
Is there a Python CSS and/or javascript minifier available? I've got to convert some ant scripts to python, and ant has a minifier plugin that I need to replicate. Maybe Beautiful Soup can do this? S. -- Stephen Nelson-Smith Technical Director Atalanta Systems Ltd www.atalanta-systems.com

Re: [Tutor] Adding Value to CSV

2009-11-02 Thread Dave Angel
(Please don't top-post on a newsgroup that has the convention of adding new content after quoted text.) Paras K. wrote: What I am trying to do is as I am writing the row to the CSV file, I want to add the string base on a few other checks that I still need to write. Ex. readline = '"152.88.91

Re: [Tutor] Adding Value to CSV

2009-11-02 Thread Christian Witts
Paras K. wrote: What I am trying to do is as I am writing the row to the CSV file, I want to add the string base on a few other checks that I still need to write. Ex. readline = '"152.88.91.98","BitTorrent Client Activity","1","2009-09-23 15:40:33"\r\n' At the end of this based on my check

Re: [Tutor] Structure of my simulation / monte-carlo

2009-11-02 Thread spir
Le Sun, 01 Nov 2009 20:34:56 -0500, Dave Angel s'exprima ainsi: > And from what you said earlier, you WILL need function objects, probably > as parameters to the Simulation constructor. So each instance of > Simulation will be given several function objects to specify the > distribution funct

Re: [Tutor] Adding Value to CSV

2009-11-02 Thread Paras K.
What I am trying to do is as I am writing the row to the CSV file, I want to add the string base on a few other checks that I still need to write. Ex. readline = '"152.88.91.98","BitTorrent Client Activity","1","2009-09-23 15:40:33"\r\n' At the end of this based on my checks I want to be able to