> I'm new to python and inexperienced in programming but I'm trying hard.
> I have a shell script that I'm converting over to python.
> Part of the script replaces some lines of text.
> I can do this in python, and get the output I want, but so far only using sed.
> Here's an example script:
>
> i
On 11/10/2010 19.23, Alan Gauld wrote:
...
HTH,
Sure it did! Very enlightening, Alan. THANK YOU!
Nessun virus nel messaggio in uscita.
Controllato da AVG - www.avg.com
Versione: 9.0.862 / Database dei virus: 271.1.1/3190 - Data di rilascio:
10/11/10 08:34:00
___
When calling a sqlite3 db file in python 2.6 on Ubuntu, I get the
following when the items are taken from the db tuple, lstripped('u'),
and added to a list.
['.hjvkjgfkj/bdgfkjbg', 'uuz', 'jgkgyckghc',
'kfhhv ', 'khfhf', 'test', 'test10', 'test2', 'test3', 'test346w43',
'test4'
On 10/12/2010 7:41 AM, David Hutto wrote:
When calling a sqlite3 db file
Calling? How did you do that? I presume a sql select statement. True?
If so please post the statement.
Else what do you mean by call?
in python 2.6 on Ubuntu, I get the
following when the items are taken from the db
Hoi,
I have this programm :
import urllib
import re
f =
urllib.urlopen("http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=6";)
inhoud = f.read()
f.close()
nummer = re.search('[0-9]', inhoud)
volgende = int(nummer.group())
teller = 1
while teller <= 3 :
url = "http://www.py
On Tue, 12 Oct 2010 10:41:36 pm David Hutto wrote:
> When calling a sqlite3 db file in python 2.6 on Ubuntu, I get the
> following when the items are taken from the db tuple, lstripped('u'),
> and added to a list.
>
> ['.hjvkjgfkj/bdgfkjbg', 'uuz', 'jgkgyckghc',
> 'kfhhv ', 'khf
> I have this program :
>
> import urllib
> import re
> f =
> urllib.urlopen("http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=6";)
> inhoud = f.read()
> f.close()
> nummer = re.search('[0-9]', inhoud)
> volgende = int(nummer.group())
> teller = 1
> while teller <= 3 :
> url = "
On Tue, 12 Oct 2010 11:40:17 pm Roelof Wobben wrote:
> Hoi,
>
> I have this programm :
>
> import urllib
> import re
> f =
> urllib.urlopen("http://www.pythonchallenge.com/pc/def/linkedlist.php?
>nothing=6") inhoud = f.read()
> f.close()
> nummer = re.search('[0-9]', inhoud)
> volgende = int(nummer
Sorry about that, I there might have been an obvious reason.
*Note that the I invented the *.bob file before you replied.
import sqlite3 as lite
class db(object):
def onNewProjSQLDB(self):
self.con =
lite.connect('/home/david/pythonfiles/pythonscripts/roughdraftapps/datapl
No trickery, I've been adding entries at random all day(scout's honor
ii||i). But the above shows the code I used, and the first shows the
entries added at random while testing and retrieving, and it shows it
alphabetically any other time. I thought it might have to do with a
character or several i
On Tue, Oct 12, 2010 at 9:02 AM, David Hutto wrote:
> Sorry about that, I there might have been an obvious reason.
> *Note that the I invented the *.bob file before you replied.
Apparently, I am to .bob, what Al Gore is to the internet.
>
> import sqlite3 as lite
> class db(object):
> def
"David Hutto" wrote
My question is, why is everything except [:-2] in alphabetical
order?
It doesn't really matter(at this point), for my purposes, but I'd
like
to know when they changed the abc's to xy;z's?
Without seeing the SQL we can't be sure.
By default SQL does not guarantee any ord
>
> Did you include an ORDER BY?
See three posts above, line 6.
>
>
> --
> Alan Gauld
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
>
>
> ___
> Tutor maillist - tu...@python.org
> To unsubscribe or change subscription options:
>
"David Hutto" wrote
> Did you include an ORDER BY?
See three posts above, line 6.
Looks like our posts crossed in transit :-)
So you order by graphname, and you only have a single field of that
name?
But then when you put it into the list you only use part of graphname
converted
to a st
On Tue, 12 Oct 2010 11:58:03 pm Steven D'Aprano wrote:
> On Tue, 12 Oct 2010 11:40:17 pm Roelof Wobben wrote:
> > Hoi,
> >
> > I have this programm :
> >
> > import urllib
> > import re
> > f =
> > urllib.urlopen("http://www.pythonchallenge.com/pc/def/linkedlist.ph
> >p? nothing=6") inhoud = f.read
> From: st...@pearwood.info
> To: tutor@python.org
> Date: Tue, 12 Oct 2010 23:58:03 +1100
> Subject: Re: [Tutor] urllib problem
>
> On Tue, 12 Oct 2010 11:40:17 pm Roelof Wobben wrote:
>> Hoi,
>>
>> I have this programm :
>>
>> import urllib
>> import re
On Tue, Oct 12, 2010 at 10:23 AM, Alan Gauld wrote:
>
> "David Hutto" wrote
>
> > Did you include an ORDER BY?
>>
>> See three posts above, line 6.
>>
>
>
> Just a guess. You strip the letter u from your list items. Is there a
letter u in each of them? You are sorting on the item before you s
> From: st...@pearwood.info
> To: tutor@python.org
> Date: Wed, 13 Oct 2010 01:51:16 +1100
> Subject: Re: [Tutor] urllib problem
>
> On Tue, 12 Oct 2010 11:58:03 pm Steven D'Aprano wrote:
> > On Tue, 12 Oct 2010 11:40:17 pm Roelof Wobben wrote:
> > > Hoi,
Hello,
I have this code :
import urllib
import pickle
image = urllib.URLopener()
image.retrieve("http://www.pythonchallenge.com/pc/def/peak.html","banner.p"; )
plaatje = open("banner.p", "rb")
plaatje2 = pickle.load(plaatje)
But it gives this output :
Traceback (most recent call last)
Thanks Chris and Alan,
OK, I see. Now that I managed to build the dictionary, I did a print to
confirm that indeed the dictionary was created and it had the intended
contents and I was surprised to see that the order of the items in it was
totally changed. So the text file from which the dictionar
On Tue, Oct 12, 2010 at 1:52 PM, Josep M. Fontana wrote:
> Thanks Chris and Alan,
>
> OK, I see. Now that I managed to build the dictionary, I did a print to
> confirm that indeed the dictionary was created and it had the intended
> contents and I was surprised to see that the order of the items
On Tue, Oct 12, 2010 at 2:46 PM, Josep M. Fontana wrote:
>
>
> On Tue, Oct 12, 2010 at 8:37 PM, Joel Goldstick
> wrote:
>
>>
>>
>> On Tue, Oct 12, 2010 at 1:52 PM, Josep M. Fontana <
>> josep.m.font...@gmail.com> wrote:
>>
>>> Thanks Chris and Alan,
>>>
>>> OK, I see. Now that I managed to build
On 12 October 2010 21:15, Joel Goldstick wrote:
> When the dictionary is retrieved, its order depends on the hashed values
> rather than the keys themself.
If (big IF here) you really need an ordered dict you can use the
OrderedDict from the collections module. However this will only
guarantee *i
On Tue, Oct 12, 2010 at 3:39 PM, Sander Sweers wrote:
> On 12 October 2010 21:15, Joel Goldstick wrote:
> > When the dictionary is retrieved, its order depends on the hashed values
> > rather than the keys themself.
>
> If (big IF here) you really need an ordered dict you can use the
> OrderedDic
Hi, I am using the recently released python10.10 and wanted to install
python2.5.4 on my system to do some app engine development, and this is what
I did:-
1.I downloaded Python-2.5.4.tgz.tar from the python site.
2.cd Downloads
tar -xvzf Python-2.5.4.tgz.tar
cd Python-2.5.4
./configure --prefix=
Am 12.10.2010 19:35, schrieb Roelof Wobben:
Hello,
I have this code :
import urllib
import pickle
image = urllib.URLopener()
image.retrieve("http://www.pythonchallenge.com/pc/def/peak.html","banner.p"; )
plaatje = open("banner.p", "rb")
plaatje2 = pickle.load(plaatje)
But it gives this outp
On 12/10/10 18:35, Roelof Wobben wrote:
Hello,
I have this code :
import urllib
import pickle
image = urllib.URLopener()
image.retrieve("http://www.pythonchallenge.com/pc/def/peak.html","banner.p"; )
plaatje = open("banner.p", "rb")
plaatje2 = pickle.load(plaatje)
But it gives this output :
On Tue, Oct 12, 2010 at 1:35 PM, Roelof Wobben wrote:
>
>
> Hello,
>
> I have this code :
>
> import urllib
> import pickle
>
> image = urllib.URLopener()
> image.retrieve("http://www.pythonchallenge.com/pc/def/peak.html","banner.p";
> )
> plaatje = open("banner.p", "rb")
> plaatje2 = pickle.load
On 12 October 2010 18:35, Roelof Wobben wrote:
> image = urllib.URLopener()
> image.retrieve("http://www.pythonchallenge.com/pc/def/peak.html","banner.p";
> )
>
OK firstly, image is an URLopener, so whatever URL you specify, that's the
file that it will download. (I would therefore suggest you
"Roelof Wobben" wrote
Finally solved this puzzle.
Now the next one of the 33 puzzles.
Don;t be surprised if you get stuck. Python Challenge is quite tricky
and is deliberately designed to make you explore parts of the
standard library you might not otherwise find. Expect to do a lot
of readi
"Roelof Wobben" wrote
image = urllib.URLopener()
image.retrieve("http://www.pythonchallenge.com/pc/def/peak.html","banner.p";
)
Roelof,
Please do not post a series of request for help on each of the
Python Challenge puzzles. They are intended to be challenging
and to force you to consult t
On Tue, Oct 12, 2010 at 10:23 AM, Alan Gauld wrote:
>
> "David Hutto" wrote
>
>> > Did you include an ORDER BY?
>>
>> See three posts above, line 6.
>
> Looks like our posts crossed in transit :-)
>
> So you order by graphname, and you only have a single field of that name?
> But then when you pu
Quick note: forgot to add that the initial db file is setup with the following:
import sqlite3 as lite
class db(object):
def onNewProjSQLDB(self):
self.con =
lite.connect('/home/david/pythonfiles/pythonscripts/roughdraftapps/dataplot3/db/dpdb.db')
self.cur
33 matches
Mail list logo