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
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
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.
>>> 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.
>>>
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
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
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
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
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
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
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
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
* 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
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
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
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
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", "
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
ss.GetEmailAddresses()
- Patrick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
'__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
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
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'
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
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
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
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
_
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
#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
, 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
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
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
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
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
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
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
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'
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
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
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
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
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
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
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
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
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
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
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"
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
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
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:
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
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:
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
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
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
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
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
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.
>>
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.
>>
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
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
(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
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
>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.
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
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
etter than the other.
Thanks in advance.
Patrick
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
> 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
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
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
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
71 matches
Mail list logo