On 20/08/13 03:02, Leam Hall wrote:
https://class.coursera.org/programming1-002/class/index
Leam
Leam, your link for some reason redirects on a default coursera page,
probably cause I'm not enlisted.
I think a better link for the course would be
https://www.coursera.org/course/programming1
On 05/14/2011 03:49 AM, ian douglas wrote:
for i in giant_list:
if i[0]:
if i[1]:
mc.set(i[0], i[1])
Until Alan comes with a more round answer, I'd suggest something along
the
On 09/01/2010 11:17 AM, Alan Gauld wrote:
Ranjith Kumar ranjitht...@gmail.com wrote
I`m using ubuntu how to find and print the installed web browsers
using
python scripting.
How would you do it without Python scripting?
Is it even possible?
And on a multiuser system like Linux would
On 09/01/2010 11:46 AM, Nick Raptis wrote:
Alan, let me make a wild guess here.
Ubuntu does have little Preferred applications config tool. I don't
know how or where it stores this data, but my guess is it's the same
place xdg (as in xdg-open) gets it's configuration from. This article
On 08/22/2010 09:35 PM, Roelof Wobben wrote:
Hello,
I made this programm :
def count_letters(n,a):
count = 0
for char in n:
if char == a:
count += 1
return count
fruit=
letter=
fruit= input(Enter a sort of fruit: )
teller = input(Enter the character which must
On 08/22/2010 09:35 PM, Roelof Wobben wrote:
Hello,
I made this programm :
def count_letters(n,a):
count = 0
for char in n:
if char == a:
count += 1
return count
fruit=
letter=
fruit= input(Enter a sort of fruit: )
teller = input(Enter the character which must
Please try and reply to the list instead of just me.
raw_input did not the trick.
fruit.count is the next exercise.
Oke, I deleted the initialazion and change teller into letter.
Roelof
Should be alright now.. Hmmm
Can you paste your exact code AND the error you're getting? As I
On 07/28/2010 02:51 PM, Richard D. Moores wrote:
I have a practical need for a script that will give me a random int in
the closed interval [n, m]. Please see
http://tutoree7.pastebin.com/xeCjE7bV.
This works fine when I enter both n and m as, for example, 23, 56,
or even 56, 23. But often
On 07/28/2010 03:41 PM, Rod wrote:
Hello,
I need to replace a period (.) in a domain name with a slash period (\.).
I'm attempting to use the string replace method to do this.
Example:
uri = domain.com
uri.replace('.', '\.')
This returns 'domain\\.com'
Of course it does! Try to print
On 07/27/2010 04:48 PM, Evert Rol wrote:
On the other hand, if you want to combine lists based on their first element,
consider using dictionaries and extend lists which have the same key. Depending
on how you create the lists (eg, when reading columns from a file), you can
actually do this
On 07/27/2010 05:22 PM, Richard D. Moores wrote:
Python 3.1 on Vista.
Please see http://tutoree7.pastebin.com/f3TaxDBc.
I'm trying to recall what I used to know, thus this simple script. But
'y' or 'q' do nothing. What's wrong?
Thanks,
Dick Moores
Hi Dick!
I'm not on Windows here so
On 07/28/2010 01:20 AM, ZUXOXUS wrote:
Hi all pythoners
I've got a probably easy to answer question.
Say I've got a collections of strings, e.g.: 'man', 'bat', 'super',
'ultra'.
They are in a list, or in a sequence or whatever, say a bag of words
And now I want to know how many couples I
On 07/14/2010 11:57 PM, Eric Hamiter wrote:
Last question (for today, at least): Right now, the output is less
than aesthetically pleasing:
(['Located on aisle 1: ', 'bread', 'magazines'], ['Located on aisle 2:
', 'juice', 'ice cream'], ['Located on aisle 3: ', 'asparagus'], ['Not
found in the
compile(source, filename, mode[, flags[, dont_inherit]])
I see within this built in function, the first argument can be what
they define as source, the second argument as the filename and the
third as the mode.
But what confuses me is sometimes I see a bracket, above as [, flags[,
On 07/11/2010 04:59 PM, Dominik Danter wrote:
Hello
As en exercise I wrote the following function:
def recursfac(x,carryover=1):
print 'x:',x,'carryover:', carryover
if x 1:
carryover *= x
recursfac(x-1, carryover)
else:
return carryover
print
On 07/11/2010 06:28 PM, Nick Raptis wrote:
def recursfac(x,carryover=1):
print 'x:',x,'carryover:', carryover
if x 1:
carryover *= x
carryover = recursfac(x-1, carryover)
return carryover
And this returns
x: 3 carryover: 1
x: 2 carryover: 3
x: 1 carryover: 6
6
On 07/11/2010 06:50 PM, Luke Paireepinart wrote:
I think the new version is harder to understand.
Sent from my iPhone
On Jul 11, 2010, at 10:43 AM, Nick Raptisairsc...@otenet.gr wrote:
Aww! A critic! You humble me (really, I'm not being sarcastic here, I
welcome it gladly)
I won't argue
Thanks a lot for the mails all of you.
Someone commented that wxpython occassionally shows it C/C++ roots. Will
that haunt me cos' I have zero knowledge of C/C++.
That would be me, sorry about that, didn't mean to confuse you further.
Well, think it this way, if you have zero knowledge of
There actually aren't that many books on django around yet which is a pity.
You should definitely read The django book:
http://www.djangobook.com/en/2.0/
either on the online version on that link, or it's printed counterpart
(yes, it's really the same book):
subprocess.Popen is a class, and as such it returns an object which can
do a lot of stuff besides just reading the output.
What you want to do here is using it's communicate() method as such:
output, errors = ping.communicate()
Also, there is a quicker way, I think from version 2.7 forward:
, you're such a helpful bunch.
Nick
On 07/07/2010 10:16 AM, Alan Gauld wrote:
Nick Raptis airsc...@otenet.gr wrote
Really good news is that on this very list on another thread, someone
suggested Dabo http://dabodev.com/
It's a python library on top of wxPython and it's database-logic-GUI
But its
Actually, for simple file operations I'd neither.
Standard file usage is described here, if you haven't checked it out,
which I'm sure you have
http://docs.python.org/library/stdtypes.html#file-objects
StringIO is useful as a buffer. That is, you make a file-like object in
memory with
Please excuse if I'm jumping on the topic. Haven't done any GUI work so
this interests me too.
wxPython always seemed a great choice as it works on all platforms, and
uses GTK+ for linux.
Well, what mainly bugs me about wxPython is that most of it's API names
come from the wx C library, you
Dave Angel wrote:
However, if someone had tried to do that in a single call to the
current function, their code would already be broken because the
dictionary doesn't preserve order, so the substitution might not
happen first.
Wow, I never thought about the dictionary not being sorted
Your main concern when displaying plain text in HTML is actually only 5
characters:
, , , , '
which you should escape(replace) with their coresponding HTML entities.
Here's a few lines of code to give you an idea how to do it:
#put this
Dave Angel wrote:
As I said, you'd probably get in trouble if any of the lines had ''
or '' characters in them. The following function from the standard
library can be used to escape the line directly, or of course you
could use the function Nick supplied.
xml.sax.saxutils.escape(/data/[,
pedro wrote:
#!/usr/bin/env python
# encoding: utf-8
import sys
theFilePath = sys.argv[1]
print theFilePath
But when I try to drop something on it nothing happens. Sorry I guess
there is something fundamental that I am missing.
Pete
Pedro, I'll reply to this message instead of the last
specific rather than python/script specific.
That turns the question it to a whole new direction for me.
Nick
Nick Raptis wrote:
pedro wrote:
#!/usr/bin/env python
# encoding: utf-8
import sys
theFilePath = sys.argv[1]
print theFilePath
But when I try to drop something on it nothing
I don't think there's a Python command to do this.
You can always print enough newlines to clear your view of the window:
print \n * 80
or use os.system to issue a command the shell/terminal/cmd will understand
import os
os.system(cls)
or
import os
os.system(clear)
I resently made a 'game
29 matches
Mail list logo