[Tutor] REQUIRED SUPPORT FOR CODE

2019-07-25 Thread NITESH KUMAR
Dear Sir/Madam I want to make Autocomplete searchbox using database .Please suggest me the code for this. Thanks & Regards Nitesh Kumar ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python

Re: [Tutor] enumerate over Dictionaries

2019-07-06 Thread Suhit Kumar
Hi, I have made the complete program but when I am compiling the program it is showing errors. Can you please help to resolve this? The code is in the file attached with this mail. On Fri, Jul 5, 2019 at 10:44 PM Animesh Bhadra wrote: > Thanks Alan and Mats for the explanation. > > On 05/07/19 1

[Tutor] Regarding help in python algorithm

2019-07-05 Thread Suhit Kumar
Hi, I am a student at an university. Currently I was working on an algorithm using python. It is based on scheduling the teachers to their nearest venues. And at the venues there can be atmost 400 teachers and these are to be divided into the Batches of 40 i.e. ten batches. All the batches will hav

[Tutor] regarding minhash and lsh

2019-02-11 Thread lokesh kumar
Hi There, i want to make a code to run few DNA seg. so that i will be able to find similarity in them. file are in million as well as seq. are large so i tried developing program but fails in it i think minhash and lsh can able to solve my problem. i need kind of program that will be easy to handle

[Tutor] Python script errors

2018-12-12 Thread Ravi Kumar
Hi, I have developed a python script to get api calls for meraki clientlogevents Thanks for all the help previously I am facing few errors such as Json_string=r.json() raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value:

Re: [Tutor] Regarding Python api script

2018-12-06 Thread Ravi Kumar
MAC Address iPhone f0:98:9d:2c: arphone c8:21:58:79:b it-mine:05:a4:c9: Querying Meraki for clientlogevents on Devices: e0:cb:b::3e:95 (HA) Not looping the devices to get api calls for this access point Querying Meraki f

Re: [Tutor] Regarding Python api script

2018-12-04 Thread Ravi Kumar
My output api calls in python is in xml so I want the output to be in the database So is there a way where I can alter my code to get api responses in json format in python and then later move the output to the database Basically at the end of it I want the all the data to be in database Th

[Tutor] Regarding Python api script

2018-12-03 Thread Ravi Kumar
Hi, I have developed a python script to get api calls for meraki clientlogevents I am wanting the output of apicalls which is in xml format integrated to sql server management studio how do i do that? Thanks ___ Tutor maillist - Tutor@python.org To u

Re: [Tutor] Issue in parsing the strings in python code

2018-11-12 Thread Shakti Kumar
On Mon, 12 Nov 2018 at 14:02, srinivasan wrote: > Dear Python Experts team, > > This question might be very simple for you, As am newbie to python, could > you please how to parse the below strings > > 1. Could you please do the needful in guiding me, that how can I extract > the strings under th

[Tutor] Problem regarding NZEC error

2018-04-08 Thread SUNIL KUMAR MAURYA
NZEC error occurs often in Python 3.5. How can it be resolved? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Listing link urls

2017-10-29 Thread Kishore Kumar Alajangi
+ tutor On Sun, Oct 29, 2017 at 6:57 AM, Kishore Kumar Alajangi < akishorec...@gmail.com> wrote: > Hi, > > I am facing an issue with listing specific urls inside web page, > > https://economictimes.indiatimes.com/archive.cms > > Page contains link urls by year and mont

[Tutor] substitute using re.sub

2017-10-25 Thread kumar s via Tutor
Hi group, I am trying to substitute in the following way and i cannot. Could you point out whats wrong in what i am doing.  >>> z'.|D' >>> re.sub(z,'1',z)'111' I just want only  '1' and not '111'.  I want:>>> re.sub(z,'1',z)'1' re.sub is repeatedly inserting 3 times because z has .|D . How can I

Re: [Tutor] custom comparator with ordered list

2017-06-26 Thread Anish Kumar
> anish singh wrote: > >> I need a custom comparator. >> >> dictionary = {a:[b,c], d:[e,f]} >> >> If both 'b' and 'e' belong to the same bin >> then it should be compared based on 'c' and 'f'. >> >> However, I want to also represent the result of the >> sorted operation in a ordered dictionary

[Tutor] IndexError: list index out of range

2016-12-27 Thread Mysore Ventaka Rama Kumar
Please review and comment/correct my error! Many thanks in advance. # Required module import os # Function for getting files from a folder def fetchFiles(pathToFolder, flag, keyWord): ''' fetchFiles() requires three arguments: pathToFolder, flag and keyWord flag must be 'STARTS_WI

[Tutor] why it is showing attribute error in line7

2016-10-29 Thread SONU KUMAR
fname = raw_input("Enter file name: ") if len(fname) < 1 : fname = "mbox-short.txt" fh = open(fname) count = 0 for line in fh: line=line.rstrip if not line.startswith("From"):continue lst=line.split() print lst[1] count=count+1 print "There were", count, "lines in the file with Fro

Re: [Tutor] Extracting bits from an array

2016-04-29 Thread Anish Kumar
> >> Hello, >> >> I have an array that takes on the following form: >> >> x = [1000,1001,1011,] > > But these are actually integers in decimal representation. You could treat > them as binary, but I recommend that you use integers in binary > representation to avoid confusion: > x

Re: [Tutor] How python keeps track of data types

2016-03-29 Thread Abhishek Kumar
Thanks everyone for answers and links.I wasn't aware of fact that python names are just references to Objects. Abhishek On Tue, Mar 29, 2016 at 1:01 AM, Abhishek Kumar wrote: > Hello > I am a computer science student,I want to know how python keeps track of > data types of va

[Tutor] How python keeps track of data types

2016-03-28 Thread Abhishek Kumar
lored compiler library but could not find anything helpful. Thanks Abhishek Kumar ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] install python without root access

2016-03-22 Thread Anshu Kumar
Hi, I have a Centos06 based machine and I don't have root access. The default Python (GCC compiler based) is quite old 2.7.5 , so I need to update it. I tried installing in local folder where i have access. I am facing deep troubles installing 1. as i try to run ./configure i face configure: err

[Tutor] mock file reader object

2016-02-11 Thread Anshu Kumar
Hi, I need to mock file reader object , i tried using @patch('__builtin__.open') but it will patch my all file open readers. More precisely i have code something like below def restore_segments_and_lines_json(segments_file_path,lines_file_path,deleted_segment_ids): with open(segments_file_p

Re: [Tutor] Simultaneous read and write on file

2016-01-19 Thread Anshu Kumar
Hello All, So much Thanks for your response. Here is my actual scenario. I have a csv file and it would already be present. I need to read and remove some rows based on some logic. I have written earlier two separate file opens which I think was nice and clean. actual code: with open(file_path,

Re: [Tutor] An Advice to a dedicated beginner

2016-01-19 Thread Anshu Kumar
Hey, This sounds very usual and common. Your next step should be something that fetches you feedback like go for job/ internship or participate in coding contests. Try to look for some small projects on github. Most importantly never loose zeal it will take you there. Good luck Anshu On Jan

[Tutor] Simultaneous read and write on file

2016-01-18 Thread Anshu Kumar
Hello Everyone, I try below code in python 2.7.10 to first create and write into a file and then read and write that file but what i get is just a file with new content. >>> with open('test.txt', 'wb+') as f: ... f.write('this is test file.') ... f.write('ok!!!') ... >>> with open('test

[Tutor] Difference between rounding off and typecasting to int

2016-01-02 Thread Ratheesh kumar
Hii everyone, Today i was just solving a problem in hacker-rank. A simple one to calculate the tip and tax for the meal. The resultant answer should be rounded off. I first wrote the code as below: m=float(input()) x=int(input()) t=int(input()) tip=(m*x)/100 tax=(m*t)/100 total=m+tip+tax print("T

[Tutor] File reading-(encoding problems)

2015-12-23 Thread Ratheesh kumar
Here is my code..try: data=open('info.txt') for each_line in data: try: (role,line_spoken)=each_line.split(':',1) print(role,end='') print(' said: ',end='') print(line_spoken,end='') except ValueError: print(each_li

[Tutor] Python script for ganglia

2015-12-22 Thread Rahul Kumar
Hi, I would like to know about how python can be use to get data from ganglia monitoring tool. For example,this link show the live production Ganglia instance for Wikimedia http://ganglia.wikimedia.org/latest/ There are various of graphs have detail about grid load,grid memory, grid cpu, grid netwo

Re: [Tutor] Python String and Unicode data types and Encode Decode Functions

2015-12-21 Thread Anshu Kumar
, Anshu On Sun, Dec 20, 2015 at 3:55 PM, Steven D'Aprano wrote: > On Sun, Dec 20, 2015 at 08:17:21AM +0530, Anshu Kumar wrote: > > > I know certain facts like > > What version of Python are you using? My *guess* is that you are using > Python 2.7, is that correct? >

[Tutor] Python String and Unicode data types and Encode Decode Functions

2015-12-20 Thread Anshu Kumar
Hi Everyone, In my current project I am dealing a lot with unicode type. There are some text files which contain unicode to accommodate data in multiple languages. I have to continuously parse these files in xml or yaml format using xml and yaml libraries. I have encountered several errors due to

[Tutor] A small query on fabric

2015-11-20 Thread Santosh Kumar
able to get them running on muliple hosts as i set in my env.hosts list parameters. If anyone has any prior experience with fabric, please asssit. Thanks, -- D. Santosh Kumar ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

Re: [Tutor] Demystification of Lambda Functions

2015-10-28 Thread Anshu Kumar
Hi, Lambda or anonymous function is core of functional programming which was not in java. With lambda you can pass not just define an anonymous function but can pass them to other functions which really makes life easier. You would like to read http://www.python-course.eu/lambda.php http://www.p

[Tutor] python certifications

2015-10-11 Thread Anshu Kumar
Hi All, I have been using python for a year now and want to certify my skill. May I know what are the certifications for python? Thanks and Regards, Anshu ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://ma

Re: [Tutor] Updating index of a list

2015-10-09 Thread Anshu Kumar
Hi Andrea, You can use lambda or list comprehension to solve your problem in one step. I am more comfortable with lambda so will explain that way. Please follow below lines of code. andreea_list = [['1', ' james', ' 1', ' 90'], ['2', ' alice', ' 1', ' 95'], ['5', ' jorgen', ' 1', '99']] andrea

Re: [Tutor] Mutable data type in python

2015-10-03 Thread Anshu Kumar
her data structure in python which would be mutable and not a sequence? Thanks and appreciate your generous help, Anshu On Sat, Oct 3, 2015 at 1:32 PM, Alan Gauld wrote: > On 03/10/15 03:46, Anshu Kumar wrote: > >> Hi Alan, >> >> I was trying to solve a simple dynamic pr

Re: [Tutor] Mutable data type in python

2015-10-03 Thread Anshu Kumar
ciate your help, Anshu On Sat, Oct 3, 2015 at 5:05 AM, Alan Gauld wrote: > On 02/10/15 17:52, Anshu Kumar wrote: > > When we invoke the same function inside a function (recursive function), i >> want to keep track of some data across all function invocation so i should >> h

[Tutor] Mutable data type in python

2015-10-02 Thread Anshu Kumar
Hi Everyone, I have been facing this problem from a while in python could I please be helped? When we invoke the same function inside a function (recursive function), i want to keep track of some data across all function invocation so i should have shareable type but built in data types string, i

[Tutor] How to parse a mailing list thread?

2015-09-19 Thread chandan kumar
Hello, I am looking for a python module which i can use to parse mailing thread and extract some information from it. Any pointer regarding that would be helpful. Thanks, Chandan Kumar ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] Type Error

2015-09-14 Thread Rohit kumar
Correct, The filename should be passed as string value. Regards, -- Rohit Kumar | Technical Lead ZeOmega | Population Health Management Solutions Improving Population Health One Person at a Time Office: +91 80 4243 2000 (4067) | Mobile: +91 9342637703 -Original Message- From: Tutor

Re: [Tutor] Trouble using bioread to convert files from .acq to .mat

2015-06-03 Thread Ila Kumar
, Laura Creighton wrote: > In a message of Mon, 01 Jun 2015 15:50:26 -0400, Ila Kumar writes: > >Hello, > > > >I am a new Python user attempting to use bioread ( > >https://pypi.python.org/pypi/bioread/0.9.5) to convert files from > >aqknowledge to matlab. I am using a

[Tutor] Trouble using bioread to convert files from .acq to .mat

2015-06-01 Thread Ila Kumar
Hello, I am a new Python user attempting to use bioread ( https://pypi.python.org/pypi/bioread/0.9.5) to convert files from aqknowledge to matlab. I am using a 64-bit PC, and I have downloaded Matlab, Python, numpy, scipy and bioread. Can someone walk me through the installation process for this p

Re: [Tutor] Ipython Queries

2015-03-15 Thread Santosh Kumar
: > On 14 March 2015 at 09:53, Steven D'Aprano wrote: > > On Fri, Mar 13, 2015 at 10:39:50PM +0530, Santosh Kumar wrote: > >> Hi All, > >> > >> I have installed both python2 and python3 in my system . When i used > >> ipython it by default goes to py

[Tutor] Ipython Queries

2015-03-13 Thread Santosh Kumar
Hi All, I have installed both python2 and python3 in my system . When i used ipython it by default goes to python2 base. How/what is the easy way to swith between python2 and python3 ? Thanks, santosh ___ Tutor maillist - Tutor@python.org To unsubscri

Re: [Tutor] How can I replicate a list in a for loop

2015-02-04 Thread Suresh Kumar
here is the sample code >>> import itertools >>> import string >>> var=[] >>> for i in string.ascii_lowercase[0:5]: var.append(i) >>>print var ['a', 'b', 'c', 'd', 'e'] >>> length=int(raw_input("enter the length of random letters you need ")) enter the length of random letters you need

[Tutor] first post

2015-02-01 Thread sathya kumar Prasanna
Hi guys, I am completely new to programming and have never had the opportunity to do attempt coding before. However I have started now and am facing my first problem. The code is as shown, I need to *fill in the blanks* such that when the code is run it gives the answer as "True". #Please help.

Re: [Tutor] A small project

2014-12-02 Thread Santosh Kumar
All, Any suggestion to my question ? On Thu, Nov 27, 2014 at 12:43 PM, Santosh Kumar wrote: > Hi All, > > I am planning to start a small project , so i need some suggestions on how > to go about it. > > 1) It basically takes some inputs like (name,age,course,joining > dat

[Tutor] A small project

2014-11-26 Thread Santosh Kumar
. Santosh Kumar ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Modules to work with curl.

2014-07-18 Thread Santosh Kumar
ways to run the above statement in a effective way ? 2) How to improve the performance if any? Thanks, santosh On Fri, Jul 18, 2014 at 12:45 AM, Danny Yoo wrote: > On Thu, Jul 17, 2014 at 11:35 AM, Santosh Kumar > wrote: > > > I am currently working on a project , which h

[Tutor] Modules to work with curl.

2014-07-17 Thread Santosh Kumar
Hi, I am currently working on a project , which has lots of curl commands. I am using subprocess.Popen to run these curl commands. But somehow i see its bit slow. Is there a way/module by which i can improve the performance of the program. Thanks, -- D. Santosh Kumar RHCE | SCSA +91-9703206361

[Tutor] Block highlighters in python

2014-04-07 Thread Santosh Kumar
any such facility in python ? -- D. Santosh Kumar ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Inheritance in classes

2014-04-07 Thread Santosh Kumar
.value3 Out[6]: 3 If you notice in the below example you will see that the child class object ``obj1`` has inherited all the attibutes of the parent class. Is there a way by which i can make the child class not inherit some of the properites of parent class. -- D. Santosh Kumar

[Tutor] Constructs

2014-04-07 Thread Santosh Kumar
1 #!/usr/bin/python 2 3 class shape: 4 def __init__(self,x,y): 5 self.x = x 6 self.y = y 7 description = "This shape has not been described yet" 8 author = "Nobody has claimed to make this shape yet" 9 10 def __init__(self,x,y,z): 11 self.x = x 12 self.y

Re: [Tutor] viewkeys,viewvalues,viewitems : Use Cases

2014-02-26 Thread Santosh Kumar
I want to understand about where to use , viewkeys() viewvalues() viewitems() Thanks, santosh On Wed, Feb 26, 2014 at 6:59 PM, Alan Gauld wrote: > On 26/02/14 07:04, Santosh Kumar wrote: > > I defined a dictionary a below. >> >> In [14]: a = {'a':1,'b'

Re: [Tutor] calling global in funtions.

2014-02-26 Thread Santosh Kumar
local and global in the same function. All usage > will be global, which will probably be a bug. > -- D. Santosh Kumar RHCE | SCSA +91-9703206361 Every task has a unpleasant side .. But you must focus on the end result you are producing. ___ Tuto

[Tutor] calling global in funtions.

2014-02-25 Thread Santosh Kumar
All, Requirement : i want to call a variable assigned outside a function scope anytime within the function. I read "global" is a way. a) Case I looks fine. b) Case II is bombing out. Is this how it works or please correct me if i am wrong. case I: In [17]: a = 10 In [19]: def fun_local():

[Tutor] viewkeys,viewvalues,viewitems : Use Cases

2014-02-25 Thread Santosh Kumar
All, I defined a dictionary a below. In [14]: a = {'a':1,'b':2,'c':3} In [15]: type(a) Out[15]: dict Funtion associated with dictionaries. In [11]: print a.viewkeys() dict_keys(['a', 'c', 'b']) In [12]: print a.viewvalues() dict_values([1, 3, 2]) In [13]: print a.viewitems() dict_items([('a'

Re: [Tutor] Regular expression - I

2014-02-18 Thread Santosh Kumar
Thank you all. I got it. :) I need to read more between lines . On Wed, Feb 19, 2014 at 4:25 AM, spir wrote: > On 02/18/2014 08:39 PM, Zachary Ware wrote: > >> Hi Santosh, >> >> On Tue, Feb 18, 2014 at 9:52 AM, Santosh Kumar >> wrote: >> >>> >&g

Re: [Tutor] Regular expression - I

2014-02-18 Thread Santosh Kumar
ceeded before going ahead > to call group() on the result (since in this case there is no result). > > > On 18-Feb-2014, at 09:52, Santosh Kumar wrote: > > > > > Hi All, > > > > If you notice the below example, case I is working as expected. > > > > Cas

[Tutor] Regular expression - I

2014-02-18 Thread Santosh Kumar
Hi All, If you notice the below example, case I is working as expected. Case I: In [41]: string = "test" In [42]: re.match('',string).group() Out[42]: '' But why is the raw string 'r' not working as expected ? Case II: In [43]: re.match(r'',string).group()

Re: [Tutor] Regular expressions

2014-02-15 Thread Santosh Kumar
Thank you all. On Thu, Feb 13, 2014 at 10:47 PM, Walter Prins wrote: > Hi, > > On 13 February 2014 06:44, Santosh Kumar wrote: > > I am using ipython. > > > > 1 ) Defined a string. > > > > In [88]: print string > > foo foobar > > > >

[Tutor] Regular expressions

2014-02-12 Thread Santosh Kumar
Hi all, I am using ipython. 1 ) Defined a string. In [88]: print string foo foobar 2) compiled the string to grab the "foo" word. In [89]: reg = re.compile("foo",re.IGNORECASE) 3) Now i am trying to match . In [90]: match = reg.match(string) 4) Now i print it. In [93]: print match.group()

[Tutor] I need a good resource for python Django

2013-08-17 Thread Arun Kumar
Hi, Can anyone suggest me a good resource for python Django. I've gone through the official website of Django but it is of limited use to me. Any help on this would be highly appreciated. Regards, Arun Kumar http://clicknscroll.blogspot.com ___

[Tutor] Any speech to text conversation python library for Linux and mac box

2013-06-12 Thread Ranjith Kumar
heers, Ranjith Kumar K, Chennai. http://ranjithtenz.wordpress.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] create a facebook Application for linux desktop

2013-03-31 Thread chandan kumar
information for this. Please tell me to how to get started to execute this using python. Thanks, With Best Wishes, Chandan Kumar Final Year, Computer Science and Engineering Dr.B.C.Roy Engineering College, Durgapur https://ciypro.wordpress.com ___ Tutor

[Tutor] Want to create a facebook Application for linux desktop

2013-03-31 Thread chandan kumar
information for this. Please tell me to how to get started to execute this using python. Thanks, With Best Wishes, Chandan Kumar Final Year, Computer Science and Engineering Dr.B.C.Roy Engineering College, Durgapur https://ciypro.wordpress.com ___ Tutor

[Tutor] Problem with os.system

2013-03-01 Thread Vijay Kumar R
I was using python for some application which used to create directories and also to run some exes using the os.system command from a program.py file which was working fine. For some reasons I got my system formatted and got the windows 7 installed. Now again I installed python and tried runnin

[Tutor] How does # -*- coding: utf-8 -*- work?

2013-01-26 Thread Santosh Kumar
Everything starting with hash character in Python is comment and is not interpreted by the interpreter. So how does that works? Give me full explanation. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.py

[Tutor] How can I modify this simple script for argparse?

2012-10-13 Thread Santosh Kumar
Here is a sample script without argparse implementation: from sys import argv script, filename = argv foo = "This line was written by a Python script." with open(filename, 'a') as file: file.write(foo) I find argparse hard. Just give me a startup. How can I make a asgparse version? ___

[Tutor] list all links with certain extension in an html file python

2012-09-28 Thread Santosh Kumar
I want to extract (no I don't want to download) all links that end in a certain extension. Suppose there is a webpage, and in the head of that webpage there are 4 different CSS files linked to external server. Let the head look like this: http://foo.bar/part1.css";> http://foo.bar/part2.c

[Tutor] Trying to get next item from a list

2012-09-17 Thread Santosh Kumar
Here is the script: alphabets = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] i = input("Press any English alphabet: ") current = alphabets.index(i) print(current) next = current+1 print(next) print(alphabets.inde

[Tutor] Confusion with Python, Bash and Command Prompt

2012-08-09 Thread Santosh Kumar
Hello There, We all know that line starting with "#" in Python is a comment. We also know that when the first line of any file (with any extension) has "#!/usr/bin/env bash" and if you make it executable and do ./filename.ext in the terminal then it will be considered as bash file (in this case e

[Tutor] How to import a few modules when I enter python?

2012-08-06 Thread Santosh Kumar
Hello there, I have a few scripts that I made to experiment with, I have to import them everytime I enter the Python shell. The scripts are in `/home/username/workshop/` (this directory has also some non .py files) directory. Is there a way I can import them as soon as I enter Python? Also I am e

Re: [Tutor] Why isn't my simple if elif script not working?

2012-07-21 Thread Santosh Kumar
In first half of this script: prompt = raw_input("Can you tell me your name? ") if prompt in ("Yes", "yes", "y", "Y"): name = raw_input("What's your name? ") elif prompt in ("No", "no", "n", "N"): exit("OK, have nice day..") else: prompt = name if name == "Santosh": print "Hey! I

[Tutor] Where do I start developing from?

2012-07-20 Thread Santosh Kumar
Hello There, First time I came in contact with Python programming languages was nearly 1 year (I am learning this languages from my home). Prior to this I was good at PHP, HTML and CSS (this doesn't mean that I want to say that I wanted to become a web developer). I have read many books and tutori

Re: [Tutor] suggestion for an editor

2012-07-19 Thread Ranjith Kumar
la > > -- > C. Balasubramanian > > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > > -- Cheers, Ranjith Kumar K, Chennai. http://ranjithtenz.wordpress.com _

[Tutor] Why isn't my simple if elif script not working?

2012-07-17 Thread Santosh Kumar
Here is my script: name = raw_input("What's your name? ") if name == "Santosh": print "Hey!! I have the same name." elif name == "John Cleese" or "Michael Palin": print "I have no preference about your name. Really!!" else: print "You have a nice name." The if part works well. The e

[Tutor] How to print something just after 3 attempts?

2012-07-17 Thread Santosh Kumar
Hello There, This problem isn't so simple as it looks in the title/subject of this email. I am doing a tutorial on Python, and there is a script named password.py: password = "foobar" while password != "unicorn": password = raw_input("Password: ") print "Welcome in" The question says "Mod

[Tutor] How does this tiny script works?

2012-07-14 Thread Santosh Kumar
I am reading How to Think Like a Computer Scientist with Python. There is a script in the exercise: if "Ni!": print 'We are the Knights who say, "Ni!"' else: print "Stop it! No more of this!" if 0: print "And now for something completely different.." else: print "Whats all this, t

[Tutor] How to get two user inputs in same prompt seperated by a special character?

2012-07-13 Thread Santosh Kumar
Like in my script: #!/usr/bin/env python #-*- coding:utf-8 -*- print "You will be prompted to enter your height in feet and inches." height_in_feet = input("How much feet are you long: ") remaining_inches = input("How much inches remained? ") inches_in_feet = height_in_feet * 12 total_height_in

[Tutor] Pymongo Error

2012-06-18 Thread Ranjith Kumar
, 'USER': '', 'PASSWORD': '12424214', 'HOST': 'mongodb://staff.mongohq.com/', 'PORT': 'X', }, } my requirement packages, Django==1.3 dictshield==0.4.4 django-mongodb-engine==0.4.0 django-social-

[Tutor] A simple "if" and "elif" problem

2012-05-05 Thread Santosh Kumar
I am reading the documentation and I'm in the section 4.1. Let me write it down here: >>> x = int(input("Please enter an integer: ")) Please enter an integer: 42 >>> if x < 0: ... x = 0 ... print('Negative changed to zero') ... elif x == 0: ... print('Zero') ... elif x == 1: ...

[Tutor] What does L at last stands for when 10 ** 30

2012-05-04 Thread Santosh Kumar
I am doing: >>> power = 10 ** 30 >>> power and the output: >>> 1...L # what does L represent interesting thing is L doesn't shows when I do a: print power ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options

Re: [Tutor] Is there space a between "#!" and "/usr/bin/env python" ?

2012-05-02 Thread Santosh Kumar
Now its enough info. Thanks all for clearing my doubt. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Is there space a between "#!" and "/usr/bin/env python" ?

2012-05-01 Thread Santosh Kumar
Its getting complicated now. Will it effect or not? Give me one word answer with one line description. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Is there space a between "#!" and "/usr/bin/env python" ?

2012-05-01 Thread Santosh Kumar
Is there space a between "#!" and "/usr/bin/env python"? I have seen Python manual, it says <#! /usr/bin/env python> But snippet manager of many text editing programs have <#!/usr/bin/env python>. Python is a strongly typed language, which one is correct? __

[Tutor] Getting started with PyGTK [Receiving Error]

2012-04-28 Thread Santosh Kumar
System Information Ubuntu 11.10 Python 2.7.2 Problem I think my Ubuntu has PyGTK and GTK both already installed. But however when I am importing "gtk" in Python interactive mode then I am getting the following warning: (.:4126): Gtk-WARNING **: Unable to

[Tutor] count numbers only in the string

2012-03-06 Thread kumar s
+25+52 = 82 0 G 2 T 3 T 91    =  0+2+3+91 =  96 44 ^C 70   =   44+70 =  114  In first string 1A0G19  I am only adding 1, 0, and 19.    I am not splitting 19 to add 1+9 which will give totally wrong answer for me. Is there a way I can do this.  Thanks for your advise.  kumar

[Tutor] How to start with Glade.

2012-03-05 Thread Ganesh Kumar
Hi Guys, I am new to GUI, I know little bit python, But I do know, How to start with Glade and how to combine with .glade file to python. please guide me.. -Ganesh Did I learn something today? If not, I wasted it. ___ Tutor maillist - Tutor@python.or

Re: [Tutor] Tutor Digest, Vol 95, Issue 80

2012-01-30 Thread Arun Kumar
ng an object (Peter Otten) > 2. Re: Deleting an object (Alan Gauld) > 3. Re: Socket Programming (Navneet) > 4. Re: Why do you have to close files? (amt) > 5. loop until a keypress (Surya K) > 6. Help Glade Tutorial. (Ganesh Kumar) > 7. Re: Help Glade Tutorial. (Chris Fu

[Tutor] Help Glade Tutorial.

2012-01-29 Thread Ganesh Kumar
Hi Guys, I am searching for a Glade tutorial, on how to create simple projects Glade with python 1) design a simple interface in glade 2) use the glade interface to write some really simple application with python. I search in goggled i didn't get good tutorials, guide me guys How to start with

[Tutor] splitting the large file into small pieces and download

2012-01-26 Thread Arun Kumar
Hi all, I want to build a small download accelerator program. I want to know how to split the file to be downloaded into small pieces and assign the each small piece to a thread for downloading. -- Thanks & Regards, Arun Kumar http://clicknscroll.blogspot

[Tutor] Setting Network settings from Python/Djang

2012-01-22 Thread Ganesh Kumar
I'm working on a simple web interface for an embedded computer. The computer will ship with a static default ip that will then need to be updated by the install tech who may not be tech/linux savvy. Basicly I need to change the following system settings from a Django app. 1. IP Addres 2. Su

Re: [Tutor] Facebook apps with python

2012-01-18 Thread Ranjith Kumar
tor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > > -- Cheers, Ranjith Kumar K, Chennai. http://ranjithtenz.wordpress.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] re module help

2012-01-09 Thread Ganesh Kumar
Hi Gurus, I have created regular expression with os modules, I have created file sdptool to match the regular expression pattern, will print the result. I want without creating file how to get required output, I tried but i didn't get output correctly, over stream. #! /usr/bin/python import os,re

[Tutor] Parse multi line with re module.

2012-01-03 Thread Ganesh Kumar
Hi Guys, I want parse multiple line. with re.module, this is my given string http://dpaste.com/680760/ I have try with re.compile module. I want parse two line mac address and channel, I have done with for mac address finding r = re.compile("^Searching for OPUSH on (\w\w(:\w\w)+)") for channel f

Re: [Tutor] Tutor Digest, Vol 88, Issue 83

2011-06-21 Thread arun kumar
e-ID: <4dff7c50.3000...@gmail.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On 20-06-11 17:34, arun kumar wrote: > > HI, i have a some 100 plus html individual files.I want to convert > > them to a single pdf document programatically. How to con

[Tutor] html files to pdf document

2011-06-20 Thread arun kumar
HI, i have a some 100 plus html individual files.I want to convert them to a single pdf document programatically. How to convert them in python. Are there any functions,modules or libraries for python to achieve this. -- Thank you Arun Kumar http://clicknscroll.blogspot.com

[Tutor] python-gobject for debian4

2011-06-13 Thread Ganesh Kumar
Hi Guys. I want python-gobject package for debian4 (etch). But unfortunately removed for debian4 depository . How to install python-gobject package in debian4.. My Idea is download debian5 repository python-gobject.deb file Install in debian4. I have try is working fine. but the thing is rebo

[Tutor] What is `if __name__ == "__main__"` for?

2011-05-20 Thread Ganesh Kumar
Hi Gurus, I am new python programming.. I see many programs if __name__ == '__main__': when I check __name__ always eq __main__. what purpose use these structure.. please guide me.. -Ganesh -- Did I learn something today? If not, I wasted it. ___ Tut

[Tutor] How to compile source code in debian

2011-05-09 Thread Ganesh Kumar
Hi Gurus, I want compile ubuntu software centre source code from debian how to compile...please help me.. I downloaded all file contents have python file .. https://launchpad.net/ubuntu/maverick/+source/software-center/3.0.4 Advance thanks.. Ganesh -- Did I learn something today? If not, I was

[Tutor] NLP

2011-04-08 Thread Ranjith Kumar
Hi all, Can anyone suggest me any best Natural Language Processing in python other than nltk. -- Cheers, Ranjith Kumar K, Chennai. http://ranjithtenz.wordpress.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

Re: [Tutor] Platform Independence in Python

2011-04-06 Thread Ranjith Kumar
Hi Ratna, I hope this link will help http://www.java2s.com/Code/Python/GUI-Tk/AlarmDemo.htm On Thu, Apr 7, 2011 at 10:04 AM, Ratna Banjara wrote: > Hello all, > > I was learning GUI in python and found dissimilarities while importing > 'tkinter' module. > In windows we should write > =>impo

  1   2   >