What is a good way to read binary data from HUGE file and write it
to another file?
Thanks for help
La.
--
http://mail.python.org/mailman/listinfo/python-list
How can I run external program from Python?
I use Python with XP
Thank you for help
LB
--
http://mail.python.org/mailman/listinfo/python-list
Gary Herron wrote:
Lad wrote:
How can I run external program from Python?
I use Python with XP
Thank you for help
LB
The subprocess module is what you want for this.
It's got ways of running external executables as separate subprocesses,
and interacting with the subprocess
Maxim Sloyko wrote:
Lad wrote:
In my web application I use Apache and mod_python.
I allow users to upload huge files( via HTTP FORM , using POST method)
I would like to store the file directly on a hard disk and not to
upload the WHOLE huge file into server's memory first.
Can anyone
In my web application I use Apache and mod_python.
I allow users to upload huge files( via HTTP FORM , using POST method)
I would like to store the file directly on a hard disk and not to
upload the WHOLE huge file into server's memory first.
Can anyone suggest a solution?
Thank you
LB
--
On my website I allow users to upload files. I would like a user to see
how much time is left before a file is uploaded. So, I would like to
have a progress bar during a file uploading. Can Python help me with
that?Or how can be a progress bar made?
Thank you for ideas.
La.
--
In a text I need to
add a blank(space) after a comma but only if there was no blank(space)
after the comman
If there was a blank(space), no change is made.
I think it could be a task for regular expression but can not figure
out the correct regular expression.
Can anyone help, please?
Thank you
Thank you for ALL for help.
Hendrik,
your solution works great but
what is `_` in
_.replace(',',', ')
for?
Thank you
La.
re's are a pain. Do this instead:
s = hello, goodbye,boo
s.replace(', ',',')
'hello,goodbye,boo'
_.replace(',',', ')
'hello, goodbye, boo'
Hope this helps
Nick Craig-Wood wrote:
Lad [EMAIL PROTECTED] wrote:
In a text I need to add a blank(space) after a comma but only if
there was no blank(space) after the comman If there was a
blank(space), no change is made.
I think it could be a task for regular expression but can not
figure
.).
So,I was thinking about FTP protocol, but there may be better solutions
too.
(FTP server would be running on server)
I am sure, it can be done this or that way in Python too. (YouTube.com
is a good example)
Do you have any idea how to do that?
Thank you
Lad,
As I mentioned YouTube also uses
Speaking of YouTube, does anyone know how they uploads big files(
100MB)
I need to solve that problem ( in Python of course) and YouTube is a
good sample of that.
Lad.
--
http://mail.python.org/mailman/listinfo/python-list
to use any communications protocol (including HTTP), both ends must have
programs that can talk that protocol...
Sure, but browsers have FTP support. But how to call the FTP API from
Python?
Lad.
--
http://mail.python.org/mailman/listinfo/python-list
Users needs to upload big files upto 100MB.So I think that FTP protocol
would be a solution, but how can I allow users to select the right file
,on their local disk, via a file dialog ?
Thank you for your ideas
L.
--
http://mail.python.org/mailman/listinfo/python-list
If a user will upload large files via FTP protocol, must the user
have an FTP client on his computer or is it possible to use a similar
way to http form comunication?
Or is there another way( besides FTP) how to upload large files to
server?
Thank you he help
Lad.
--
http://mail.python.org
Is there a module in Python available that I can use for uploading
files via
SFTP (SSH File Transfer Protocol)?
Or do you think that FTP protocol for files uploading is OK?
Thank you for replies
Lad.
--
http://mail.python.org/mailman/listinfo/python-list
Avell Diroll wrote:
Lad wrote:
Is there a module in Python available that I can use for uploading
files via
SFTP (SSH File Transfer Protocol)?
Or do you think that FTP protocol for files uploading is OK?
Thank you for replies
Lad.
I believe there are many of those, personally
Fredrik Lundh wrote:
Lad wrote:
I love Python so I would like to implement video support in Python.
maybe this might be helpful?
http://blog.go4teams.com/archives/video-blogging-using-django-and-flashtm-video-flv/56
/F
Yes, it is very good link.
Thank you
--
http://mail.python.org
-forward or
reverse through the video.
Can PyMedia add such meta- information?
Thank you for help
Lad.
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik,
Thank you for your reply
but I think you're missing the point; you need to provide more
information about your specific requirements than just a HTML
page that links to a video file. like, say, in what way this
is related to Python, what software you're using today, what
kind of
Hello Tim,
Thank you for your reply.
Yes, my site uses Python.
Do you have any idea how to add video playing ( video streaming
feature)to my webiste?
Thank you for help
L.
Tim Roberts wrote:
Lad [EMAIL PROTECTED] wrote:
I would like to add on my website a possibility for visitors to
upload
Hello,
Does anybody know about a video stream server that
serves up HTML pages with links to video files, and then serving out
those video files.
L.
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik,
Thank you for your reply.
If I use the YOUTUBE.com server , I would have to connect to THEIR
computers whenever a user will come to MY website to play a video
stream on MY website. Is it so?
Regards,
L.
Lundh wrote:
Lad wrote:
Does anybody know about a video stream server
I would like to add on my website a possibility for visitors to
upload video and watch other user's video. How much difficult would it
be with Python?
Thank you any for idea.
L.
--
http://mail.python.org/mailman/listinfo/python-list
I have a sorted list for example [1,2,3,4,5] and I would like to change
it in a random way
e.g [2,5,3,1,4] or [3,4,1,5,2] or in any other way except being
ordered.
What is the best/easiest
way how to do it?
Thank you for help
L.
--
http://mail.python.org/mailman/listinfo/python-list
Wolfram Kraus wrote:
On 09.11.2006 10:52, Lad wrote:
I have a sorted list for example [1,2,3,4,5] and I would like to change
it in a random way
e.g [2,5,3,1,4] or [3,4,1,5,2] or in any other way except being
ordered.
What is the best/easiest
way how to do it?
Thank you for help
Test
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
Lad wrote:
If I have a list
Mylist=[1,2,3,4,5]
I can print it
for i in Mylist:
print i
and results is
1
2
3
4
5
But how can I print it in a reverse order so that I get
5
4
3
2
1
?
Thanks.
L
reverse
If I have a list
Mylist=[1,2,3,4,5]
I can print it
for i in Mylist:
print i
and results is
1
2
3
4
5
But how can I print it in a reverse order so that I get
5
4
3
2
1
?
Thanks.
L
--
http://mail.python.org/mailman/listinfo/python-list
]=C[key]+value
else:
C[key]=value
How easy :-)
Regards,
L.
Steven D'Aprano wrote:
On Wed, 18 Oct 2006 09:31:50 -0700, Lad wrote:
Steven,
Thank you for your reply and question.
What should the result be if both dictionaries have the same key?
The answer
I use the following code to sort dictionary.
Olddict={'r':4,'c':1,'d':2,'e':3,'f':2}
Newdict={}
i = [(val, key) for (key, val) in Olddict.items()]
i.sort() # by val
i.reverse() # Get largest first.
for (val, key) in i:
print key,val
Newdict[key]=val
print Olddict
print Newdict
How can I add two dictionaries into one?
E.g.
a={'a:1}
b={'b':2}
I need
the result {'a':1,'b':2}.
Is it possible?
Thank you
L.
--
http://mail.python.org/mailman/listinfo/python-list
Tim Chase wrote:
How can I add two dictionaries into one?
E.g.
a={'a:1}
b={'b':2}
I need
the result {'a':1,'b':2}.
a.update(b)
a
{'a':1,'b':2}
-tkc
Thank you ALL for help.
However It does not work as I would need.
Let's suppose I have
a={'c':1,'d':2}
b={'c':2}
but
Steven,
Thank you for your reply and question.
What should the result be if both dictionaries have the same key?
The answer: the values should be added together and assigned to the key
That is
{'a':1, 'b':5}
( from your example below)
Is there a solution?
Thanks for the reply
L.
a={'a':1,
In a web application users can post some information. I would like to
link each posting with a weight of importance for a user, depending
on a keywords in the posting.
For example, I know that a user A is interested in Nokia mobiles while
user B in Siemens mobiles.
So, if a user A is signed, he
Dennis,
Thank you for your reply
You say:
Pretend you are the computer/application/etc. How would YOU
perform such a ranking?
That is what I do not know , how to perform such ranking.
Do you have any idea?
Regards,
Lad.
--
http://mail.python.org/mailman/listinfo/python-list
Did anyone try to find out a regular expression for finding an email
address in a text?
Thank you for the reply
L.
--
http://mail.python.org/mailman/listinfo/python-list
Tim Roberts wrote:
Lad [EMAIL PROTECTED] wrote:
from
image:
http://www.pythonware.com/library/pil/handbook/image.htm
This is some example code:
from PIL import Image
im = Image.open(1.jpg)
nx, ny = im.size
im2 = im.resize((int(nx*1.5), int(ny*1.5)), Image.BICUBIC)
im2.save
Is it possible to change a picture resolution with Python?
Let's say I have a picture with a resolution of 96 dpi and I would like
to increase to 256dpi or higher.
Thank you for your reply.
LL
--
http://mail.python.org/mailman/listinfo/python-list
from
image:
http://www.pythonware.com/library/pil/handbook/image.htm
This is some example code:
from PIL import Image
im = Image.open(1.jpg)
nx, ny = im.size
im2 = im.resize((int(nx*1.5), int(ny*1.5)), Image.BICUBIC)
im2.save(2.png)
Bye,
bearophile,
Thank you for your reply.
But the
Normaly I can log user's IP address using os.environ[REMOTE_ADDR] .
If a user is behind a proxy, I will log proxy's IP address only.
Is there a way how to find a real IP user's address?
Thank you for help.
LL.
--
http://mail.python.org/mailman/listinfo/python-list
Marc 'BlackJack' Rintsch wrote:
In [EMAIL PROTECTED], Lad wrote:
The text is from Mysql table field that uses utf8_czech_ci collation,
but when I try
`RealName`.decode('utf8'),where RealName is that field of MySQL
I will get:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3
Fredrik Lundh wrote:
Lad wrote:
for
print repr(RealName) command
I will get
P?ibylov\xe1 Ludmila
where instead of ? should be also a character
that's not very likely; repr() always includes quotes, always escapes
non-ASCII characters, and optionally includes a Unicode prefix
Fredrik Lundh wrote:
Lad wrote:
The result of print *, repr(RealName), type(RealName), * is
* 'Fritschov\xe1 Laura' type 'str' *
looks like the MySQL interface is returning 8-bit strings using ISO-8859-1
encoding (or some variation of that; \xE1 is LATIN SMALL LETTER A
WITH ACUTE
To be able to decode a string successfully, I need to know what coding
it is in.
The string can be coded in utf8 or in windows-1250 or in another
coding.
Is there a method how to find out the string coding.
Thank you for help
L.
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh wrote:
Lad wrote:
To be able to decode a string successfully, I need to know what coding
it is in.
ask whoever provided the string.
The string can be coded in utf8 or in windows-1250 or in another
coding. Is there a method how to find out the string coding
I would like to record visitor's IP address.How can I do that in
Python?
Thanks for help
L
--
http://mail.python.org/mailman/listinfo/python-list
Sybren Stuvel wrote:
Lad enlightened us with:
I would like to record visitor's IP address.How can I do that in
Python?
Too little information. Visitors of what?
Sybren
I have a website written in Python and I would like to login every
visitor's IP address.
In other words, if a visitor
Sybren Stuvel wrote:
Lad enlightened us with:
I have a website written in Python and I would like to login every
visitor's IP address.
Ehm... that's probably log not login.
In other words, if a visitor come to my Python application, this
application will record his IP. Is it possible
Hello,
what is the best /easest way how to get number of hours and minutes
from a timedelta object?
Let's say we have
aa=datetime.datetime(2006, 7, 29, 16, 13, 56, 609000)
bb=datetime.datetime(2006, 8, 3, 17, 59, 36, 46000)
so
c=bb-aa
will be
datetime.timedelta(5, 6339, 437000)
I can easily get
In a datetime object I would like to change days and hours.
Or in other words, I would like to copy this datetime object but
increase days and hours.
Is it possible?
For example:If I have a datetime object like this
datetime.datetime(2006, 8, 3, 14, 13, 56, 609000)
I would like to make a new ,for
How can I find days and minutes difference between two datetime
objects?
For example If I have
b=datetime.datetime(2006, 8, 2, 8, 57, 28, 687000)
a=datetime.datetime(2006, 8, 1, 18, 19, 45, 765000)
Thank you for help
L.
--
http://mail.python.org/mailman/listinfo/python-list
Sybren Stuvel wrote:
Lad enlightened us with:
How can I find days and minutes difference between two datetime
objects?
For example If I have
b=datetime.datetime(2006, 8, 2, 8, 57, 28, 687000)
a=datetime.datetime(2006, 8, 1, 18, 19, 45, 765000)
diff = b - a
Ok, I tried
diff=b
John Machin wrote:
Lad wrote:
Sybren Stuvel wrote:
Lad enlightened us with:
How can I find days and minutes difference between two datetime
objects?
For example If I have
b=datetime.datetime(2006, 8, 2, 8, 57, 28, 687000)
a=datetime.datetime(2006, 8, 1, 18, 19, 45
Frederic and Klaus,
Thank you for the reply
L.
Klaus Alexander Seistrup wrote:
Lazy Lad wrote:
Is there a blog application source available in Python?
Several. Did you try Google before you posted your question? The search
term python blog has http://wiki.python.org/moin
Is there a blog application source available in Python?
Thank you for reply
L.
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh wrote:
Lad wrote:
I downloaded jpeg (from ftp://ftp.uu.net/graphics/jpeg/ ) source
libraries( file jpegsrc.v6b.tar.gz) and installed them. Now in
/usr/local/lib I have the following files: cjpeg
,djpeg,jpegtran,rdjpgcom and wrjpgcom
cjpeg, djpeg etc are executables
Fredrik Lundh wrote:
Lad wrote:
I installed PIL under Linux but now when I try it I get the error:
decoder jpeg not available
How can I correct that problem?
if you built PIL yourself, the setup script told you how to fix this.
- make sure you have right libraries installed
I installed PIL under Linux but now when I try it I get the error:
decoder jpeg not available
How can I correct that problem?
Thank you for help
L.
--
http://mail.python.org/mailman/listinfo/python-list
K.S.Sreeram wrote:
Lad wrote:
I really would like to have ALL pictures in one file.
import Image
def merge_images( input_files, output_file ) :
img_list = [Image.open(f) for f in input_files]
out_width = max( [img.size[0] for img in img_list] )
out_height = sum( [img.size[1
All that I want is this:
I download ( via Python) some pictures from internet and I want to add
all these pictures into one =one file/
So far, I managed to download pictures but I do not know how to add i
them nto one file.
How can I do that?
Thank you for reply and help
L.
[EMAIL PROTECTED] wrote:
Lad wrote:
I want to to do that as easy as possible.
But not even more easy.
I think the easest way could be add( append) an image to another
into an image file so that I can use an image browser and see all
pictures in one file. Is that possible?
Well, you
Fredrik Lundh wrote:
Lad wrote:
Open a picture file( download it from internet) and write it in a
result file( being open in binary mode).
Then download another file and append to the result file.
And so on...
But is it possible? Will be the pictures in the result file seen
well
Fredrik Lundh wrote:
Lad wrote:
I really would like to have ALL pictures in one file.
So, what would be the easiest/best way how to do that?
do you want to look at the images as a slideshow or as a collage?
/F
As a collage only
--
http://mail.python.org/mailman/listinfo/python-list
Hello ,
is it possible to add( with PYTHON language) several image files into
one?
Thanks for reply
L.
--
http://mail.python.org/mailman/listinfo/python-list
K.S.Sreeram wrote:
Lad wrote:
Hello ,
is it possible to add( with PYTHON language) several image files into
one?
Google for 'Python Imaging Library'...
Regards
Sreeram
Thank you for your reply.
I was thinking about this:
to open each image file in binary mode , read it and write
Steve Holden wrote:
Lad wrote:
K.S.Sreeram wrote:
Lad wrote:
Hello ,
is it possible to add( with PYTHON language) several image files into
one?
Google for 'Python Imaging Library'...
Regards
Sreeram
Thank you for your reply.
I was thinking about this:
to open each
I use datetime class in my program and now
I have two fields that have the datetime format like this
datetime.datetime(2006, 5, 24, 16, 1, 26)
How can I find out the date/time difference ( in days) of such two
fields?
Thank you for help?
L
--
I use Python 2.3.
I have heard about decorators in Python 2.4.
What is the decorator useful for?
Thanks for reply
L.
--
http://mail.python.org/mailman/listinfo/python-list
How can I covert in Python a variable of a long type to variable of
Integer type?
Thank you for reply
L.
--
http://mail.python.org/mailman/listinfo/python-list
Can anyone give an example how to send email with non-ascii characters(
both in subject and body).
I would like to use windows-1250 code page
Thank you
L.B.
--
http://mail.python.org/mailman/listinfo/python-list
Sybren,
and can give me an example of Python code that can send such email??
--
http://mail.python.org/mailman/listinfo/python-list
I have a script that uses utf-8 encoding. Now I would like to send some
data to an application ( on another server) that uses 1250 encoding.
How can I tell the server that the coming data will be in utf-8 code?
I tried this
params='some data'
h = httplib.HTTP(self.host)
h.putheader(Content-type,
Yes, 'some data'.decode('utf8').encode('windows-1250')
works great.
Thanks
L.B.
--
http://mail.python.org/mailman/listinfo/python-list
Pythonwin is not good,if you use non Ascii characters.I had to moved to
Jedit.
L.B
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
How can I check that a string does NOT contain NON English characters?
Thanks
L.
--
http://mail.python.org/mailman/listinfo/python-list
What editor shall I use if my Python script must contain utf-8
characters?
I use XP
Thank you for reply
l.b.
--
http://mail.python.org/mailman/listinfo/python-list
is vim for XP?
--
http://mail.python.org/mailman/listinfo/python-list
I did not find where I can set encoding type in vim
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
is there a way how to use PythonWin for editting of Python files that
consist non English characters? In my Python scripts I need to use(
print) Cyrilic characters and with PythonWin it is not possible . I use
PythonWin 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit
(Intel)] on
Hello,
is there any mod_cgi - WSGI gateway available?
(I know only about fast_cgi -WSGI gateway .)
Regards,
L
--
http://mail.python.org/mailman/listinfo/python-list
I have a list
L={}
Now I can assign the value
L['a']=1
and I have
L={'a': 1}
but I would like to have a dictionary like this
L={'a': {'b':2}}
so I would expect I can do
L['a']['b']=2
but it does not work. Why?
Thank you for reply
Rg,
L.
--
http://mail.python.org/mailman/listinfo/python-list
Thank you ALL for help and explanation
Regards,
L.
--
http://mail.python.org/mailman/listinfo/python-list
Hello
How can I find out in Python whether the operand is integer or a
character and change from char to int ?
Regards,
L.
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
what is a way to get the the extension of a filename from the path?
E.g., on my XP windows the path can be
C:\Pictures\MyDocs\test.txt
and I would like to get
the the extension of the filename, that is here
txt
I would like that to work on Linux also
Thank you for help
L.
--
Thank you ALL for help
Regards,
L.
--
http://mail.python.org/mailman/listinfo/python-list
Can you please explain in more details (1) choice?
Thanks
Regards,
L
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I have a web program and a user can have access to a page only after he
logged in.
So, the program comes with a Login form and the user logins.But I do
not know how to return the user back to where he came from, after a
successful login.
Something like this:
PageWhereUserMustBeLogin
Hi,
I would like to make in my web application a similar navigation like
Google uses, I mean at the bottom of each page there are numbers of
returned pages after you search query.
Has anyone tried that? Is there an algorithm for that? I do not want to
re-invent the wheel.
Thank you for help
La.
I use the following
###
import re
Results=[]
data1='a href=detailaspxmember=15015mode=advert /aa
href=detailaspxmember=15016mode=advert /aa
href=detailaspxmember=15017mode=advert /a'
ID = re.compile(r'^.*=(\d+).*$',re.MULTILINE)
Results=re.findall(ID,data1)
print Results
#
Thank you Peter for help.
The reason why it did not work was the fact that findall function
required CRLF among lines
--
http://mail.python.org/mailman/listinfo/python-list
I solved the problem. The reason was uncomplete email message
msg should be like this
timezone = ' %+03d%02d' % (-time.timezone/3600, time.timezone%3600)
MessageSubject=This is a subject
BodyMessage=This is a body
msg='From: '+fromaddr+' '+fromaddr+'\nTo:
'+toaddrs+''+toaddrs+'\nDate: '+
error 550: Administrative prohibition
Where can be a problem?
Lad.
--
http://mail.python.org/mailman/listinfo/python-list
Python thinks that the name of program is my.py only
but the name is my-program.py
What is a solution?
Thank you
Lad.
--
http://mail.python.org/mailman/listinfo/python-list
I am thinking about a new project and I do not know if I should use
Python with HTML code only or use a web frame such as Cherry or a
similar ( which one then??) and a template system.
Can you please explain what I will get / lose if I use a web frame
system?
Thanks a lot
La.
--
Does anyone know about an e-shop solution written in Python?
Thanks for reply
Lad.
--
http://mail.python.org/mailman/listinfo/python-list
' are the same)
Thanks for help.
LAd.
--
http://mail.python.org/mailman/listinfo/python-list
Hello ,
Is there an ICQ module? I would like to send a message to users in my
contact list, check if a user is online etc.
Is there a support in Python?
Thanks
L.B
--
http://mail.python.org/mailman/listinfo/python-list
Is anyone capable of providing Python advantages over PHP if there are
any?
Cheers,
L.
--
http://mail.python.org/mailman/listinfo/python-list
)
description - below the tittle next to the picture
Contact person
Company name
Address
fax
phone
Website Address
Do you think that the PyParsing will work for that?
Best regards,
Lad.
--
http://mail.python.org/mailman/listinfo/python-list
Paul, thanks a lot.
It seems to work but I will have to study the sample hard to be able to
do the exercise (the extraction of the
description ) successfully. Is it possible to email you if I need some
help with that exercise?
Thanks again for help
Lad.
--
http://mail.python.org/mailman
1 - 100 of 104 matches
Mail list logo