Thanks for the reply, but reading from my initial post I don't seem to have
made my question clear ;(
I was thinking more in terms of how python would find it more efficient in
retrieving the information, this being:
1) Storing all the user files in one place and then selecting only the files
w
Hello,
I would like advise on what method would be better in terms of search and
retrieval.
In my application I need to choose how to store data for each user, for example:
/news
/articles
/games
My difficulty now comes in how to store this data in that I will need to create
views of the data
Thank you for the replies.
Original Message
From: Emad Nawfal (عماد نوفل)
To: davidwil...@safe-mail.net
Cc: tutor@python.org
Subject: Re: [Tutor] how to remove first '/'
Date: Tue, 25 Aug 2009 18:01:26 -0400
>
>
> On Tue, Aug 25, 2009 at 5:55 PM, wrote:
> >
> > Hello,
> >
Hello,
I want to strip the first '/' from the following:
'/path/to/file'
How can I do this?
Dave
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Hello,
I seem to remember that python had a native database, can someone remind me
which this was.
Dave
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
OK I think I found my error, here is what I did:
flags = set([file for file in glob.glob('flag-*.svg')])
def call(cmd):
subprocess.call([cmd], shell=True)
for flag in flags:
name = flag[:-4]
out = name+'.png'
call('svg2png --width=17 --height=12 %s %s' \
% (flag, o
Hello again,
>From my previous post I would now like to transform the SVG images using the
>svg2png library, but am having difficulties in making it work. Here is the
>code:
import glob
import csv
from os import rename
import subprocess
countries = {}
reader = csv.reader(open("countries.csv"))
Thank you all for your help.
Original Message
From: Dave Angel
Apparently from: srs0=pajg=du=ieee.org=da...@srs.perfora.net
To: davidwil...@safe-mail.net
Cc: ken...@tds.net, tutor@python.org
Subject: Re: Re: [Tutor] renaming files within a directory
Date: Mon, 27 Jul 2009 09:01:
Here is the updated viersion:
---
import glob
import csv
from os import rename
countries = {}
reader = csv.reader(open("countries.csv"))
for row in reader:
code, name = row
countries[name] = code
files = set([file for file in glob.glob('Flag_of_*.svg')])
for file in files:
file =
_the_United_State
Also, How do I remove 'Flag_of', 'Flag_of_the_'
I guess after this I can compare the value with the key and map the tld?
Or is it better to use regex and then search from the list of countries? But
how???
Original Message
From: Tim
uti']
['er', 'Eritrea']
...
Now each row is a list with two items each.
But when I do this:
>>> dic = []
>>> for row in reader:
... newdic.append({row[0]: row[1]})
...
>>> dic
[]
I get an empty dictionary
Original Message -
alia.svg']
>>> import csv
>>> reader = csv.reader(open("country.csv"))
>>> for row in reader:
... print row
['"km";"Comoros"']
['"dj";"Djibouti"']
['"er";"Eritrea"
Hello,
I have a directory containing svg/Flag_of_United_States.svg etc...
Flag_of_the_Seychelles.svg
Flag_of_the_Solomon_Islands.svg
Flag_of_the_United_Arab_Emirates.svg
Flag_of_the_United_Kingdom.svg
Flag_of_the_United_States.svg
Flag_of_the_Vatican_City.svg
Also I have a CSV file like
"us",
Hello,
I have searched high and low but for the life of me I am unable to locate this
module.
>>> import cairo
>>> import rsvg
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named rsvg
>>>
Basically from my previous post I would like to now manipulate the SVG
Hello,
I would like to download all the flags from the
http://en.wikipedia.org/wiki/Gallery_of_sovereign-state_flags so that I can
create a flags sprite from this.
The flags seem to follow some order in that all the svg files are in the
following pattern:
http://en.wikipedia.org/wiki/File:Flag
Hello
Original Message
From: Kent Johnson
Apparently from: kent3...@gmail.com
To: davidwil...@safe-mail.net
Cc: tutor@python.org
Subject: Re: [Tutor] dictionaries help
Date: Thu, 23 Jul 2009 21:44:33 -0400
> On Thu, Jul 23, 2009 at 7:09 PM, wrote:
> > Hello again,
> > Here is
more efficient.
Basically I have a big list of industries and I want to verify for each member
whether they are active or not active.
The industry list of dictionaries will stay fixed at about 25 items, whereas
the ws_industry tuple will change depending. I have to go through about 20,000
item
thank you for all your answers
Original Message
From: Norman Khine
Apparently from: tutor-bounces+davidwilson=safe-mail@python.org
To: tutor@python.org
Subject: Re: [Tutor] dictionaries help
Date: Thu, 23 Jul 2009 21:59:01 +0100
> Also you can use list comprehens
hello,
please excuse me, but i would like to understand how dictionaris work.
for example:
>>> my_lst = [{'code': 'aaa', 'name': 'a name'}, {'code': 'bbb', 'name': 'b
>>> name'}]
>>> my_code = 'aaa'
from the above i would like to compare my_code and return the dictionary which
has code == my_c
19 matches
Mail list logo