[Tutor] Newbie question: programs not printing

2016-03-10 Thread Patrick Craine
Hey guys, I¹m at the very beginning of learning programming. I started using Khan Academy and now am watching the intro course on MIT OpenCourseWare. I downloaded Python 2.7.11 but for some reason it seems that it's not responding the way it¹s supposed to. I haven¹t been able to figure out the pr

Re: [Tutor] responding to command line

2015-11-25 Thread Patrick Hess
ere looks like a good starting point: https://github.com/pexpect/pexpect/blob/master/examples/passmass.py I, unfortunately, have to deal with Windows from time to time, so it's still Tcl for me... Patrick ___ Tutor maillist - Tutor@python.org

Re: [Tutor] responding to command line

2015-11-25 Thread Patrick Hess
handle this kind of task will make life so much easier that it even justifies the use of Tcl. ;-) Patrick [1] http://expect.sourceforge.net ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.

Re: [Tutor] List comprehensions to search a list--amazing!

2015-03-19 Thread Patrick Thunstrom
>>> The generalized problem: >>> >>> L = [V0, V1, ..., Vn], where V0 >= V1 >= V2 >= ... >= Vn . >>> Find index i, such that V[i] >= Vt >= V[i + 1], where Vt is the test >>> value being searched for. I need to know the indices i and i + 1, >>> which I need to interpolate based on where Vt falls. >>>

Re: [Tutor] Python for linux

2015-01-27 Thread Patrick Thunstrom
of a file: Look into the os module. Checking for substrings: This is has many answers. Have you tried to do this yet? Patrick On Tue, Jan 27, 2015 at 11:50 AM, Reuben wrote: > Hello, > > I wish to know which python module works well with Linux commands - for > e.g. Searching

Re: [Tutor] Class errors

2015-01-23 Thread Patrick Thunstrom
If the code I'm seeing is correct, the problem is the class is Jobs, and you instantiated a Job, which doesn't exit. Replace one with the other in either case should fix it. On Thu, Jan 22, 2015 at 11:11 AM, jarod...@libero.it wrote: > Dear All, > > I created a class that invoke from another fi

Re: [Tutor] Python advice about API, JSON

2014-09-29 Thread Patrick Thunstrom
On Mon, Sep 22, 2014 at 4:01 PM, Juan Christian wrote: > I'm trying to make my script the more pythonic possible. How would a good > approach regarding external API and json be? I don't think dealing with a specific API is actually appropriate for this list. I'll try to answer the general element

Re: [Tutor] debug and execute python code in Mac

2014-08-27 Thread Patrick Thunstrom
On Wed, Aug 27, 2014 at 7:14 AM, Najam Qasim wrote: > What is preferable method to debug and execute python code in Mac? > > I do not like the cmd/terminal execution. Thanks ! > > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change sub

[Tutor] Hi, First question

2013-06-16 Thread Patrick Williams
Hi so I am making a bit of code to extract a bit of numbers data from a file and then find the average of that data, however while I can get the code to extract each specific piece of data I need, I can't seem to get the numbers to add separately so I can get a proper average. My sum1 variable see

[Tutor] Reusing Timers (threading.timer)

2012-11-13 Thread Patrick Dickey
get updateFrequency start timer with new time value from updateFrequency The autoUpdates and updateFrequency are a checkbox and text box in wxPython. Thanks for any advice on this, and have a great day.:) Patrick. ___ Tutor maillist - Tutor@pytho

Re: [Tutor] (no subject)

2012-02-08 Thread Patrick Dempster
On 07/02/2012 19:07, Hugo Arts wrote: > On Tue, Feb 7, 2012 at 7:50 PM, Debashish Saha wrote: >> for i in range(1, 8): >>print(i) >>if i==3: >>break >> else: >>print('The for loop is over') >> >> >> Output: >> 1 >> 2 >> 3 >> >> Question:but after breaking the for loop why the

[Tutor] Installing Modules

2012-01-18 Thread Downey, Patrick
Hello, I'll start by saying that I have a math/stats background, not a computer science one. I've found lots of great material to help with Python programming, but have had a much harder time getting my head around setup issues, like installing modules. I'm currently running Python version 2.7 th

Re: [Tutor] Python program with multiple answers

2011-05-11 Thread Patrick Sabin
* Create a list. * Each time, the user gets an answer add it to the list * At the end of the program: sort the list and print each element of it - Patrick On 2011-05-11 12:49, Johnson Tran wrote: Hi Guys, I've been working on a Python program where I create an 8 ball that will allow

Re: [Tutor] Nodes and Queues?

2011-05-11 Thread Patrick Sabin
which have child objects. -- Patrick On 2011-05-11 13:44, Clara Mintz wrote: Hi all I am sorry I am a beginner at python and I was reading my book and I came across the terms Nodes and Queue. I am sorry but I don't quite understand how they work. Is there anyone who could possibly ex

[Tutor] Need help with arrays

2011-05-04 Thread Patrick P .
ot aligned - I get it why theres and error message, because it's trying to multiply a 2x2x100 array with another 2x2x100 array and doesn't know how to do that. What I actually want is 100 2x2 arrays and then mutliply them individually. Can anyone help me with that? Thanks a

Re: [Tutor] GUI + python program

2011-02-14 Thread Patrick Sabin
to it, but it probably gets messy. I would recommend using a database. Sqlite is maybe a good choice, or sqlalchemy. - Patrick On 2011-02-14 20:55, Mitch Seymour wrote: Hello, I am trying to design a program and GUI that will allow the user to select from a series of options and, depending on

Re: [Tutor] scraping and saving in file

2010-12-30 Thread Patrick Sabin
On 2010-12-29 10:54, Tommy Kaas wrote: It works fine but besides # I also get spaces between the columns in the text file. How do I avoid that? You could use the new print-function and the sep keyword argument, e.g.: from __future__ import print_function f = open("filename", "w") print("1", "

Re: [Tutor] Sequences of letter

2010-04-11 Thread Patrick Sabin
tra2+1 letra1=letra1+1 It goes all the way to aaz and then it gives me this error Traceback (most recent call last): File "/home/administrador/programacion/python/letras2.py", line 8, in print letras[letra1]+letras[letra2]+letras[letra3] IndexError: list index out of range You sh

Re: [Tutor] Declaring methods in modules.

2010-04-11 Thread Patrick Sabin
ss.GetEmailAddresses() - Patrick ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Resetting the namespace

2010-03-08 Thread Patrick Sabin
'__builtins__' is not defined But for some reason the code mentioned above actually works in the case of pdb. Any ideas why? - Patrick ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Encoding

2010-03-03 Thread Patrick Sabin
27;t know the encoding, right? It depends on browser. Right, but you can do something about it. Tell the browser, which encoding you are going to accept: ... - Patrick ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Encoding

2010-03-03 Thread Patrick Sabin
on doesn't exist. Python3 solves this by using unicode strings by default. Patrick, ok. I should check if it's possible to save unicode strings in the DB. It is more an issue of your database adapter, than of your database. Do you think i'd better set my db to utf8? I don'

Re: [Tutor] Encoding

2010-03-03 Thread Patrick Sabin
you can simply call: s.decode('latin1') to get the unicode string. thankyou Giorgio Patrick ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Unexpected iterator

2009-11-12 Thread Patrick Sabin
or create your own class class X: def __iter__(self): yield 0 yield 0 a,b = X() - Patrick ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] class Knights vs class Knights(object)

2009-11-07 Thread Patrick Sabin
uiltin type-function. Beware that this is python 2 stuff. In python 3 class X: and class X(object): are the same. - Patrick ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Moving a Shelf Between Linux and Mac OS X

2009-10-24 Thread Patrick Kenny
in open mod = __import__(result) ImportError: No module named bsddb185 Are shelves portable between different OSs? I would like to make the data created on the shelf on the Mac also accessible on Linux; is there an easy way to do this? Cheers, Patrick _

Re: [Tutor] What language should I learn after Python?

2009-10-07 Thread Patrick
print and I am trying to learn metamodeling concepts. If you can spell really well and your grammar is perfect you still might not be able to write a novel. Just learning a programming language is not enough. Hope this helps, I have certainly received more then my share of help from thi

Re: [Tutor] help with alternate execution

2009-10-02 Thread Patrick Sabin
#x27;t any formating symbols in it, it fails. To fix your program, convert the n to int: divisible(int(n)) - Patrick ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] code improvement

2009-09-29 Thread Patrick Sabin
, e.g. cmps = [ressource.get_resource(item, soft=True) for item in companies] - Patrick Norman Khine wrote: On Thu, Sep 24, 2009 at 10:25 PM, Kent Johnson wrote: On Thu, Sep 24, 2009 at 2:12 PM, Norman Khine wrote: Hello, I have this function in my class: http://paste.lisp.org/display/87659

Re: [Tutor] real world decorators

2009-09-21 Thread Patrick Sabin
don't have a good reason to do otherwise. Every decorator adds some sort of "magic" to your program and using too much "magic" will make it difficult to maintain. - Patrick ___ Tutor maillist - Tutor@python.org To unsubscribe or chan

Re: [Tutor] Using the time module to extract a semi-random number

2009-09-17 Thread Patrick Sabin
ndom.randint(0,59) The latter looks clearer to me. - Patrick ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Fwd: Executing a command from a specific directory

2009-09-16 Thread Patrick Sabin
os import subprocess os.chdir('/your/directory') p = subprocess.Popen("ls -l", shell=True, stdout=subprocess.PIPE) out = p.stdout.read() print out - Patrick ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscr

Re: [Tutor] Image manipluation (On-the-fly thumbnail creation)

2009-09-15 Thread Patrick Sabin
I wouldn't use them. Using PIL is another option and maybe more pythonic, but if you are familiar with ImageMagick it might be a good alternative. - Patrick ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscriptio

Re: [Tutor] Sorting 2-d data

2009-09-13 Thread Patrick Sabin
x[0])([1,1])<(lambda x:x[0])([1,2]) False >>> (lambda x: x[0])([1,1])==(lambda x:x[0])([1,2]) True This is because now only the first item of the list is compared. - Patrick ___ Tutor maillist - Tutor@python.org To unsubscribe or chang

Re: [Tutor] include remote module

2009-09-12 Thread Patrick
Hey Patrick What I great idea. I did not even know about the compile function. Maybe this idea could really work. Imagine if I gave a client a live Linux CD that automatically called this sort of script right after boot up. They could have the absolute most current version of an application from

Re: [Tutor] include remote module

2009-09-12 Thread Patrick Sabin
This way you could execute some code from a web client, but the client would be able to execute any code, he could even delete your hard drive. - Patrick Patrick schrieb: Hi Wayne Thanks for your help. I was thinking of the latter but now that I think of it, once you import a module it won'

Re: [Tutor] include remote module

2009-09-12 Thread Patrick
Hi Wayne Thanks for your help. I was thinking of the latter but now that I think of it, once you import a module it won't help to modify that module on the fly later anyways, right? I would need to re-import it. Sounds like reading it via http would be simpler. Thanks again-Patrick Wayne

[Tutor] include remote module

2009-09-12 Thread Patrick
Strange question. Is it possible to include a module that is on another computer? I have been day-dreaming about a project that would allow web code to drive a desktop App. Thanks in advance-Patrick ___ Tutor maillist - Tutor@python.org To

Re: [Tutor] pygtk

2009-09-08 Thread Patrick Sabin
The official docs http://www.pygtk.org/pygtk2tutorial/index.html http://library.gnome.org/devel/pygtk/stable/ worked for me. - Patrick Ajith Gopinath schrieb: I will appreciate , if somebody guides me to a proper doc. on pygtk for 2.5/2.6. I am currently unable to find a good doc for the

[Tutor] way of dictating leading zeros

2009-03-15 Thread Patrick
e 001.svg, 002.svg, 003.svg. At the moment I think 12.svg is ending up before 2.svg because it starts with 1. Is there an easy way to dictate how many digits a number will occupy that also allows for leading zeros? Below is a sample of my code if it helps: Thanks in advance-Patrick def thingc

[Tutor] parallel port help

2009-02-06 Thread Patrick
you have any other advice? Is there someway to control individual data lines from bash? Thanks in advance-Patrick ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] what does the "@" operator mean?

2008-12-16 Thread Patrick Mullen
On Mon, Dec 15, 2008 at 5:03 PM, Alan Gauld wrote: > > "Marc Tompkins" wrote > >> If you're just starting out in Python, decorators can be hard to get >> your head around... > > I've been using Python for oover 10 years and still find decorators > hard to get my head around! :-) > > I confess I'm

Re: [Tutor] Web programming advice

2008-09-19 Thread Patrick
Sorry to create another post and fill up everyones mailboxes but I forgot something important... In terms of searching for documentation I believe you should look to the framework of your choice. There is not that much non-cgi related programming documentation out there-patrick Alan Gauld

Re: [Tutor] Web programming advice

2008-09-19 Thread Patrick
e time. Choosing a language or a framework is in a sense a business decision. I don't think that the Python framework world has stabilized just yet, I am personally confused about what to do, so remember it is the blind leading the blind here but I urge you to consider something that decou

Re: [Tutor] Web programming advice

2008-09-19 Thread Patrick
e but if you have any further questions please ask, I really want to help-Patrick According to this article: http://www.djangoproject.com/weblog/2008/sep/03/1/ over 350K lines of code dorje tarap wrote: Hi All, I would really like to learn about using python for creating a website from scratc

[Tutor] Shell scripting

2008-09-17 Thread Patrick
into the program. Here is a silly pseudo code example: bash command | some-python-script.py | some.other-script.sh thanks in advance-Patrick ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] PySQLite vs SQLalchemy

2008-09-13 Thread Patrick
Thanks Alan, Jeff and John! I am have been so impressed with the responses and response times I get from this list. I wish I could compensate you for your time(I'm broke at the moment), you just can't buy this "customer service" anywhere else. Hopefully when I am further along I can "man the fort"

[Tutor] PySQLite vs SQLalchemy

2008-09-12 Thread Patrick
on. We can build Python with SQLite built right in, why is there not more documentation? Thanks in advance-Patrick ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] importing strings

2008-09-11 Thread Patrick
7;t seem to figure out how to do it so that I can insert a value into the %s placeholder afterwards. I can send over more code if this is an incomplete description. Thanks in advance-Patrick ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] My experience on web.py / CherryPy

2008-08-04 Thread Patrick
views portion. "IT SEEMED" I am not qualified to give advice on Django, sorry if I ticked off anyone! Anyone here using CherryPy? Did anyone consider it and then pass on it? -Patrick Kent Johnson wrote: On Mon, Aug 4, 2008 at 2:22 PM, Patrick <[EMAIL PROTECTED]> wrote:

Re: [Tutor] My experience on web.py / CherryPy

2008-08-04 Thread Patrick
and you can set up Turbogears, Django, CherryPy etc with a click of a button. I would love to keep this thread going, please feedback as you move along, I feedback too -patrick ammar azif wrote: Hi, I am writing this to tell my experience on web.py. Two weeks ago, I was looking for a

Re: [Tutor] Firstrade Authentication ...

2008-08-03 Thread Patrick
Kent Johnson wrote: [snip] params = dict(username='janezfedero', password='kmet500', destination='') I hope this is a fake username & password Regards, Patrick ___ Tutor maillist - Tutor@python.org http:

Re: [Tutor] graphs & diagrams in python

2008-07-04 Thread Patrick
Hey Monika How about Matplotlib AKA Pylab? http://matplotlib.sourceforge.net/ -Patrick Monika Jisswel wrote: Hi Again, What is the best library for drawing graphs & diagrams to ilustrate some statis

Re: [Tutor] python web documentation ( without frameworks?)

2008-06-25 Thread Patrick
t get without a framework? If so why is this? Is a framework not just a collection of off the shelf technologies bundled into a slick package? Can I not access the same features without a framework? Am I the only one who wants an end-to-end understanding of my web app? Am I crazy? I am feel

[Tutor] python web documentation ( without frameworks?)

2008-06-24 Thread Patrick
d for general python web programming? Most of the general web programming books seem to be from 2004 or before. Thanks-Patrick ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] fibonacci.py task ???

2008-06-24 Thread John Patrick Gerdeman
Fibonacci.py calculates the Fibonacci numbers (the sum of the two previous numbers), also see http://en.wikipedia.org/wiki/Fibonacci_number Files that end in .py are python files. Much like .txt are text files and .odc is OpenOffice Calc file. Though you can name any file as you wish, the convent

Re: [Tutor] Fw: turbo gears

2008-06-05 Thread Patrick Mullen
Yeah, I like turbogears as well. I was using cherrypy before turbogears borrowed it, and have a hard time remembering that turbogears has more than just cherrypy (pretty much just use cherrypy still, even though it's called tg). It's a bit weird with TG2 now moving to pylons - which is not cherry

Re: [Tutor] Hello and newbie question about "self"

2008-02-03 Thread Patrick Lists
Hi Alan, Alan Gauld wrote: > "Patrick" <[EMAIL PROTECTED]> wrote > >> Can anyone please point me to a document that explains "self" in >> layman's terms. > > Try the OOP topic inmy tutorial... Thanks will have a look. >>

Re: [Tutor] Hello and newbie question about "self"

2008-02-03 Thread Patrick
Hi Alan, Alan Gauld wrote: > "Patrick" <[EMAIL PROTECTED]> wrote > >> Can anyone please point me to a document that explains "self" in >> layman's terms. > > Try the OOP topic inmy tutorial... Thanks will have a look. >>

Re: [Tutor] Hello and newbie question about "self"

2008-02-03 Thread Patrick
th the inet.connect_to() function, and the object itself is > passed in explicitly as self? Aaah starting to understand now. > That's all it is. > > Btw, make sure to always include "self". Otherwise you'll be writing a > class method and it doesn't work the same way. Thanks for the elaborate explanation! Regards, Patrick ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Hello and newbie question about "self"

2008-02-03 Thread Patrick
Hi Kent, Kent Johnson wrote: > Patrick wrote: >> Hi guru's, >> >> New to the list. I bought O'Reilly's Learning Python (3rd edition for >> 2.5) a while back. Slowly making my way through it and was pleasantly >> surprised that Python seems easier th

[Tutor] Hello and newbie question about "self"

2008-02-03 Thread Patrick
(C2, C3): def setname(self, who) self.name = who class C1(C2, C3): def __init__(self, who) self.name = who Thanks for any pointers! Regards, Patrick ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Tkinter ... deactivating a Text window when a radiobutton is chosen

2006-12-14 Thread Patrick Lorenz
I'd appreciate some help. I am just learning Tkinter, and want to deactivate a Text window when a certain radiobutton is selected. I cannot figure it out. I believe I need to reset the state option of the Text window to be 'disabled', but I'm not able to find a way to do it, even though I h

Re: [Tutor] Reference a variable from a string whose value is the name of the variable

2006-06-06 Thread Patrick Wheeler
>data = [ ]>for i in xrange(1,101):> data = "" %i  _n, f %i_v)) The function locals() will return a dictionary of variables in the current scope.  This can then be used to reference variables by name. x=1 xname = 'x' print locals()['x'] print locals()[xname] This prints: 1 1 or for your example.

[Tutor] removal

2005-10-22 Thread Patrick Nagle
please remove me from your tutor mailing list. Cheers -- Patrick J. Nagle _ Pocket Rocket FX ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Small GUI toolkit and executable creators

2005-02-04 Thread Patrick Kirk
That looks fine size wise. Thanks. Ismael Garrido wrote: Patrick Kirk wrote: Hi all, I'm writing an application that will distributed by download and want it to be as small as possible. The target platform is Windows. Use UPX, 7Z and NSIS. ;-) (and in that order, too :-P) That's w

[Tutor] Small GUI toolkit and executable creators

2005-02-04 Thread Patrick Kirk
etter than the other. Thanks in advance. Patrick ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Re: Are you allowed to shoot camels? [kinda OT]

2005-02-03 Thread Patrick Hall
> Beware! Overcome the temptation! > Try this: http://kodos.sourceforge.net/ While I have no problem personally with Perl or PHP, I'll second the recommendation for kodos -- it's very useful for learning to use regexes in Python. ___ Tutor maillist - T

Re: [Tutor] How to create a key-value pairs with alternative elements in a list ... please help.

2005-01-16 Thread Patrick Hall
Hi! >>> while True: > ... try: > ... d[slice0.next()] = slice1.next() > ... except: StopIteration > ... break > ... ### while True: try: d[s0.next()] = s1.next() except StopIteration: # wherein we point out a wayward colon break ### Took me a while to figure out

Re: [Tutor] simple list query

2005-01-02 Thread Patrick Hall
Hi Dave, > I have a list consisting of about 250 items, I need to know if a > particular item is in the list. I know this is better suited to a > dictionary but thats not the way it ended up ;-) > I could do a for loop to scan the list & compare each one, but I have a > suspission that there is

[Tutor] Non-escaped utf-8 rendering in the interactive shell under XP?

2004-12-13 Thread Patrick Hall
y flavor of Emacs or vim. After all, they want to learn Python because it's friendly, and those editors are great, but they're not friendly. Am I missing any options or misunderstanding any of these IDEs? Thanks kindly, Patrick ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor