Re: [Tutor] AttributeError: 'module' object has no attribute 'start'

2014-06-13 Thread Prasad, Ramit
> Please don't top post on this list. Please don't try telling me what to > do or not do. Thanks in anticipation. Oh the irony. Ramit This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and compl

Re: [Tutor] How to post: Was Re: The Charms of Gmail

2013-12-23 Thread Prasad, Ramit
Mark Lawrence wrote: > I'll nag who I bloody well like until such time time as they can post > without pissing me off. But what really pisses me off is people telling > me how to behave. So please stop nagging, you nagger. Oh, the irony. ~Ramit This email is confidential and subject to imp

Re: [Tutor] Easiest framework for web development?

2013-09-30 Thread Prasad, Ramit
vit...@gmx.com wrote: > Sent: Monday, September 30, 2013 4:16 AM > To: tutor@python.org > Subject: [Tutor] Easiest framework for web development? > > Hi > > Which of the available Python frameworks is the EASIEST to learn for a > NEWBIE who needs to do *basic* web development? (only the *most bas

Re: [Tutor] How to create dictionaries loadable with import

2013-09-24 Thread Prasad, Ramit
Treder, Robert wrote: > Hi Python tutors, > > I'm fairly new to Python.  I'm working with Python v2.7.4 and the nltk > package on a couple of text > mining projects.  I create several dictionaries that are pretty static. Will > probably only be updated > every or month or every couple of months.

Re: [Tutor] ImportError: No module named '_sysconfigdata_m'

2013-09-24 Thread Prasad, Ramit
Alan Gauld wrote: > > On 24/09/13 14:20, Albert-Jan Roskam wrote: > > >> "python", python 2.7 fires up. Also, I entirely removed python 3.2 > >> (sudo rm -rf $(which python3.2), IIRC), which came with Linux Mint. > > That's almost never the right way to remove a package that came with the OS. >

Re: [Tutor] Question about Functions

2013-09-10 Thread Prasad, Ramit
novo shot wrote: > Dear tutors: > > The following is an example I found in the Raspberry Pi for Dummies book: > > #function test > > def theFunction(message): > print "I don't get ", message > return "ARRRGH!" > > theFunction("this") > > result=theFunction("this either") > print "reply

Re: [Tutor] why do i keep getting syntax errors in python when this runs

2013-09-06 Thread Prasad, Ramit
Joel Goldstick wrote: > On Fri, Sep 6, 2013 at 12:27 AM, mike johnson wrote: > > can you please help me figure out why this isnt working thanks > > You have tthree problems: > > > # convert.py > > # this program is used to convert Celsius temps to Fahrenheit > > # By: James Michael Johnson > > >

Re: [Tutor] A mergesort

2013-09-03 Thread Prasad, Ramit
D.V.N.Sarma wrote: [snip recursive merge sort algorithm] > Especially the statement > > v = (a[0] < b[0] and a or b).pop(0) > > gives a.pop(0), if a[0] < b[0] otherwise b.pop(0). I believe this idiom was used before the ternary if statements were introduced (in 2.5 I believe). In modern Python y

Re: [Tutor] Global var not defined?

2013-08-27 Thread Prasad, Ramit
leam hall wrote: > Could use some help with this. Python 2.4.3 on RHEL 5.x. > > In the functions file that gets imported: > > def append_customer(line_list): >     global customers >     cust = line_list[0] // list with Customer info in [0] >     cust = clean_word(cust)  // Trims

Re: [Tutor] is the the two style of writting the same?

2013-08-20 Thread Prasad, Ramit
tan Sikonai wrote: > > ? You should wait at least 24 hours as many people in this mailing list are around the world and may not see this immediately. > > 2013/8/20 sikonai sikonai > >>> list=[1,2,3,4,5,6,7,8,9] > >>> list[9:0:-2] > [9, 7, 5, 3] > >>> list[10:0:-2] > [9, 7, 5, 3] > > I want to

Re: [Tutor] python tutoring

2013-08-20 Thread Prasad, Ramit
Fowler, Trent wrote: > > Hello, > > Not long ago I came across the website of a professional programmer offering > python tutoring services: > > http://www.jeffknupp.com/python-tutoring/ > > I have attempted to contact him because I am interested but I've been unable > to get in touch. I was

Re: [Tutor] Need help printing a pickled data

2013-06-25 Thread Prasad, Ramit
Again, please leave in attributions. Matt D wrote: > [Ramit Prasad wrote] > > > > Well I think self.data is some kind of container with a pickled string, > > given the code to unpickle it is: > > > Exactly! This is what the C++ file 'pickle.h' creates to send to the > Python GUI: Not really. >

Re: [Tutor] Need help printing a pickled data

2013-06-25 Thread Prasad, Ramit
Please leave attributions in so we know who is saying what. Matt D wrote: > [Ramit Prasad wrote] > > [Peter Otten wrote] > > > > with open('mypicklelog.txt','ab') as log: # open in binary mode > > pickle.dump(self.data, log) # serialize data and write to file > > > > where pickle.dump(obj, fil

Re: [Tutor] Need help printing a pickled data

2013-06-25 Thread Prasad, Ramit
Peter Otten wrote: > Matt D wrote: > > > On 06/24/2013 07:17 PM, Alan Gauld wrote: > >> On 24/06/13 23:05, Matt D wrote: > >>> I have been unable to find a way to write pickled data to text file. > >> > >> Probably because pickled data is not plain text. > >> You need to use binary mode. However..

Re: [Tutor] Writing logfile data to a user opened file

2013-06-21 Thread Prasad, Ramit
Matt D wrote: > [Ramit P wrote:] > > When you open a file the data should be written to that. If you want to > > move existing data from logfile.txt into user opened file then you need > > to read logfile.txt and then write it to the user opened file. To make > > your life simpler, either pass in t

Re: [Tutor] Best Code testing practice?

2013-06-21 Thread Prasad, Ramit
Matt D wrote: > Sent: Thursday, June 20, 2013 6:44 AM > To: tutor@python.org > Subject: [Tutor] Best Code testing practice? > > Hey guys! > Is there a fast way test some piece of code? I would like to be able to > look at the GUI I am making with out changing the file in dir 'baz' and > running t

Re: [Tutor] Writing logfile data to a user opened file

2013-06-21 Thread Prasad, Ramit
Matt D wrote: > Hey guys! > So now my UI panel works well with this: > > # Open file button click event binded to openfile > btn = wx.Button(self, -1, "Click me") > sizer.Add(btn, pos=(7,2)) > btn.Bind(wx.EVT_BUTTON, self.openFile) > > #set the panel layout > s

Re: [Tutor] How to redirect console output to a TextEdit box on a QT Python Gui ?

2013-06-19 Thread Prasad, Ramit
SM wrote: > Hello Chris, Thanks for your response. I have a follow-up question, if you > don't mind, to understand > your answer better. > I am running a python3 script. So  first part of your answer applies here: > > "If the application you run is a Python script, import it, execute the > functi

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-19 Thread Prasad, Ramit
Matt D wrote: > > > > > > Also note, that unless you do self.logfile.close() it is not guaranteed > > that the data is being written to file. I prefer to use the following > > idiom for Python 2.6+ (might be in 2.5, but not sure offhand when it was > > added). > > > > with open('filename.txt', 'a'

Re: [Tutor] Need help appending data to a logfile

2013-06-19 Thread Prasad, Ramit
Peter Otten wrote: > Matt D wrote: > > > Hey, > > I wrote some simple code to write data to a logfile and it works pretty > > well (thanks guys). Now my problem is that every time i run the program > > the old logfile.txt is overwritten. > > The help() function in the interactive interpreter is

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-18 Thread Prasad, Ramit
Matt D wrote: > > There are other ways a script might change the current directory. For > > example, some naive scripts use os.chdir() > > > > But how is it you don't know what the current directory was when the > > code ran? A simply pwd can tell you, if your prompt doesn't already > > reveal i

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-04 Thread Prasad, Ramit
Matt D wrote: > Hello, > > I am using an open source wxPython GUI that I like very very much. I > have ideas about some modifications I need but I cannot be bothering the > author too much so I must learn some very specific things about Python > in order to make the modification myself. First, I

Re: [Tutor] Fwd: Difference between types

2013-05-31 Thread Prasad, Ramit
eryksun wrote: > > Also, when you post code remember to use less than 70 characters per > line. Gmail has a 'feature' to automatically hard wrap plain-text > messages at about 70 characters, which it applies *after* you send > (i.e. there's no indicator in the composer... brilliant). It is not th

Re: [Tutor] got text switched

2013-05-31 Thread Prasad, Ramit
Jim Mooney wrote: > Sent: Saturday, May 25, 2013 10:21 PM > To: tutor@python.org > Subject: [Tutor] got text switched > > Oops, Gmail switched me back to rich text. My apologies. Back to plain > ;') I wish I could automate the mode, per-recipient, since I do need > rich text for some things. The

Re: [Tutor] To error statement or not to error statement

2013-05-30 Thread Prasad, Ramit
Jim Mooney wrote: > Sent: Wednesday, May 22, 2013 11:28 AM > To: tutor@python.org > Subject: [Tutor] To error statement or not to error statement > > >> "I find it amusing when novice programmers believe their main job is > >> preventing programs from crashing. ... More experienced programmers rea

Re: [Tutor] Random Number Game: Returns always the same number - why?

2013-05-30 Thread Prasad, Ramit
[Reordered response to after quote] Thomas Murphy wrote: > > > > There are a few issues here: > > * variable names should be lower case > > * for this case it's best to use for loop with range() > > * you calculate random number only once, outside of loop > > > > Try something like: > > > > for c

Re: [Tutor] Word Jumble - Chpt4 (Explanation)

2013-05-17 Thread Prasad, Ramit
Please always send to the list (use your email client's Reply-to-list or Reply-all functionality). Arvind Virk wrote: > Thanks Ramit! > > I did try to use print statements to understand my outputs but I may have > been best placed to utilse > some formatting to make it more readable. I did not

Re: [Tutor] Python Idle Crashing

2013-05-17 Thread Prasad, Ramit
Forwarding to the list as I believe the reply was mistakenly sent only to me. Marc Tompkins wrote: > On Fri, May 17, 2013 at 11:08 AM, Prasad, Ramit > wrote: > bob gailer wrote: > > > > On 5/16/2013 8:49 PM, Alan Gauld wrote: > > > don't run programs o

Re: [Tutor] Python Idle Crashing

2013-05-17 Thread Prasad, Ramit
bob gailer wrote: > > On 5/16/2013 8:49 PM, Alan Gauld wrote: > > don't run programs on real data using IDLE. IDLE is for developing > > programs not running them. > > That is really scary. Why do you say that? The IDLE documentation does > NOT say that! Relates to IDEs and not IDLE in specific.

Re: [Tutor] Word Jumble - Chpt4 (Explanation)

2013-05-16 Thread Prasad, Ramit
Arvind Virk wrote: > Hi guys! > > This is my first post so go gentle. I'm just getting into Python programming > and am having an issue > understanding the Word Jumble Game. > > import random > > WORDS = ('python','jumble','easy','difficult','lower','high') > word = random.choice(WORDS) > corre

Re: [Tutor] Python Idle Crashing

2013-05-16 Thread Prasad, Ramit
Dave Angel wrote: > On 05/16/2013 02:17 PM, kyle seebohm wrote: > > I recently created a program that searches through a computer's drive to > > make a list of all the > files in that drive. However, the drive I am attempting to parse through is > extremely large and when I > run my program, it r

Re: [Tutor] range efficiency

2013-05-10 Thread Prasad, Ramit
Jim Mooney wrote: > If I'm using a variable-dependent range in a for loop, is Python smart > enough to figure the variable once so I don't have to hoist it up? > > That is for c in range(0,x+2), is x+2 figured once or every time > through the loop? I'm assuming it's once but I like to verify. > >

Re: [Tutor] Text Editors and Linux (was Re: exit message)

2013-05-08 Thread Prasad, Ramit
Steven D'Aprano wrote: > On the other hand, I work with, and watch, a lot of techies who live in > screen. They swear that > they're more efficient, but watching them hunt for the right virtual terminal > doesn't look very > efficient to me. I often see them flip through three or four different V

Re: [Tutor] Argparse functions with N parameters

2013-05-07 Thread Prasad, Ramit
Peter Otten wrote: [snip] > > There may be a library out there that does this with bells and whistles, but > I haven't looked. > This is not related to the OP, but have you [Peter/tutors] taken a look at the docopt library? Any thoughts compared to argparse/optparse? ~Ramit This email is con

Re: [Tutor] Text Editors and Linux (was Re: exit message)

2013-05-07 Thread Prasad, Ramit
Steven D'Aprano wrote: > * a decent console app that supports multiple tabs; Any reason to prefer tabs to virtual terminals (i.e. screen)? ~Ramit This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy

Re: [Tutor] POST MULTI PART DATA WITH PYTHON

2013-05-06 Thread Prasad, Ramit
Please post your comments after quoted text (either bottom posting or in-line) not before (top posting). I have fixed the order below. > On Mon, May 6, 2013 at 10:35 PM, Ajin Abraham wrote: > > Hi, > >I was working on a python project that requires to upload an image > > using httplib. Here

Re: [Tutor] dict.iteritems() in Python3, was Re: Tutor Digest, Vol 110, Issue 117

2013-04-30 Thread Prasad, Ramit
Peter Otten wrote: > Prasad, Ramit wrote: > > > Jim Mooney wrote: > >> > >> > In py3.x, iteritems was replaced by .items() > >> > >> Interesting, since iteritems was in my book, which was "updated" for > >> Py33. I guess

Re: [Tutor] Loop not executing.

2013-04-30 Thread Prasad, Ramit
Ajin Abraham wrote: > Hi, >I am using a python snippet that will send some data after the data > length reaches a particular length. So it is supposed to loop and > periodically sends the data to an email. i am using smtplib to send > mail. i will attach the code snippet. > > def email(): >

Re: [Tutor] Tutor Digest, Vol 110, Issue 117

2013-04-30 Thread Prasad, Ramit
Jim Mooney wrote: > > > In py3.x, iteritems was replaced by .items() > > Interesting, since iteritems was in my book, which was "updated" for > Py33. I guess the moral is you shouldn't trust an author 100% ;') I > must admit, iteritems did seem awkward and annoying so I'm glad it's > dropped. >

Re: [Tutor] totalViruses[i] /= float(numTrials),

2013-04-24 Thread Prasad, Ramit
Alan Gauld wrote: > On 24/04/13 20:32, Oscar Benjamin wrote: > > On 24 April 2013 20:07, Alan Gauld wrote: > >> On 24/04/13 16:52, Dave Angel wrote: > >> > Does it mean? ; totalViruses[i] = totalViruses[i]/float(numTrials) > > >>> As the others have said, that's exactly right, at least

Re: [Tutor] Processing Linux command line output

2013-04-24 Thread Prasad, Ramit
Gareth Allen wrote: > Hi all, > > I'm trying to get the output of a command and split it into a list that I can > process.  What is the > best way to go about doing this? In bash I would use tools like grep, sed awk > etc. > > Here's an example: > > ifconfig > > lo        Link encap:Local Loo

Re: [Tutor] Concatenating numeric data in Python 3.3

2013-04-24 Thread Prasad, Ramit
sparkle Plenty wrote: > On Wed, Apr 24, 2013 at 4:21 PM, Prasad, Ramit > wrote: [snip] > > > > Here is my function as it stands now: > > > >   def conCatNumbers(numOne, numTwo, numThree): > >     global instanceGroup, lengthCounter, instanceCounter

Re: [Tutor] Concatenating numeric data in Python 3.3

2013-04-24 Thread Prasad, Ramit
Thank you for not replying above, but please continue to CC the tutor list. sparkle Plenty wrote: > > On Wed, Apr 24, 2013 at 2:45 PM, Prasad, Ramit > wrote: > Please post your response *after* the quoted context. > > sparkle Plenty wrote: > > > > Thanks to b

Re: [Tutor] Concatenating numeric data in Python 3.3

2013-04-24 Thread Prasad, Ramit
Please post your response *after* the quoted context. sparkle Plenty wrote: > > Thanks to both of you for your assistance. > Since the completed message must be in hex, I also have an issue with losing > high order zeros during > conversions, although the binary shift works well for adding on to

Re: [Tutor] Concatenating numeric data in Python 3.3

2013-04-24 Thread Prasad, Ramit
sparkle Plenty wrote: > Sent: Wednesday, April 24, 2013 11:52 AM > To: Tutor@python.org > Subject: [Tutor] Concatenating numeric data in Python 3.3 > > What is the best way to concatenate packed numeric data?  I am building a > message to send to a device > and it has a very specific header forma

Re: [Tutor] trouble installing library

2013-04-23 Thread Prasad, Ramit
Lolo Lolo wrote: [snip] > since im on windows i used dir instead of ls, but this line: > > $ . bin/activate > > is not recognised as a command. If i try to open it wth python cmd says no > such file or directory > [snip] Instead of trying `. bin/activate` try `bin/activate` (note the lack of "

Re: [Tutor] string.Template

2013-04-23 Thread Prasad, Ramit
Albert-Jan Roskam wrote: > > On 24/04/13 00:14, Albert-Jan Roskam wrote: > >> Hello, > >> > >> Is there a better, *built-in* alternative for the code below? The > >> recursion > > works, > >> but it feels like reinventing the wheel. > > > > What makes you think it is reinventing the wheel? > >

Re: [Tutor] Why do I get an "unvalid syntax" on the print line for number1

2013-04-23 Thread Prasad, Ramit
Pat Collins wrote: > Any help appreciated. > > > #!/usr/bin/env python > """ > number.py Demonstrates collecting a number from the user. > """ > > number_string1 = float(input("Give me a number: ")) > number1 = (number_string1) number_string1 is not a string as you have already converted it to

Re: [Tutor] Hello, and a newbie question

2013-04-19 Thread Prasad, Ramit
eryksun wrote: > On Tue, Apr 16, 2013 at 7:57 PM, Virgilio Rodriguez Jr > wrote: > > Can someone please do me the favor and remove me from this god forsaken > > email list I am sorry I signed up all it has done is taken over my phone and > > rings all night long with emails I am not interested in

Re: [Tutor] Running python from windows command prompt

2013-04-11 Thread Prasad, Ramit
On 11/04/13 07:08, Arijit Ukil wrote: > Thanks for the help. Now I have modifed the code as: > > import sys > > def main(argv): > data = int(sys.argv[1]) > avg = average (data) > print "Average:", avg > > def average(num_list): > return sum(num_list)/len(num_list) Note that in

Re: [Tutor] building a website with python

2013-04-09 Thread Prasad, Ramit
Benjamin Fishbein wrote: > > Hello. I learned Python this past year (with help from many of you) and wrote > many programs for my > small business. Now I want to build a website. I acquired the domain name > through godaddy.com > (bookchicken.com) but have not found hosting yet. > I learned html

Re: [Tutor] FYI: An Introduction to Interactive Programming in Python

2013-04-09 Thread Prasad, Ramit
Alan Gauld wrote: > > On 09/04/13 13:47, Steven D'Aprano wrote: > > >> Since when did 30 become a representative sample size? > > > > If they are randomly selected, 30 is likely plenty for a representative > > sample size. In surveys, a sample size of 30 gives you a margin of error > > of about 1

Re: [Tutor] Building Python 2.7.3 on RHEL 5.8 x86_64 -- Syntax Error

2013-03-26 Thread Prasad, Ramit
Sean Carolan wrote: > [Alan Gauld wrote:] > > Given that most folks on this list are only learning Python its pretty > > unlikely that they are building > > bespoke RPMs... > > > > You might find more experience of RPM building on the general Python > > mailing list/newsgroup. > > Sorry 'bout t

Re: [Tutor] File-Fetcher (cmdline-parser)

2013-03-15 Thread Prasad, Ramit
Christopher Emery wrote: > Hello Peter, > > Thank you this is much appreciated! It is much clear now. Thank you > > PO: Also, if you make it a habit to keep long option and dest in sync > (something you get for free if you only specify the option) you can > deduce the attribute name used in the

Re: [Tutor] Passing a config file to Python

2013-03-14 Thread Prasad, Ramit
Irina I > Hi all, > > I'm new to Python and am trying to pass a config file to my Python script. > The config file is so > simple and has only two URLs. > > The code should takes that configuration file as input and generates a single > file in HTML format as > output. > > The program must ret

Re: [Tutor] Text Processing Query

2013-03-14 Thread Prasad, Ramit
Spyros Charonis wrote: > Hello Pythoners, > > I am trying to extract certain fields from a file that whose text looks like > this: > > COMPND   2 MOLECULE: POTASSIUM CHANNEL SUBFAMILY K MEMBER 4; > COMPND   3 CHAIN: A, B; > > COMPND  10 MOL_ID: 2; > COMPND  11 MOLECULE: ANTIBODY FAB FRAGMENT LI

Re: [Tutor] python on ipad

2013-03-13 Thread Prasad, Ramit
James Griffin wrote: > [- Sun 10.Mar'13 at 16:42:59 -0500 Benjamin Fishbein :-] > > > Hello. I wrote some python programs for my small business that I run on my > > computer...macbook air. > I'm planning to backpack around Mexico and perhaps south america. I'll still > be workin

Re: [Tutor] Reversed dictionary returned by default

2013-03-01 Thread Prasad, Ramit
Dave Angel wrote: > On 03/01/2013 02:48 PM, Huperetes wrote: > > I am getting the following for my installation. > > > > Why is this happening, and how do I get it to work properly (returning > > element 0 - n, versus n - 0)? > > > > Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit

Re: [Tutor] confusing installation

2013-03-01 Thread Prasad, Ramit
Lolo Lolo wrote: > >Welcome to the world of software development. GUIs like Windows are great > >for doing simple things but > they can't compete with >command line tools for doing powerful things > quickly. So pretty much every > programmer has to get used to using the command line >sooner or la

Re: [Tutor] object attribute validation

2013-02-25 Thread Prasad, Ramit
neubyr wrote: > Thank you for your comments Steven. > > Yes, I think I should remove property deleter in this case. > > I would like to use this Person class in another class. For example, if > Person class is 'model' in a > small MVC-style web application, then where should I place my validatio

Re: [Tutor] How to break long lines?

2013-02-22 Thread Prasad, Ramit
Jim Byrnes wrote: > I am cleaning up my code and have a number of sqlite3 execute statements > that extend far past 80 characters. > > From my reading implicit line joining with (), [] or {} seems to be the > preferred method, but > > cur.execute('SELECT Account FROM pwds WHERE Category=? ORDER

Re: [Tutor] associating two objects without ORM and processing a text file

2013-02-14 Thread Prasad, Ramit
Dave Angel wrote: > On 02/14/2013 12:35 PM, Prasad, Ramit wrote: > > neubyr wrote: > >> I am not sure how to save an object in memory to a file before exiting the > >> program. Any examples or > >> related documentation links would be really helpful. I am g

Re: [Tutor] associating two objects without ORM and processing a text file

2013-02-14 Thread Prasad, Ramit
neubyr wrote: > I am not sure how to save an object in memory to a file before exiting the > program. Any examples or > related documentation links would be really helpful. I am guessing it would > be using some kind of > before teardown method, but not sure about it. Any help? Look at the pickl

Re: [Tutor] Python Lover

2013-02-13 Thread Prasad, Ramit
Brajesh wrote: > Hi , > > I have just subscribed mailing list to learn python. I am programming in > java for nearly 8 months, I have developed a strong love towards python > and want to learn and start making the best use of it. I want to know > where to from as i know JAVA already so where to st

Re: [Tutor] Additional help

2013-02-13 Thread Prasad, Ramit
Ahmet Can KEPENEK wrote: > Hello, > I used regular expression module of python. I checked binary and denary > numbers. If input is invalid i > ask again. I edited your code. Code is below follow as . > [snip] >     if re.match("^[0-1]*$", binary): >     if re.match("^[0-9]*$", denary2): [

Re: [Tutor] recursive function password check

2013-02-06 Thread Prasad, Ramit
Mara Kelly wrote: > Hi everyone, trying to write a program that has the user enter a password, > checks if it contains any vowels, and > if it does prints ' It is false that password(whatever the user enters) has > no vowels,' and if it has no vowels > prints it is True that password has no vowel

Re: [Tutor] automate add-to-cart with python

2013-01-29 Thread Prasad, Ramit
Benjamin Fishbein wrote: > >> > > > > A direct approach would probably use the webdriver API to automate the > > browser. Selenium has one: > > > I decided to use Selenium. It may be overkill for this particular problem, > but I'll want to use it for other > things. > This is my first time trying

Re: [Tutor] sqlite search

2013-01-28 Thread Prasad, Ramit
Alan Gauld wrote: > > On 18/01/13 18:11, Roger wrote: > > > At the moment this works to search for everything beginning with A > > sql = "SELECT * FROM plants WHERE genus LIKE 'A%'"; > > cursor.execute(sql); > > SQLlite supports a form of format string where you put in some magic > charactrs the

Re: [Tutor] sqlite search syntax

2013-01-18 Thread Prasad, Ramit
Roger Shaw wrote: > > Hello, > I am very new to python. > > Wrote a small program to use on my android phone using pickle/shelve to > access data. > > That worked fine but i realised it would be better to use sqlite as a > database to more easily modify the data. > > I havent got a clue about

Re: [Tutor] Json encode and decode on Puython 2.4

2013-01-16 Thread Prasad, Ramit
Steven D'Aprano wrote: > > On 17/01/13 08:50, Prasad, Ramit wrote: > > > Python 2.4 is quite old and simplejson supports 2.5+. I can see a > > yield in the encoder code, so it is unlikely to be easy to modify > > and get working with 2.4. > > Pyth

Re: [Tutor] Json encode and decode on Puython 2.4

2013-01-16 Thread Prasad, Ramit
Dotan Cohen wrote: > > Hi all, I'm just getting into porting some PHP scripts to Python. One > issue that I'm having is that the scripts need to run on a host with > Python 2.4 that has neither the json nor simplejson packages > available. I figure that I'll have to include the loads() and dumps()

Re: [Tutor] Assigning multi line value to a variable

2013-01-15 Thread Prasad, Ramit
Rohit Mediratta wrote: > > Hi, >    I am using Centos 6.3 and python 2.6.6. > > When I try to assign a variables value inside a multiple line message, it > does not work. > > >>>cardName = "ActualCardName" > >>>data = """ >     """ > >>> print data >   >     > > > I would like %car

Re: [Tutor] UnicodeWarning: Comparing String

2013-01-15 Thread Prasad, Ramit
ialec...@gmail.com wrote: > Hi, > > I am trying to check if a Unicode string matches data from an Easygui > "enterbox". I spent one hour looking > online how to solve this problem and I'm still stuck because I don't > understand all of the explanations I find. > Lots of trial and error didn't he

Re: [Tutor] unclear topic

2013-01-14 Thread Prasad, Ramit
Matthew Ngaha wrote: > hey guys, this is not really a Python question. When ever im doing a > tutorial, it could be pygame or some gui application, i usually find > everything straight forward until the demonstration involves drawing. > Then maths is applied and i can't follow along as easily. In t

Re: [Tutor] pexports python27.dll > python27.def (pygraphviz 1.1 package )

2013-01-11 Thread Prasad, Ramit
somnath chakrabarti wrote: > Actually I embedded a link to the refer site from where I have been following > the procedure. I am new to Python > too and have been following the book "Mining the Social Web" by Matthew > Russell and thought Tutor mailing list > would be the right place to post the

Re: [Tutor] pexports python27.dll > python27.def (pygraphviz 1.1 package )

2013-01-11 Thread Prasad, Ramit
somnath chakrabarti wrote: >  I have mingw and python 2.7 in a Windows 7 box and trying to install > PyGraphViz-1.1 using the following CLI > utility > > python setup.py install build --compiler=mingw32 > However, it ends up compiling error with undefined references as follows: > > ... > build\t

Re: [Tutor] run perl script files and capture results

2013-01-11 Thread Prasad, Ramit
eryksun wrote: [snip] > 1. Using a forward slash in paths is OK for DOS/Windows system calls > (e.g. opening a file or setting the cwd of a new process), dating back > to the file system calls in MS-DOS 2.0 (1983). Otherwise a backslash > is usually required (e.g. shell commands and paths in comman

Re: [Tutor] writing effective unittests

2013-01-11 Thread Prasad, Ramit
Japhy Bartlett wrote: > TDD is a good principle but usually seems a little too pedantic for real > world programming.  Where tests (in my > experience) get really useful is in making sure that a new change hasn't > unexpectedly broken something already > written. > I would argue that TDD is a p

Re: [Tutor] IronPython any tutors with experience out there?

2013-01-03 Thread Prasad, Ramit
Bjorn Madsen wrote: > > Hello PythonTutor > - I'm a scientist and very happy with python 2.7. I have been asked to assist > a development program where > everything is written in dotNET/ C# (visual studio 2012) and luckily > Microsoft Visual Studio supports IronPython > which is a clean Python i

Re: [Tutor] how to control putty window

2012-12-21 Thread Prasad, Ramit
Ufuk Eskici wrote: > Hello, > > I changed my way. This time I'm using "plink" under Putty. > > My python code is: > > os.chdir("c:\\Program Files\\Putty") > cmd = "plink -ssh -l ufuk10.10.10.10 -pw password" > process = subprocess.Popen(cmd) > inputdata="r van" > result = process.communicate(in

Re: [Tutor] invalid literal for int error in Game loop

2012-12-20 Thread Prasad, Ramit
Ciaran Mooney wrote: > Sent: Thursday, December 20, 2012 3:35 PM > To: d...@davea.name > Cc: tutor@python.org > Subject: Re: [Tutor] invalid literal for int error in Game loop > > Thanks for the feedback. > > Steve, If I set the FPS to a default of say 30, the game seems to run at this > default

Re: [Tutor] how to control putty window

2012-12-20 Thread Prasad, Ramit
Ufuk Eskici wrote: > Hello, > > I run this command and opens putty: > > import os > import subprocess > command = '"c:\Program Files\Putty\putty.exe" -ssh ufukeskici@10.10.10.10 -pw > test > subprocess.Popen(command) > > But then I want to input new commands to this Putty new window. How can I

Re: [Tutor] How can I overwrite the previous version on linux ?

2012-12-19 Thread Prasad, Ramit
Steven D'Aprano wrote: > On 19/12/12 16:52, Dae James wrote: > > My linux distribution is CentOs 6.3. And python attached to the OS is 2.6. > > How can I overwrite the previous version with python 2.7 ? Or how can I > >uninstall the previous version? > > Why? Do you like breaking your operating sy

Re: [Tutor] Image Processing

2012-12-18 Thread Prasad, Ramit
Ashkan Rahmani wrote: > > I have developed some simple c++/qt/opencv application with face > detection functionality. > for some reasons I'm going to start again them and I wan to use python 3. > Unfortunately I found opencv not supported in python 3. > 1- as I'm new in python programming, is pyth

Re: [Tutor] ssh connection

2012-12-17 Thread Prasad, Ramit
command-line > > 2012/12/17 Prasad, Ramit > > Ufuk Eskici wrote: > > > > > > Hello All, > > > > > > Can we make an SSH connection with Pyhton 3.3 ? > > > > > > I want to connecto to my router, send commands and receive outputs. &

Re: [Tutor] ssh connection

2012-12-17 Thread Prasad, Ramit
Ufuk Eskici wrote: > > Hello All, > > Can we make an SSH connection with Pyhton 3.3 ? > > I want to connecto to my router, send commands and receive outputs. > > Thanks. > Ufuk You can try to use Paramiko. You may need to build it and it seems like it may work except for SFTP. https://github

Re: [Tutor] Information

2012-12-14 Thread Prasad, Ramit
Umair Masood wrote: > > How to create a server in python using SOAP? Please also tell the ports to be > used. Kindly help me out. > > Regards, > Umair The 4th link looks good: http://lmgtfy.com/?q=How+to+create+a+server+in+python+using+SOAP%3F+# First link: http://lmgtfy.com/?q=What+ports+are+

Re: [Tutor] First semester no coding experince, please help!

2012-12-14 Thread Prasad, Ramit
Mark Rourke wrote: > Sent: Monday, December 03, 2012 9:24 AM > To: tutor@python.org > Subject: [Tutor] First semester no coding experince, please help! > > Hello, the following attachment  (no virus I swear!)is an assignment I have > for my programming class, I am > having alot of difficulty comp

Re: [Tutor] Which version of activetcl to use for Mac OS X 10.7?

2012-12-14 Thread Prasad, Ramit
Yi Molina wrote: > > Hi, all. I am new to python and just installed Python 2.7.3 on my Mac OS X > 10.7.5 from python.org. I read that I > am supposed to use  ActiveTcl 8.5.11.1. So I clicked on the link on but found > only ActiveTcl8.5.11.1.295590- > macosx10.5-i386-x86_64-threaded.dmg, Which is

Re: [Tutor] Tutor Digest, Vol 106, Issue 5

2012-12-05 Thread Prasad, Ramit
Steven D'Aprano wrote: > > On Mon, Dec 03, 2012 at 05:56:30PM -0600, Luke Paireepinart wrote: > > > I just wanted to make the observation that, at least in gmail, the default > > behavior is to hide the entire quoted text behind an innocuous "..." > > button. > > Good lord, the more I hear about

Re: [Tutor] Beginner's question

2012-11-22 Thread Prasad, Ramit
Peter O'Doherty wrote: > > Hi list, > Firstly, apologies for the low-level nature of this question - it's > really quite basic but I don't seem to be able to solve it. > > I need to write a program that examines 3 variables x, y, z, and prints > the largest odd number. I've tried all sorts of vari

Re: [Tutor] pyXML i Python2.6

2012-11-20 Thread Prasad, Ramit
Sreenivasulu wrote: > > Hi, > > Am unable to install pyXML in Ubuntu usig python2.6 > > Could you please help me > > Regards, > Sreenu Since you do not provide a link I am guessing you are referring to the very outdated package. You use the ElementTree class or the reputed third party module

Re: [Tutor] memoize, lookup, or KIS?

2012-11-19 Thread Prasad, Ramit
Albert-Jan Roskam wrote: > [snip] > > Also, you should have some way to stop the lookup table from growing > > forever. > > If you are running Python 3.3, you can use functools.lru_cache, which > > implements a Least Recently Used cache. Once the cache reaches a certain > > size, > > the element

Re: [Tutor] sending email via smtplib

2012-11-19 Thread Prasad, Ramit
Saad Javed wrote: > > I don't think using SSL works with hotmail. I tried using: > > smtplib.SMTP_SSL("smtp.live.com", 587) You need to use port 25 not 587. http://windows.microsoft.com/en-US/hotmail/send-receive-email-from-mail-client > smtplib.login(user, passwd) > ... > > That gave this er

Re: [Tutor] Help with class example

2012-11-06 Thread Prasad, Ramit
Ramit Prasad wrote: > You would be better off trying to run this from the command > line. I just wanted to clarify on this. The reason you will have a better results running this from the command line is that Python will normally give you very good error traceback. An IDE might hide or obscure t

Re: [Tutor] why different result from two similar ways

2012-11-06 Thread Prasad, Ramit
Steven D'Aprano wrote: > On 30/10/12 12:36, Frank Pontius wrote: > > Hello, > > I have code that works. Then tried to move some of it into function > > IncrementAndRebuildInput, then result changes, I no longer have same result > > as when code in function was inline - why? > > Have you tried run

Re: [Tutor] Help with class example

2012-11-05 Thread Prasad, Ramit
Frank Pontius wrote: > Sent: Saturday, October 27, 2012 12:27 PM > To: d...@davea.name; bgai...@gmail.com > Cc: tutor@python.org > Subject: Re: [Tutor] Help with class example > > Here ya go! > Can't do what you want as this is a programmatic error from interrupter.  > Only a screen shot will tel

Re: [Tutor] Obtaining result from a sendline

2012-10-31 Thread Prasad, Ramit
Dave Wilder wrote: > Okay, file this under RTFM, but even after research, I cannot figure out the > answer to this simple question. > > When I do an ssh in python (version 2.7.3) to a device, I am trying to > capture the output of the command. > However, all I get back is a numerical value.  I a

Re: [Tutor] running multiple concurrent processes

2012-10-30 Thread Prasad, Ramit
richard kappler wrote: > As I sit through the aftermath of Sandy, I have resumed my personal quest to > learn python. One of the things I > am struggling with is running multiple processes. I read the docs on > threading and am completely lost so am > turning to the most excellent tutors here (an

Re: [Tutor] Help Passing Variables

2012-10-29 Thread Prasad, Ramit
David Hutto wrote: > #A little more complex in terms of params: > > def SwapCaseAndCenter(*kwargs): > > if upper_or_lower == "upper": > print a_string.center(center_num).upper() > > if upper_or_lower == "lower": > print a_string.center(center_num).lower()

  1   2   3   4   >