[Tutor] Need help in making this code more pythonic

2009-07-26 Thread ammar azif
Hello, I need some suggestions on how to make this code pythonic. The program basically runs a simulation of an object that moves on a 2D plane. The object keeps on moving from its current coordinate to  randomly picked adjacent coordinates with the object is not allowed to move move to a

Re: [Tutor] Need help in making this code more pythonic

2009-07-26 Thread ammar azif
Sorry I forgot to attach the code file. Here it is. --- On Sun, 7/26/09, ammar azif ceasar...@yahoo.com wrote: From: ammar azif ceasar...@yahoo.com Subject: [Tutor] Need help in making this code more pythonic To: tutor@python.org Date: Sunday, July 26, 2009, 6:23 AM Hello, I need some

[Tutor] Puzzled

2008-08-29 Thread ammar azif
I wrote a python program that used time() function from the time module to retrieve time in seconds since Epoch. After the value was retrieved which I checked is a float by using type(),  the value was then written into a file in binary format. Then another C program that I wrote opened the

Re: [Tutor] Puzzled

2008-08-29 Thread ammar azif
PROTECTED] Cc: tutor@python.org Date: Friday, August 29, 2008, 4:41 PM On Fri, Aug 29, 2008 at 5:13 PM, ammar azif [EMAIL PROTECTED] wrote: I wrote a python program that used time() function from the time module to retrieve time in seconds since Epoch. After the value was retrieved which I checked

[Tutor] My experience on web.py

2008-08-04 Thread ammar azif
Hi, I am writing this to tell my experience on web.py. Two weeks ago, I was looking for a python web framework that is simple, straight-forward, easy to use and powerful at the same time. Django  stood out as the most popular when I googled. I tried to use django but I found that the framework

[Tutor] Launching default web browsers.

2008-07-12 Thread ammar azif
Hi, I am going to develop an application that will launch the user's computer default web browser pointing to a URL. How to do this in python and which library should I use? Also, my development platform is Linux but the application is targeted to run in Windows platform. Is there any major

[Tutor] Document Control System

2008-01-14 Thread ammar azif
Hello, Is python suitable in developing web based document control system ? I was thinking of using python and mysql to create such system. Users can download latest document as well as upload drafts. Is this possible or i should use PHP instead? - Be a

[Tutor] scope/namespaces

2007-04-24 Thread ammar azif
Something in python disturbs me , when i write a for loop, i am able to access the variable declared in that loop after the loop finishes which i am not able to do in languages like c/c++ or java. Is it different in python? - Ahhh...imagining that

[Tutor] help on raw_input()

2007-04-14 Thread ammar azif
Hi, i wanted to get a string from raw_input like this raw_input('') \n\nsomestring but the problem is raw input will return the string '\\n\\nsomestring' My question is Are there any function to convert back those string to '\n\nsomestring' ? Thanks

Re: [Tutor] help on raw_input()

2007-04-14 Thread ammar azif
/index.html HTTP/1.0\\r\\nHost: somehost\\r\\n\\r\\n' is there any easy way other than modify this string ? Perhaps regular expression? Alan Gauld [EMAIL PROTECTED] wrote: ammar azif wrote i wanted to get a string from raw_input like this raw_input('') \n\nsomestring OK, Can you explain

Re: [Tutor] help on raw_input()

2007-04-14 Thread ammar azif
Thanks the encode method really helps. Alan Gauld [EMAIL PROTECTED] wrote: ammar azif wrote Actually i wanted to write a http client using just he low level socket module. I won;t ask why! But the httplib module probably does what you want just in case you dodn't realize it existed

[Tutor] Tkinter-Button class

2007-03-18 Thread ammar azif
Hi, Thanks for the help guys. I have tried gui programming using Tkinter and use the Button class which accepts the command argument which is a function object. The question is how to send arguments if the function accepts arguments. - Get your own web

[Tutor] Is generator function reusable?

2007-03-17 Thread ammar azif
Lets say a generator function instance is created and has finished its iteration. Can that instance be reused again? can it accept anymore values? or we should discard it and create a new generator instance. Thanks - Need Mail bonding? Go to the Yahoo! Mail QA

[Tutor] Is generator function similar to multi threading?

2007-03-16 Thread ammar azif
Is generator function similar to multi threading? - Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends.___ Tutor maillist - Tutor@python.org

[Tutor] Built-in function to check a character is ASCII character?

2007-03-16 Thread ammar azif
Is there any Built-in function to check whether a character is an ASCII character? I am trying to learn event driven programming in python. Heres my code: while 1: key=msvcrt.getch() if key==255: continue else: print the key is , key But the output is:- the key