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
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
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
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
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
--
http:/
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.
--
http://mail.pytho
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
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'
> >>>
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
L.
side, etc.).
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
> 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
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
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.
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
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
> > L
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
Hi Paul,
I checked your video strem server.It seems interesting for me.
Can you please answer these questions?
1. What is a price?
2.Do you support FLV format files, if not, why?
3. How many users do already use the server?
4. Can you name any of your customers ?
Thank you
Lad,
Paul Boddie
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
>
>
Yes, it is very
-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
>
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 s
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
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 webs
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
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 b
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
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
> >
&
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
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
Delsi.items():
if C.has_key(key):
C[key]=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
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':
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'
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
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
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 w
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
> >
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 r
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
Fredrik Lundh wrote:
> Lad wrote:
>
> > 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?
>
&g
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
Fredrik Lundh wrote:
> "Lad" wrote:
>
> > The result of print "*", repr(RealName), type(RealName), "*" is
> >
> > * 'Fritschov\xe1 Laura' *
>
> looks like the MySQL interface is returning 8-bit strings using ISO-8859-1
>
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 esca
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
> >
>
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 m
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
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
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
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
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 d
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
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.d
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, 7650
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
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" h
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 wrj
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.
>
>
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_lis
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?
>
>
As a collage only
--
http://ma
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? Wil
[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
> >
> > 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 he
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 'Pytho
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 think
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
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
--
http://mail.python.org/mailman/listinfo/python-lis
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
Finally I have the working version,It looks like this
#
from email.Message import Message
from email.MIMEText import MIMEText
from email.Header import Header
import smtplib
msg = Message()
Body='Rídících Márinka a kolák Kája
Marík'.decode('utf8').encode('windows-1250')# I use the text
Sybren,
and can give me an example of Python code that can send such email??
--
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
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
Yes, 'some data'.decode('utf8').encode('windows-1250')
works great.
Thanks
L.B.
--
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",
Hello,
How can I check that a string does NOT contain NON English characters?
Thanks
L.
--
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
is vim for XP?
--
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
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 win32
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
Thank you ALL for help
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.
--
http://ma
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.
-
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
Peter,
I tried exactly this
import re
Results=[]
data1=''
ID = re.compile(r'^.*=(\d+)&.*$',re.MULTILINE)
Results=re.findall(ID,data1)
print "Results are= ",Results
#
and received
Results are= ['15017']
Not all numbers
What exactly did you get?
Thanks.
L.
--
http://mail.python.
I use the following
###
import re
Results=[]
data1=''
ID = re.compile(r'^.*=(\d+)&.*$',re.MULTILINE)
Results=re.findall(ID,data1)
print Results
#
to extract from data1 all numbers such as 15015,15016,15017
But the program extracts only the last number 15017.
Why?
Thank you
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: '+ t
addrs, msg)
server.quit()
#
It ends with SMTP error 550: Administrative prohibition
Where can be a problem?
Lad.
--
http://mail.python.org/mailman/listinfo/python-list
ot defined
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.
--
http://mail.pyt
Does anyone know about an e-shop solution written in Python?
Thanks for reply
Lad.
--
http://mail.python.org/mailman/listinfo/python-list
x27;\n' are the same)
Thanks for help.
LAd.
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 112 matches
Mail list logo