[Tutor] How to deploy Python 2.7, Django in OpenShift

2012-08-12 Thread Surya K
I am really fed up with tutorials on web telling how to configure Django Python 2.7 on OpenShift DIY. So, can write a detailed step-by-step procedure on how to setup Django 1.4 with Python 2.7 on OpenShift using VirtualEnv?? Thanks a lot!!

[Tutor] A simple AJAX script needed

2012-07-20 Thread Surya K
Here is what i need: I want to create a HTML button.. when clicked (should only work for once) should invoke a python script. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

[Tutor] How to authorize my application to use Google API

2012-07-01 Thread Surya K
I am building a Facebook application using Django where I am using Blogger API. So, all I want is to just read the data from a public blog (my blog). I tried to read the documentation and found that we have 3 types of authentication mechanisms (ClientLogin, OAuth, AuthSub Proxy). As I can't

[Tutor] what would be the best authentication method for my facebook application

2012-06-21 Thread Surya K
I am writing a facebook application in python where I used Blogger API to read posts from blogs (currently I am using ClientLogin under development). As each user(visitor) of my application should be able to view my without any authentication, I am using OAuth for authentication but I am unable

[Tutor] How to read websites - Web Scraping or Parsing in python

2012-06-13 Thread Surya K
Hi, I am trying to write a python program which reads any webpage's content. Considering a blog, I'd like to read all the content written by the author in it. So, each blog/ site would be having different type of HTML/ XML whether its Blogger or Wordpress or Typepad or any.. I thought of

Re: [Tutor] How to deploy Django project in Google App Engine

2012-05-28 Thread Surya K
Date: Sat, 26 May 2012 09:40:03 -0400 From: bgai...@gmail.com To: sur...@live.com CC: tutor@python.org Subject: Re: [Tutor] How to deploy Django project in Google App Engine On 5/26/2012 5:41 AM, Surya K wrote: I wrote a Django project and would

[Tutor] How to deploy Django project in Google App Engine

2012-05-26 Thread Surya K
I wrote a Django project and would like to deploy on Google App Engine. I searched a lot on net and couldn't find a proper tutorial till now. So, can any one explain me?? I used Eclipse Indigo, Python 2.7 for developing...

[Tutor] How to read blog posts in python

2012-05-17 Thread Surya K
Hi, I want to write a python code which read blog's RSS/ Atom feeds and gives us the all post's content of blog... I am currently trying to use FeedParser (Universal Feed Parser). I am able to get all post's titles and URL's but not a content.. I tried to use certain functions mentioned in

[Tutor] How to start developing a website

2012-05-13 Thread Surya K
I have a idea (Website) which I want to develop using Django (Still learning it!). Currently I am following DjangoBook (reading DataBase..). As I am really new to webframe works and Web development, I have a real dumb question which I don't really figure out. # Question: Broadly speaking my

[Tutor] static methods class methods

2012-04-20 Thread Surya K
I have a class, and want to use a method of it in the class itself. How can I do it? I mean, say I defined foo() , bar() methods in a class myClass. So, how can we i use foo() in bar(). I tried to use @staticmethod, @classmethod, but I am getting some errors.. sometimes saying unbound and

[Tutor] how to select a player to play first on a multiplayer game which runs on IRC

2012-04-19 Thread Surya K
I am writing tic tac toe game which runs on IRC (i am using freenode now). Each player will be a channel member. So, players send private messages between each other to play game. This sounds fine but I need the below things to get done, but I don't know how to do them.. How my game works: Each

Re: [Tutor] how to select a player to play first on a multiplayer game which runs on IRC

2012-04-19 Thread Surya K
Date: Thu, 19 Apr 2012 07:24:33 -0400 From: d...@davea.name To: sur...@live.com CC: tutor@python.org; bgai...@gmail.com Subject: Re: [Tutor] how to select a player to play first on a multiplayer game which runs on IRC On 04/19/2012 06:54 AM, Surya K wrote: I am writing tic tac toe

[Tutor] How to run a small python client-server on Google App Engine

2012-04-19 Thread Surya K
I wrote a small python Client-Server program.. (I use python 2.7) and want to make it real. I mean, I want to put the server on Google App Engine.. I went through it and found that, I need to use Google API so that it should work on GAE. So, How could I create such a small Google App Engine's

[Tutor] How to interact with users on IRC using Python

2012-04-16 Thread Surya K
Actually, I am writing a small IRC bot for a game (A Multiplayer one). This how my code looks. (I this code, I am just trying to read from IRC client and send a message to it..) import sysimport socketimport string HOST=irc.freenode.netPORT=6667NICK=MyBotIDENT=MybotREALNAME=Pythonreadbuffer=

[Tutor] should we use multithreading for multiple clients in socket class

2012-04-12 Thread Surya K
I am learning networking and just wrote a primitive client server program.. server: from time import ctimefrom socket import * HOST = PORT = 21567BUFSIZ = 1024ADDR = (HOST, PORT) tcpSerSoc = socket(AF_INET, SOCK_STREAM)tcpSerSoc.bind(ADDR)tcpSerSoc.listen(5) while True:print waiting for

[Tutor] how to build a multiplayer game?

2012-04-11 Thread Surya K
I have written the basic part of the game. Now I want to make it a multiplayer one. (Its not a web app, a OS application) So, I just wanted to know how do it. Which topics I should refer? Network Programming or Web Programming or Internet Client Programming. (There were the topics mentioned

Re: [Tutor] how to build a multiplayer game?

2012-04-11 Thread Surya K
Date: Wed, 11 Apr 2012 06:42:40 -0400 From: d...@davea.name To: sur...@live.com CC: tutor@python.org Subject: Re: [Tutor] how to build a multiplayer game? On 04/11/2012 06:02 AM, Surya K wrote: I have written the basic part of the game. Now I want to make it a multiplayer one

[Tutor] GUI for python Google App Engine

2012-04-09 Thread Surya K
Hi there, I just wrote a small game in python and would like to make it a facebook app. These are the things I wish to know: 1. How to write GUI for my app. I believe, PyQt or Wx wouldn't work in Google App Engine.2. How to integrate my app with facebook. I went through facebook documentation

Re: [Tutor] Unable to open .py files directly

2012-03-21 Thread Surya K
Date: Mon, 19 Mar 2012 19:11:18 -0400 From: bgai...@gmail.com To: sur...@live.com CC: tutor@python.org Subject: Re: [Tutor] Unable to open .py files directly On 3/19/2012 10:30 AM, Surya K wrote: Hi there, I am facing

Re: [Tutor] Unable to open .py files directly

2012-03-21 Thread Surya K
Date: Wed, 21 Mar 2012 13:29:17 + Subject: Re: [Tutor] Unable to open .py files directly From: bod...@googlemail.com To: sur...@live.com CC: tutor@python.org; bgai...@gmail.com On Mar 21, 2012 1:03 PM, Surya K sur...@live.com wrote: Date: Mon

[Tutor] Unable to open .py files directly

2012-03-19 Thread Surya K
Hi there, I am facing a typical problem in opening .py files by clicking them (In windows). When ever I those files, there's a black window opening and closing immediately (I think, its output of python at python command line, NOT SURE). I have to open those files from IDE's or any test

[Tutor] New project idea!!

2012-03-06 Thread Surya K
Hi, I am an electronics guy, extremely interested in programming. So learned Python. Currently I know (C, Python, HTML); Learning Java, Python (still making myself flexible in OOP). So, last year I build a sudoku solver in C which was an amazing experience (though re inventing wheel is not a

Re: [Tutor] New project idea!!

2012-03-06 Thread Surya K
Subject: Re: [Tutor] New project idea!! From: las...@antalconsulting.com Date: Tue, 6 Mar 2012 09:24:12 -0800 CC: tutor@python.org To: sur...@live.com Hi, Since you are an electronics guy, how about a circuit simulator?You can start very simple with a power source and a light and show how

[Tutor] loop until a keypress

2012-01-29 Thread Surya K
I want to run code until a enter is pressed. Well, it shouldn't wait for the user to enter enter This is my code: import msvcrtchr = 0while chr != 'q': print my code, if msvcrt.kbhit(): chr = msvcrt.getch() This isn't working the way I wanted. When ever I press enter, the loop

Re: [Tutor] compile time calculator

2012-01-28 Thread Surya K
Date: Fri, 27 Jan 2012 17:35:39 -0800 Subject: Re: [Tutor] compile time calculator From: marc.tompk...@gmail.com To: sur...@live.com CC: tutor@python.org On Fri, Jan 27, 2012 at 7:46 AM, Surya K sur...@live.com wrote: Hi, I want to calculate compile time for my puzzles. Since nobody else

[Tutor] how to convert usec/pass to seconds

2012-01-28 Thread Surya K
I am actually using a activestate wrapper for calculating execution time of my program. This is the code #!/usr/bin/python# A simple wrapper for the timeit module.import timeit def Timeit(func,number=1,module=__main__): A wrapper which can be used to time any function name =

[Tutor] compile time calculator

2012-01-27 Thread Surya K
Hi, I want to calculate compile time for my puzzles. Although I read about timeit(), I didn't really understand how it should be applied it.So, can anyone write a function for me please!! I am looking for a function which should solve my puzzle and also show compile time. (Later, I should be

Re: [Tutor] how to handle very large numbers

2012-01-23 Thread Surya K
Date: Sun, 22 Jan 2012 21:28:14 -0500 From: d...@davea.name To: sur...@live.com CC: tutor@python.org Subject: Re: [Tutor] how to handle very large numbers On 01/22/2012 09:08 PM, Surya K wrote: Well, I have been doing a puzzle where I have to deal with number 10^18. A variable

[Tutor] how to handle very large numbers

2012-01-22 Thread Surya K
Well, I have been doing a puzzle where I have to deal with number 10^18. A variable can store that value but can't do operations.Ex: If I use range() on it, it shows overflow error. So, How do I handle this. I have to use range() for that number.. in this instance. Also mention how to handle

[Tutor] where I am going wrong?

2011-12-14 Thread surya k
This is a project Euler puzzle. http://projecteuler.net/problem=30 I applied brute force way and here is my code k=0for p in range(1,10):    for q in range(0,10):        for r in range(0,10):            for s in range(0,10):                for t in range(0,10):                 n = (p*1)+

Re: [Tutor] where I am going wrong?

2011-12-14 Thread surya k
From: waynejwer...@gmail.com Date: Wed, 14 Dec 2011 08:25:53 -0600 Subject: Re: [Tutor] where I am going wrong? To: sur...@live.com CC: tutor@python.org On Wed, Dec 14, 2011 at 8:13 AM, surya k sur...@live.commailto:sur...@live.com wrote

Re: [Tutor] where I am going wrong?

2011-12-14 Thread surya k
:25:53 -0600 Subject: Re: [Tutor] where I am going wrong? To: sur...@live.com CC: tutor@python.org On Wed, Dec 14, 2011 at 8:13 AM, surya k sur...@live.commailto:sur...@live.com wrote: This is a project Euler puzzle. http://projecteuler.net/problem=30http://projecteuler.net

Re: [Tutor] where I am going wrong?

2011-12-14 Thread surya k
Date: Wed, 14 Dec 2011 10:39:53 -0500 From: d...@davea.name To: sur...@live.com CC: waynejwer...@gmail.com; tutor@python.org Subject: Re: [Tutor] where I am going wrong? On 12/14/2011 09:29 AM, surya k wrote: From: waynejwer...@gmail.com Date

[Tutor] best book for OOP

2011-12-11 Thread surya k
I'm reading Core Python Programming - Chun..  Currently, I am studying OOP in it.. and I feel there is something I am missing in that while studying. Actually I am from C.. so, no idea of OOP. Could you tell me the best, simple, easy to understand book!!

[Tutor] how to handle big numbers

2011-12-09 Thread surya k
Finding factorial of 8 or 9 isn't big. If I would like to find factorial of 32327, how can I ?? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] how to handle big numbers

2011-12-09 Thread surya k
Date: Fri, 9 Dec 2011 14:53:07 -0500 From: d...@davea.name To: sur...@live.com CC: tutor@python.org Subject: Re: [Tutor] how to handle big numbers On 12/09/2011 02:25 PM, surya k wrote: Finding factorial of 8 or 9 isn't big. If I would like

[Tutor] how to calculate program compile time?

2011-12-08 Thread surya k
I'm doing puzzles where we need to write code that works as fast a possible So, how can I check the compile time of my program ?... ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

[Tutor] unable to use find(), index()

2011-12-08 Thread surya k
I am using the following code  astr = foobarstr1 =fooastr.find(str1, beg=0, end=3) This is showing the following error Traceback (most recent call last):  File interactive input, line 1, in moduleTypeError: find() takes no keyword arguments I even tried by importing string module, but it isn't

[Tutor] how to use int and split() simultaneously

2011-12-08 Thread surya k
This is something I am trying to do.. Say, we are entering a string 1 2 3 4 5.so, I want to assign the numbers directly as numbers. how can I do it? I could put that numbers as string but not as number.. strNum = raw_input('enter:').split() I can convert the list into numbers by doing this...

[Tutor] how to find index of list with its value

2011-12-08 Thread surya k
Well, we all know to know the value when we have the index of a list. But how can we find it in the reverse way... say a listl=[1,2,3,4] l[0]=1.but how can I find its address with its value 1 ?? ___ Tutor

[Tutor] unable to run file though dir path included

2011-12-06 Thread surya k
I have included the path directory of the file but still I couldn't run it!. 1. I created a .pth file and wrote all required path list's and saved in site-packages of python dir.( python\Lib\Site-packages). 2. I also included python path ( c:\python27\) in system path so as to run it using

[Tutor] how to link GUI app to the code

2011-12-05 Thread surya k
I have designed a application using WxGlade but I don't know how to link it to my code and run it.Could you please tell me? at least it would be helpful if you could show me relevant tutorials. Here is the part of the application code that is generated using WxGlade. self.panel_6 =

[Tutor] where python is used in real world

2011-12-03 Thread surya k
I don't understand why python doesn't provide executable files for the source code. I am using py2exe for building executables and I found that, it doesn't completely change code into binary but creates dll files and python libraries to run that particular code. This process makes program

[Tutor] unexpected list entry

2011-12-02 Thread surya k
Hi, Just take a look at this small code.. I am just taking a string as input and assigning it as a list. But I am finding an unexpected entry in the list.. Why this is happening? I am using PyScripter IDE. code : #!/usr/bin/env python def main(): pass if __name__ == '__main__':

Re: [Tutor] unexpected list entry

2011-12-02 Thread surya k
any problem like this -- From: Dave Angel d...@davea.name Sent: Friday, December 02, 2011 7:43 PM To: surya k sur...@live.com Cc: Python Tutor tutor@python.org Subject: Re: [Tutor] unexpected list entry On 12/02/2011 08:49 AM, surya k wrote: Hi

Re: [Tutor] unexpected list entry

2011-12-02 Thread surya k
...@davea.name Sent: Friday, December 02, 2011 7:43 PM To: surya k sur...@live.com Cc: Python Tutor tutor@python.org Subject: Re: [Tutor] unexpected list entry On 12/02/2011 08:49 AM, surya k wrote: Hi, Just take a look at this small code.. I am just taking a string as input and assigning it as a list

Re: [Tutor] unexpected list entry

2011-12-02 Thread surya k
-- From: Dave Angel d...@davea.name Sent: Friday, December 02, 2011 9:36 PM To: surya k sur...@live.com Cc: Python Tutor tutor@python.org Subject: Re: [Tutor] unexpected list entry (You top-posted. Put your remarks AFTER whatever you quote from

[Tutor] why doesn't python show error

2011-11-28 Thread surya k
1. Why doesn't python show error(description given below) at the beginning when we use functions which aren't present in the standard modules... Example:  TheString = raw_input('enter a string')lengthofStr = strlen(TheString)Look closely, I used a wrong function to find length of the string.

Re: [Tutor] why doesn't python show error

2011-11-28 Thread surya k
interpreter.. From: Sarma Tangirala Sent: Monday, November 28, 2011 3:46 PM To: surya k Cc: Python Tutor Subject: Re: [Tutor] why doesn't python show error On 28 November 2011 15:23, surya k sur...@live.com wrote: 1. Why doesn't python show error(description given below) at the beginning

[Tutor] Multiplater gaming

2011-11-28 Thread surya k
I am building a multiplayer game (Game:Bingo) where friends(players) connect over internet. In this particular game, users sends a character/ number to all other players.. Can you please shed some light on it. I've been looking into 'Core Python Programming' book by Chun but I couldn't

[Tutor] Writing Game in python

2011-11-27 Thread surya k
Hi, Actually, I want to develop a multiplayer Bingo game. So, I would like to develop it in python C. As I am not familiar with game development, could you please tell me what libraries I should use for development?... etc

Re: [Tutor] Writing Game in python

2011-11-27 Thread surya k
On Sun, Nov 27, 2011 at 7:52 AM, surya k sur...@live.com wrote: Hi, Actually, I want to develop a multiplayer Bingo game. So, I would like to develop it in python C. As I am not familiar with game development, could you please tell me what libraries I should use for development?... etc You

Re: [Tutor] Writing Game in python

2011-11-27 Thread surya k
:52 AM, surya k sur...@live.com wrote: Hi, Actually, I want to develop a multiplayer Bingo game. So, I would like to develop it in python C. As I am not familiar with game development, could you please tell me what libraries I should use for development?... etc You could easily develop

[Tutor] How to handle conjunction operators

2011-11-27 Thread surya k
Hi, Could you please tell me why this isn't working and how can I make it possible... Consider this code..name = raw_input(Enter your first name: ) if name[0] == (m or f or b) : rhyme = name[1:]What I want here is.. If the name starts with 'm' or 'f' or 'b', The first letter should be

[Tutor] taking input for a list in a list

2011-09-26 Thread surya k
Hi, Actually my programming language is C.. learning python. I'm trying to write sudoku program for which I need to take input. This is what I did merely *list = [] for i in range (0,4) : for j in range (0,4) : list[i][j].append ( int (raw_input(Enter) ) ) * This is completely

[Tutor] integrating python and C

2011-09-23 Thread surya k
Hi! Actually, I'm writing sudoku solver. So, I'd write my logic in C but when it comes to GUI, I feel that python is much easier than doing in C. What I'm looking at is, take input from python program with graphic interface and passing it to my C program file then solve the puzzle and again

Re: [Tutor] largest palindrome number

2011-08-27 Thread surya k
, at the end of the loop. we'll get largest palindrome number.. On 8/25/11, Hugo Arts hugo.yo...@gmail.com wrote: On Thu, Aug 25, 2011 at 6:49 PM, surya k sur...@live.com wrote: Hi, I'm doing a puzzle where it asked me to find the largest palindrome number formed by the product of two three

[Tutor] largest palindrome number

2011-08-25 Thread surya k
Hi, I'm doing a puzzle where it asked me to find the largest palindrome number formed by the product of two three-digit numbers. They mentioned an example saying that 9009 is the largest palindrome number formed by two two-digit numbers (99 * 91). I've written my code this way.. and I tested it

[Tutor] getting error while solving a series that estimates the value of pi

2011-07-18 Thread surya k
Hi, The problem is to estimate the value of pi using the following series. *1 / pi = (( 2 * sqrt(2) )/ 9801 ) * SIGMA of k[ (4k)! (1103 + 26390*k) / (k!^ 4 ) * 396^(4k) ]* *where k is [0, infinity)* * Problem is located at : ThinkPython Book, www.thinkpython.org *Pg 89, Exercise 7.5, Think

Re: [Tutor] getting error while solving a series that estimates the value of pi

2011-07-18 Thread surya k
Let me write the code again.. Thanks for your help. On Mon, Jul 18, 2011 at 10:38 PM, James Reynolds eire1...@gmail.com wrote: On Mon, Jul 18, 2011 at 12:10 PM, surya k sur...@live.com wrote: Hi, The problem is to estimate the value of pi using the following series. *1 / pi = (( 2