I got a question in this context.
suppose
a={'a': 3, 'b': [1, 2], 5: 100}
--b=a --vs--
b=copy.copy(a)
b[5]=6 b[5]=6
output: --
On the way of learning " handling POST request in php" i tried to make a
simple python http client using httplib2 & urllib module.. what i wanted to
do was submitting username & password field to a php script (which just
echo's the username & password) & prints the response in python,not in
html/p
On Sat, Jun 25, 2011 at 9:42 PM, Steven D'Aprano wrote:
> naheed arafat wrote:
>
>> 1)
>>
>>> zip('How are you?'.split(' ')[::-1],'i am fine.'.split(' '))
>>>>>
>>>> [('you?', 'i
On Sat, Jun 25, 2011 at 9:38 PM, Alan Gauld wrote:
>
> "naheed arafat" wrote
>
> 1)
>>
>>> zip('How are you?'.split(' ')[::-1],'i am fine.'.split(' '))
>>>>>
>>>> [('you?', '
1)
>>> zip('How are you?'.split(' ')[::-1],'i am fine.'.split(' '))
[('you?', 'i'), ('are', 'am'), ('How', 'fine.')]
>>> map(lambda i,j:(i,j),'How are you?'.split(' ')[::-1],'i am
fine.'.split(' '))
[('you?', 'i'), ('are', 'am'), ('How', 'fine.')]
Which one has better efficiency?
2)
Is there any
Got a question in this context. If i would like to edit an html file.
suppose i want to edit the values of href tags or the img tags, what should
i do?
should I
1. read the file as string,
2.parse it for the tags,
3.edit the tags
4.and then replace the tags by the editted tags
5.delete the main fil
On Wed, May 25, 2011 at 11:25 PM, Wolf Halton wrote:
> Is there a less clunky way to do this?
> [code]
> def new_pass():
> series = ['`', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-',
> '=', \
> '~', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_',
> '+', \
>
why there is two way to represent strings in python ? single-coated
( ' ' ) and double-coated ( " " ) strings both serve the purpose of string.
Then what is the difference?
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription opti
Supposing your dictionary like this: dict={1:'My name is X',2:'My name is x
y z',3: 'i am X'}
You can use len(list) :
>>> dict={1:'My name is X',2:'My name is x y z',3: 'i am X'}
>>> for values in dict.values():
... if len(values.split(' '))>3:
...print values
My name is X
My name is x
ya.you'r right. left it accidentally.thanks.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
someone please tell me why i'm getting this output?
specially the 'e3%' ! ! !
>>> import re
>>> re.findall('([\w]+.)','abdd.e3\45 dret.8dj st.jk')
['abdd.', 'e3%', 'dret.', '8dj ', 'st.', 'jk']
I am getting the same output for the following too..
>>> re.findall(r'([\w]+.)','abdd.e3\45 dret.8dj st.
Observing the page source i think :
page=urllib.urlopen('http://finance.blog.lemonde.fr').read()
x=re.findall(r"http://s2.lemde.fr/image/2011/02/16/87x0/1480844_7_87fe_bandeau-lycee-electrique.jpg
"
x.extend(y)
x=list(set(x))
for img in x:
image=img.split('.')[-1]
On Thu, Apr 28, 2011 at 6:48 PM, Joel Goldstick wrote:
>
>
> On Wed, Apr 27, 2011 at 11:41 PM, wrote:
>
>> Hello,
>>
>> I'm still quite new at this but I'm trying to get a list of the pictures
>> adress (... .jpg) of a page of a website.
>>
>> I thought of using the import urllib and import re, t
13 matches
Mail list logo