On Jan 18, 4:07 am, Simon Forman sajmik...@gmail.com wrote:
Hey folks,
I'm having trouble finding this through google so I figured I'd ask
here.
I want to take a webpage, find all URLs (links, img src, etc.) and
rewrite them in-place, and I'd like to do it in python (pure python
Hi..
Can i find a file size witdhout download?
For example: www.roche.com/rochea_z_sp.pdf
How can i find its size with python ?
I'm sorry for my bad english.
--
http://mail.python.org/mailman/listinfo/python-list
Hi..
I set cookie from www.domain.com but i'cant read this cookie from
subdomain.domain.com
How can i set cookie for all subdomains ?
My set cookie code is:
cookie = Cookie.Cookie('Login-Data', data)
cookie.expires = time.time() + 992
Cookie.add_cookie(req, cookie)
--
On Nov 19, 5:32 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Abandoned wrote:
On Nov 19, 12:36 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Abandoned wrote:
Hi i have a problem.
def showimage(req):
from PIL import Image
im=Image.open(c:\image-2.jpg
On Nov 18, 10:27 am, Arnaud Delobelle [EMAIL PROTECTED] wrote:
On Nov 18, 6:46 am, Abandoned [EMAIL PROTECTED] wrote:
Hi..
I want to show the pictures with mod python directly.
def showimage(req):
some process...
open /var/www/a.jpg and print
for example if i open
Hi i have a problem.
def showimage(req):
from PIL import Image
im=Image.open(c:\image-2.jpg)
im.thumbnail((800,600), Image.ANTIALIAS)
req.sendfile(im)
give me some error.
How can i return this image witdhout save ?
--
On Nov 19, 12:36 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Abandoned wrote:
Hi i have a problem.
def showimage(req):
from PIL import Image
im=Image.open(c:\image-2.jpg)
im.thumbnail((800,600), Image.ANTIALIAS)
req.sendfile(im)
give me some error
Hi..
I want to show the pictures with mod python directly.
( it support cache and image headers)
def showimage(req):
some process...
open /var/www/a.jpg and print
How can i do it ?
I'm sorry for my bad english.
Kind Regards
--
http://mail.python.org/mailman/listinfo/python-list
Hi..
I want to show the pictures with mod python directly.
def showimage(req):
some process...
open /var/www/a.jpg and print
for example if i open:
domain.com/a.py/showimage
It must show me image directly (no redirect or html)
How can i do it ?
I'm sorry for my bad english.
Kind
On Nov 2, 4:19 pm, Paul McNett [EMAIL PROTECTED] wrote:
Abandoned wrote:
Hi.
I want to copy my database but python give me error when i use this
command.
cursor.execute(pg_dump mydata old.dump)
What is the problem ? And how can i copy the database with python ?
You are just going
On Nov 2, 4:11 pm, Martin Sand Christensen [EMAIL PROTECTED] wrote:
Abandoned == Abandoned [EMAIL PROTECTED] writes:
Abandoned I want to copy my database but python give me error when i
Abandoned use this command. cursor.execute(pg_dump mydata old.dump)
Abandoned What is the problem
Hi.
I want to copy my database but python give me error when i use this
command.
cursor.execute(pg_dump mydata old.dump)
What is the problem ? And how can i copy the database with python ?
Note: The database's size is 200 GB
--
http://mail.python.org/mailman/listinfo/python-list
Hi..
I want to do this:
for examle:
12332321 == 12.332.321
How can i do?
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 31, 10:18 pm, Paul McNett [EMAIL PROTECTED] wrote:
Abandoned wrote:
Hi..
I want to do this:
for examle:
12332321 == 12.332.321
How can i do?
Assuming that the dots are always in the 3rd and 7th position in the string:
def conv(s, sep=.):
l = [s[0:3], s[3:6], s[6
On Oct 31, 10:38 pm, Paul McGuire [EMAIL PROTECTED] wrote:
On Oct 31, 2:58 pm, Abandoned [EMAIL PROTECTED] wrote:
Hi..
I want to do this:
for examle:
12332321 == 12.332.321
How can i do?
x = (12332321,)
while (x[0]0): x=divmod(x[0],1000)+x[1:]
...
x
(0, 12, 332, 321)
..join
On Oct 31, 10:38 pm, Paul McGuire [EMAIL PROTECTED] wrote:
On Oct 31, 2:58 pm, Abandoned [EMAIL PROTECTED] wrote:
Hi..
I want to do this:
for examle:
12332321 == 12.332.321
How can i do?
x = (12332321,)
while (x[0]0): x=divmod(x[0],1000)+x[1:]
...
x
(0, 12, 332, 321)
..join
On Oct 31, 10:50 pm, Roberto Bonvallet [EMAIL PROTECTED] wrote:
On 31 oct, 16:58, Abandoned [EMAIL PROTECTED] wrote:
Hi..
I want to do this:
for examle:
12332321 == 12.332.321
How can i do?
x = 12332321
'.'.join(''.join(i for n, i in g) for k, g in
groupby(enumerate(reversed
On Oct 31, 10:50 pm, Roberto Bonvallet [EMAIL PROTECTED] wrote:
On 31 oct, 16:58, Abandoned [EMAIL PROTECTED] wrote:
Hi..
I want to do this:
for examle:
12332321 == 12.332.321
How can i do?
x = 12332321
'.'.join(''.join(i for n, i in g) for k, g in
groupby(enumerate(reversed
Hi..
I have a interesting threading result..
class GetData(threading.Thread):
def __init__(self, name):
threading.Thread.__init__(self)
self.name = name
def run(self):
self.data={2:3, 3:4...}
current = GetData(a)
nlist.append(current)
current.start()
end=[]
dd=nlist[0]
On Oct 29, 11:29 pm, Alan Franzoni
[EMAIL PROTECTED] wrote:
Il Mon, 29 Oct 2007 09:08:01 -0700, Abandoned ha scritto:
I'm sorry my bad english.
King regards..
You must have messed up with something. You didn't post a working snippet
in first place, so you should do it now. I suppose
Hi..
I want to insert some data to postgresql..
My insert code:
yer=019
cursor.execute(INSERT INTO ids_%s (id) VALUES (%s), (yer, id))
I don't want to use % when the insert operation.
in this code give me this error:
psycopg2.ProgrammingError: syntax error at or near '019'
LINE 1: SELECT link_id
Also..
a=123,245,1235,663
cursor.execute(SELECT id, name FROM data WHERE id in (%s), (a,))
In this query must be:
SELECT id, name FROM data WHERE id in (123,245,1235,663)
but it looks:
SELECT id, name FROM data WHERE id in (123,245,1235,663)
How can i delete ?
--
On Oct 28, 9:45 am, Steven D'Aprano [EMAIL PROTECTED]
cybersource.com.au wrote:
On Sun, 28 Oct 2007 00:24:34 -0700, Abandoned wrote:
Hi..
I want to insert some data to postgresql.. My insert code:
yer=019
cursor.execute(INSERT INTO ids_%s (id) VALUES (%s), (yer, id)) I don't
want to use
Hi..
I want to do index in postgresql python.
My table:
id(int) | id2(int) | w(int) | d(int)
My query:
select id, w where id=x and id2=y (sometimes and d=z)
I have too many insert and select operation on this table.
And which index type can i use ? Btree, Rtree, Gist or Hash ?
Also I want to
Hi i want to do proxy in urllib.urlopen how can i do this ?
And which proxy type have i can prefer ?
--
http://mail.python.org/mailman/listinfo/python-list
I read the urllib
reference and set http_proxy=my proxy. But it didn't work. I can't
even get authenticated. Is there anyway that we can set the proxy?
--
http://mail.python.org/mailman/listinfo/python-list
Hi..
I use the threading module for the fast operation. But i have some
problems..
This is my code sample:
=
conn =
psycopg2.connect(user='postgres',password='postgres',database='postgres')
cursor = conn.cursor()
class paralel(Thread):
def __init__ (self, veriler, sayii):
Hi..
I want to delete all now allowed characters in my text.
I use this function:
def clear(s1=):
if s1:
allowed =
[u'+',u'0',u'1',u'2',u'3',u'4',u'5',u'6',u'7',u'8',u'9',u' ', u'Ş',
u'ş', u'Ö', u'ö', u'Ü', u'ü', u'Ç', u'ç', u'İ', u'ı', u'Ğ', u'ğ', 'A',
'C', 'B', 'E', 'D', 'G', 'F',
Hi..
I want to threading but i have a interesting error..
==
class SelectAll(threading.Thread):
def __init__(self, name):
threading.Thread.__init__(self)
self.name = name #kelime
def run(self):
self.result=...
nglist=[]
current = SelectAll(name)
Hi..
I want to do a forum with python but i have a problem..
I have a textarea and i write:
line 1 hi
line 2 how r u
And then i save to this database ( colomn data type is text)
And than it looks line 1 hi line 2 how r u..
How can i protect \n characters ?
--
On Oct 23, 4:41 pm, J. Clifford Dyer [EMAIL PROTECTED] wrote:
On Tue, Oct 23, 2007 at 06:30:18AM -0700, Abandoned wrote regarding How can i
protect text format ?:
Hi..
I want to do a forum with python but i have a problem..
I have a textarea and i write:
line 1 hi
line 2 how r u
cursor.execute(SELECT id from templinks where url=%s, (URL,) )
Yes i already try this before ask.
URL.decode('latin-1').encode('utf-8') to transcode it into utf-8.
i know this but how do you know the html encoding's a latin-1 ? Html
encoding is to be iso-8859-9 or ascii or cp1254 ... For this
Hi..
I have some dictionary as {2:3, 4:6, 5:7.}
I want to pickle to these dictionary and save to database but i
couldn't..
My code for adding..
a=eval(dict)
a=pickle.dumps(a, -1)
cursor2.execute(INSERT INTO cache VALUES ('%s', %s), (x[0],a))
conn2.commit()
i try in UTF-8 postresql
On Oct 20, 5:32 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Abandoned schrieb:
Hi..
I have some dictionary as {2:3, 4:6, 5:7.}
I want to pickle to these dictionary and save to database but i
couldn't..
My code for adding..
a=eval(dict)
a=pickle.dumps(a, -1)
cursor2
Hi..
I want to select datas but some datas give me this error:
psycopg2.ProgrammingError: invalid byte sequence for encoding UTF8:
0xc720
HINT: This error can also happen if the byte sequence does not match
the encoding expected by the server, which is controlled by
client_encoding.
My select
I want to convert a string to command..
For example i have a string:
a=['1']
I want to do this list..
How can i do ?
--
http://mail.python.org/mailman/listinfo/python-list
Thanks you all answer..
But eval is very slow at very big dictionary {2:3,4:5,6:19}
(100.000 elements)
Is there any easy alternative ?
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 18, 6:14 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Abandoned wrote:
Thanks you all answer..
But eval is very slow at very big dictionary {2:3,4:5,6:19}
(100.000 elements)
Is there any easy alternative ?
How big? How slow? For me, a 1-element list takes 0.04 seconds
On Oct 18, 6:26 pm, Hrvoje Niksic [EMAIL PROTECTED] wrote:
Abandoned [EMAIL PROTECTED] writes:
173.000 dict elements and it tooks 2.2 seconds this very big time
for my project
If you're generating the string from Python, use cPickle instead.
Much faster:
import time
d = dict((i, i+1
On Oct 18, 6:35 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Abandoned wrote:
On Oct 18, 6:14 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Abandoned wrote:
Thanks you all answer..
But eval is very slow at very big dictionary {2:3,4:5,6:19}
(100.000 elements)
Is there any
On Oct 18, 6:51 pm, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote:
On Thu, 18 Oct 2007 08:41:30 -0700, Abandoned wrote:
import cPickle as pickle
a={2:3,4:6,2:7}
s=pickle.dumps(a, -1)
g=pickle.loads(s);
print g
'{2:3,4:6,2:7}'
Thank you very much for your answer but result
On Oct 18, 6:57 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Abandoned wrote:
On Oct 18, 6:35 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Abandoned wrote:
On Oct 18, 6:14 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Abandoned wrote:
Thanks you all answer..
But eval is very
On Oct 18, 7:02 pm, Hrvoje Niksic [EMAIL PROTECTED] wrote:
Abandoned [EMAIL PROTECTED] writes:
import cPickle as pickle
a={2:3,4:6,2:7}
s=pickle.dumps(a, -1)
g=pickle.loads(s);
print g
'{2:3,4:6,2:7}'
Thank you very much for your answer but result is a string ??
Because you gave
On Oct 18, 7:40 pm, Hrvoje Niksic [EMAIL PROTECTED] wrote:
Abandoned [EMAIL PROTECTED] writes:
Sorry i can't understand :(
Yes my database already has data in the {..} format and i select
this and i want to use it for dictionary..
But, do you use Python to create that data? If so, simply
On Oct 18, 8:53 pm, Hrvoje Niksic [EMAIL PROTECTED] wrote:
Abandoned [EMAIL PROTECTED] writes:
When you load it, convert the string to dict with cPickle.loads
instead of with eval.
Yes i understand and this very very good ;)
Good! :-)
psycopg2.ProgrammingError: invalid byte
Hi..
I have a dictionary like these:
a={'a': '1000', 'b': '18000', 'c':'40', 'd': '600'} .. 100.000
element
I want to sort this by value and i want to first 100 element..
Result must be:
[b, a, d, c .] ( first 100 element)
I done this using FOR and ITERATOR but it tooks 1 second and this
Very very thanks everbody..
These are some method..
Now the fastest method is second..
1 ===
def sortt(d):
items=d.items()
backitems=[ [v[1],v[0]] for v in items]
backitems.sort()
#boyut=len(backitems)
#backitems=backitems[boyut-500:]
a=[ backitems[i][1] for i in
I tried these:
def largest_sort(d, n):
return sorted(d, key=d.__getitem__, reverse=True)[:n]
def largest_heap(d, n):
return heapq.nlargest(n, d, d.__getitem__)
def sortt(d):
sorted_items = sorted((item[1], item[0]) for item in
d.iteritems(),
reverse=True)
Hi..
I have a list as a=[1, 2, 3 ] (4 million elements)
and
b=,.join(a)
than
TypeError: sequence item 0: expected string, int found
I want to change list to a=['1','2','3'] but i don't want to use FOR
because my list very very big.
I'm sorry my bad english.
King regards
--
Hi..
I want to set 30 second urllib.urlretrieve timeout..
Because if urllib.urlretrieve can't connect to page wait 1-2 hour...
I download the images to my server with urlretrieve if you know the
better way please help me.
I'm sorry my bad english..
--
Hi..
I find the picture color with:
im=Image.open(/%s %name)
color=im.mode #p=black beyaz rgb=color L=grey
This usually work true but in these pictures:
http://malatya.meb.gov.tr/images/alt/ilsis_logo.gif
http://malatya.meb.gov.tr/images/meb.gif
Say me P (blackwhite) but these pictures are
On Oct 7, 4:47 pm, Michal Bozon [EMAIL PROTECTED] wrote:
On Sun, 07 Oct 2007 06:03:06 -0700, Abandoned wrote:
Hi..
I find the picture color with:
im=Image.open(/%s %name)
color=im.mode #p=black beyaz rgb=color L=grey
This usually work true but in these pictures:
http
Hi..
I run a my script and 3-4 minutes later give me an error segmentation
fault.
What is the reason of this error ?
I use in my script:
Threading
Psycopg2
open write to txt
urlopen
My platform is ubuntu linux.
I'm sorry my bad english.
King regards..
--
On 4 Ekim, 22:29, Abandoned [EMAIL PROTECTED] wrote:
Hi..
I try a boolean parser in python since 1 weak.. But i can't do this
because this is very complicated :(
Do you know any blooean parser script in python or how do i write a
boolean parser ?
example query: ((google or yahoo) or (live
http://pyparsing.wikispaces.com/space/showimage/searchparser.py this
is searchparser but i can't understant to use this.
Can anybody explain this how to use ?
--
http://mail.python.org/mailman/listinfo/python-list
Hi..
I have a problem..
list1=[11, 223, 334, 4223...] 1 million element
list2=[22,223,4223,2355...] 500.000 element
I want to difference list1 to list2 but order very importent..
My result must be:
list3=[11,334,...]
I do this use FOR easly but the speed very imported for me. I want to
the
Hi..
I try a boolean parser in python since 1 weak.. But i can't do this
because this is very complicated :(
Do you know any blooean parser script in python or how do i write a
boolean parser ?
example query: ((google or yahoo) or (live msn)) not web
I'm sorry my bad english.
King Regards..
--
Hi..
I'm working a search engine project now. And i have a problem. My
problem is Duplicate Contents..
I can find the percentage of similarity between two pages but i have a
5 millions index and i search 5 million page contents to find one
duplicate :(
I want to a idea for how can i find
On 1 Ekim, 18:13, Bruno Desthuilliers bruno.
[EMAIL PROTECTED] wrote:
J. Clifford Dyer a écrit :
On Mon, Oct 01, 2007 at 03:50:59PM +0200, Bruno Desthuilliers wrote
regarding Re: Select as dictionary...:
IIRC, postgres' db-api connector (well, at least one of them - I don't
know which
Also if i need a list id what can i do ?
aia.execute(SELECT id, w from list)
links=aia.fetchall()
I want to..
idlist=[1, 2, 3] ( I don't want to use FOR and APPEND because the
query have 2 million result and i want to speed)
--
http://mail.python.org/mailman/listinfo/python-list
Hi..
dict1={1: 4, 3: 5}... and 2 millions element
dict2={3: 3, 8: 6}... and 3 millions element
I want to combine dict1 and dict2 and i don't want to use FOR because
i need to performance.
I'm sorry my bed english.
King regards..
--
http://mail.python.org/mailman/listinfo/python-list
On 1 Ekim, 20:41, Carsten Haese [EMAIL PROTECTED] wrote:
On Mon, 2007-10-01 at 10:24 -0700, Abandoned wrote:
Hi..
dict1={1: 4, 3: 5}... and 2 millions element
dict2={3: 3, 8: 6}... and 3 millions element
I want to combine dict1 and dict2 and i don't want to use FOR because
i need
62 matches
Mail list logo