I use the following python code to split a FLV video file into a set of parts
,when finished ,only the first part video can be played ,the other parts are
corrupted.I wonder why and Is there some correct ways to split video files
import sys, os
kilobytes = 1024
megabytes = kilobytes * 1000
chunk
在 2012年12月24日星期一UTC+8上午8时34分47秒,iMath写道:
> how to detect the character encoding in a web page ?
>
> such as this page
>
>
>
> http://python.org/
I found PyQt’s QtextStream can very accurately detect the character encoding
in a web page .
even for this bad page
chard
在 2012年12月24日星期一UTC+8上午8时34分47秒,iMath写道:
> how to detect the character encoding in a web page ?
>
> such as this page
>
>
>
> http://python.org/
I found PyQt’s QtextStream can very accurately detect the character encoding
in a web page .
even for this bad page
ht
在 2012年12月24日星期一UTC+8上午8时34分47秒,iMath写道:
> how to detect the character encoding in a web page ?
>
> such as this page
>
>
>
> http://python.org/
by the way ,we cannot get character encoding programmatically from the mate
data without knowing the character encod
在 2012年12月24日星期一UTC+8上午8时34分47秒,iMath写道:
> how to detect the character encoding in a web page ?
>
> such as this page
>
>
>
> http://python.org/
Finally ,I found by using PyQt’s QtextStream , QTextCodec and chardet ,we can
get a web page code more securely
even f
在 2012年12月24日星期一UTC+8上午8时34分47秒,iMath写道:
> how to detect the character encoding in a web page ?
>
> such as this page
>
>
>
> http://python.org/
here is one thread that can help me understanding my code
http://stackoverflow.com/questions/17001407/how-to-detect-the-ch
What’s the differences between these two pieces of code ?
(1)
for i in range(1, 7):
print(2 * i, end=' ')
(2)
for i in range(1, 7):
print(2 * i, end=' ')
print()
when executed both respectively in Python shell ,I get the same effect . Who
can tell me why ?
--
http://mail.python.o
Does os.getcwd() and os.curdir have the same effect ?
--
http://mail.python.org/mailman/listinfo/python-list
在 2012年3月26日星期一UTC+8下午7时45分26秒,iMath写道:
> I know the print statement produces the same result when both of these two
> instructions are executed ,I just want to know Is there any difference
> between print 3 and print '3' in Python ?
thx everyone
--
http://mail.python.o
在 2012年7月7日星期六UTC+8下午12时56分35秒,iMath写道:
> What’s the differences between these two pieces of code ?
>
> (1)
>
> for i in range(1, 7):
>
> print(2 * i, end=' ')
>
>
>
> thx everyone
>
> (2)
>
> for i in range(1, 7):
>
>
I only know the dollar sign ($) will match a pattern from the
end of a string,but which method does it work with ,re.match() or re.search() ?
--
http://mail.python.org/mailman/listinfo/python-list
On Sunday, September 9, 2012 9:39:28 PM UTC+8, Thomas Jollans wrote:
> On 09/09/2012 03:22 PM, iMath wrote: > Does os.getcwd() and os.curdir have
> the same effect ? > Python 3.2.3 (default, May 3 2012, 15:51:42) [GCC 4.6.3]
> on linux2 Type "help", "copyright&quo
write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212.
--
http://mail.python.org/mailman/listinfo/python-list
where to view range([start], stop[, step])'s C implementation source code ?
--
http://mail.python.org/mailman/listinfo/python-list
To get the accurate value of 1 - 0.999 ,how to implement the python
algorithm ?
BTW ,Windows’s calculator get the accurate value ,anyone who knows how to
implement it ?
--
http://mail.python.org/mailman/listinfo/python-list
host name : localhost
user name:root
password:19910512
database name : shopping
--
http://mail.python.org/mailman/listinfo/python-list
On Monday, October 1, 2012 11:42:26 PM UTC+8, Ian wrote:
> On Mon, Oct 1, 2012 at 9:28 AM, iMath wrote:
>
> > where to view range([start], stop[, step])'s C implementation source code ?
>
>
>
> http://hg.python.org/cpython/file/3f739f42be51/Objects/r
How to only get a list of the names of the non-directory files in current
directory ('.')?
(Note excluding its subdirectories ).
I need the code : )
--
http://mail.python.org/mailman/listinfo/python-list
在 2012年11月6日星期二UTC+8下午1时24分41秒,Chris Angelico写道:
> On Tue, Nov 6, 2012 at 4:19 PM, iMath wrote:
>
> > How to only get a list of the names of the non-directory files in current
> > directory ('.')?
>
> > (Note excluding its subdirectories ).
>
> >
the following code originally from
http://zetcode.com/databases/mysqlpythontutorial/
within the "Writing images" part .
import MySQLdb as mdb
import sys
try:
fin = open("Chrome_Logo.svg.png",'rb')
img = fin.read()
fin.close()
except IOError as e:
print ("Error %d: %s" % (e.arg
在 2012年12月6日星期四UTC+8下午7时07分35秒,Hans Mulder写道:
> On 6/12/12 11:07:51, iMath wrote:
>
> > the following code originally from
> > http://zetcode.com/databases/mysqlpythontutorial/
>
> > within the "Writing images" part .
>
> >
>
&g
where to view open() function's C implementation source code ï¼
--
http://mail.python.org/mailman/listinfo/python-list
å¨ 2012å¹´12æ18æ¥ææäºUTC+8ä¸å1æ¶35å58ç§ï¼Roy Smithåéï¼
> In article ,
>
> iMath wrote:
>
>
>
> > where to view open() function's C implementation source code ï¼
>
>
>
> http://www.python.org/download/releases/
>
>
å¨ 2012å¹´12æ19æ¥ææä¸UTC+8ä¸å4æ¶57å37ç§ï¼ru...@yahoo.comåéï¼
> On Monday, December 17, 2012 10:35:58 PM UTC-7, Roy Smith wrote:
>
> > iMath wrote:
>
> > > where to view open() function's C implementation source code ï¼
>
> > h
å¨ 2012å¹´12æ19æ¥ææä¸UTC+8ä¸å4æ¶57å37ç§ï¼ru...@yahoo.comåéï¼
> On Monday, December 17, 2012 10:35:58 PM UTC-7, Roy Smith wrote:
>
> > iMath wrote:
>
> > > where to view open() function's C implementation source code ï¼
>
> > h
how to detect the encoding used for a specific text data ?
--
http://mail.python.org/mailman/listinfo/python-list
which package to use ?
--
http://mail.python.org/mailman/listinfo/python-list
redirect standard output problem
why the result only print A but leave out 888 ?
import sys
class RedirectStdoutTo:
def __init__(self, out_new):
self.out_new = out_new
def __enter__(self):
sys.stdout = self.out_new
def __exit__(self, *args):
sys.stdout = sys._
Pass and return
Are these two functions the same ?
def test():
return
def test():
pass
--
http://mail.python.org/mailman/listinfo/python-list
在 2012年12月21日星期五UTC+8下午3时24分10秒,Chris Angelico写道:
> On Fri, Dec 21, 2012 at 4:23 PM, iMath wrote:
>
> > redirect standard output problem
>
> >
>
> > why the result only print A but leave out 888 ?
>
>
>
> No idea, because when I paste your code in
how to detect the character encoding in a web page ?
such as this page
http://python.org/
--
http://mail.python.org/mailman/listinfo/python-list
>>> import urllib.request
>>> response =
>>> urllib.request.urlopen('http://en.wikipedia.org/wiki/Internet_media_type')
Traceback (most recent call last):
File "", line 1, in
response =
urllib.request.urlopen('http://en.wikipedia.org/wiki/Internet_media_type')
File "C:\Python32\lib\urlli
在 2012年12月24日星期一UTC+8上午8时34分47秒,iMath写道:
> how to detect the character encoding in a web page ?
>
> such as this page
>
>
>
> http://python.org/
but how to let python do it for you ?
such as this page
http://python.org/
how to detect the character encoding in th
在 2012年12月24日星期一UTC+8上午8时34分47秒,iMath写道:
> how to detect the character encoding in a web page ?
>
> such as this page
>
>
>
> http://python.org/
but how to let python do it for you ?
such as these 2 pages
http://python.org/
http://msdn.microsoft.com/en-us/library
在 2012年12月24日星期一UTC+8上午8时34分47秒,iMath写道:
> how to detect the character encoding in a web page ?
>
> such as this page
>
>
>
> http://python.org/
but how to let python do it for you ?
such as these 2 pages
http://python.org/
http://msdn.microsoft.com/en-us/library
why print(e) cannot print out any information ?
class user:
def __init__(self, x,y,z):
self.id = x
self.name = y
self.emailadd=z
def dispuser(self):
print('User ID: ', self.id)
print('User Name : ', se
I am going to do a Basic Authentication ,
so I need a url
that its http response header that cotain 401 status code.
--
http://mail.python.org/mailman/listinfo/python-list
os.path.realpath(path) bug on win7 ?Temp.link is a Symbolic linkIts target location is C:\test\test1But >>> os.path.realpath(r'C:\Users\SAMSUNG\Temp.link\test2')'C:\\Users\\SAMSUNG\\Temp.link\\test2'I thought the return value should be ' C:\\test\\test1\\test2'Is it a bug ? anyone can clear it to
在 2013年1月6日星期日UTC+8下午3时06分10秒,Chris Rebert写道:
> On Sat, Jan 5, 2013 at 10:55 PM, iMath <2281570...@qq.com> wrote:
>
> >
>
> > os.path.realpath(path) bug on win7 ?
>
> >
>
> > Temp.link is a Symbolic link
>
> > Its target location is C:
在 2013年1月7日星期一UTC+8上午7时40分06秒,Victor Stinner写道:
> It looks like the following issue:
>
> http://bugs.python.org/issue14094
>
> Victor
>
> Le 6 janv. 2013 07:59, "iMath" <22815...@qq.com> a écrit :
>
>
>
>
> os.path.realpath(path) bug on w
在 2012年12月24日星期一UTC+8上午8时34分47秒,iMath写道:
> how to detect the character encoding in a web page ?
>
> such as this page
>
>
>
> http://python.org/
up to now , maybe chadet is the only way to let python automatically do it .
--
http://mail.python.org/mailman/listinfo/python-list
在 2012年9月26日星期三UTC+8下午3时38分50秒,iMath写道:
> I only know the dollar sign ($) will match a pattern from the
>
> end of a string,but which method does it work with ,re.match() or re.search()
> ?
I thought re.match('h.$', 'hbxihi') will match ‘hi’ ,bu
what’s the difference between socket.send() and socket.sendall() ?
It is so hard
for me to tell the difference
between them from the python doc
so what is the difference between them ?
and each one is suitable for which case ?--
http://mail.python.org/mailman/listinfo/python-list
It would be better to give me some examples .thanks in advance !
P.S. which module or lib are needed ?
--
http://mail.python.org/mailman/listinfo/python-list
for example ,if I want to download this file ,how to implement the download
functionality by python ?
http://down.51voa.com/201208/se-ed-foreign-students-friends-16aug12.mp3
as for download speed ,of course ,the fast ,the better ,so how to implement it
?
It would be better to show me an examp
How to get the selected text of the webpage in chrome through python ?
--
http://mail.python.org/mailman/listinfo/python-list
在 2013年1月8日星期二UTC+8下午12时20分28秒,iMath写道:
> How to get the selected text of the webpage in chrome through python ?
I need the code ,cuz I am only familiar with Python ,so it would be better to
give me the code written in Python .
You can also give me the code in other programming langu
在 2013年1月8日星期二UTC+8下午9时19分51秒,Bruno Dupuis写道:
> On Mon, Jan 07, 2013 at 08:20:28PM -0800, iMath wrote:
>
> > How to get the selected text of the webpage in chrome through python ?
>
>
>
> What you need is a way to get selected text from wherever it comes. The
>
在 2013年1月8日星期二UTC+8下午9时11分30秒,Dave Angel写道:
> On 01/08/2013 07:38 AM, Dennis Lee Bieber wrote:
>
> > On Mon, 7 Jan 2013 20:20:28 -0800 (PST), iMath
>
> > declaimed the following in gmane.comp.python.general:
>
> >
>
> >> How to get the selected te
在 2013年1月8日星期二UTC+8上午8时44分20秒,iMath写道:
> It would be better to give me some examples .thanks in advance !
>
>
>
> P.S. which module or lib are needed ?
what I wanna perhaps like this:
when a right mouse button is pressed and we go down and right with a cursor. As
in letter
在 2013年1月9日星期三UTC+8下午5时35分15秒,Alister写道:
> On Mon, 07 Jan 2013 20:20:28 -0800, iMath wrote:
>
>
>
> > How to get the selected text of the webpage in chrome through python ?
>
>
>
> i think you need to explain your requirement further
>
> also what do
在 2013年1月8日星期二UTC+8下午1时04分54秒,Roy Smith写道:
> In article ,
>
> Cameron Simpson wrote:
>
>
>
> > On 07Jan2013 20:19, iMath wrote:
>
> > | for example ,if I want to download this file ,how to implement the
> > download
>
> > | function
can you give me an example code ?
--
http://mail.python.org/mailman/listinfo/python-list
在 2013年1月10日星期四UTC+8上午8时06分13秒,Michael Torrie写道:
> On 01/08/2013 07:57 PM, iMath wrote:
>
> > 在 2013年1月8日星期二UTC+8上午8时44分20秒,iMath写道:
>
> >> It would be better to give me some examples .thanks in advance !
>
> >>
>
> >>
>
To make a method or attribute private (inaccessible from the outside), simply
start its
name with two underscores
《Beginning Python From Novice to Professional》
but there is another saying goes:
Beginning a variable name with a single underscore indicates that the variable
should be treated
在 2013年1月17日星期四UTC+8上午9时04分00秒,alex23写道:
> On Jan 17, 10:34 am, "iMath" <2281570...@qq.com> wrote:
>
> > To make a method or attribute private (inaccessible from the outside),
> > simply start its
>
> > name with two underscores
>
> >
>
&
在 2013年1月17日星期四UTC+8上午8时34分22秒,iMath写道:
> To make a method or attribute private (inaccessible from the outside), simply
> start its
> name with two underscores
>
>
> 《Beginning Python From Novice to Professional》
>
>
> but there is another saying goes:
> Be
anyone can make a Python bindings of VLC-Qt ?
https://github.com/ntadej/vlc-qt
accurately, can anyone make a PyQt bindings of VLC-Qt ?
--
http://mail.python.org/mailman/listinfo/python-list
what is the difference between commenting and uncommenting the __init__ method
in this class?
class CounterList(list):
counter = 0
##def __init__(self, *args):
##super(CounterList, self).__init__(*args)
def __getitem__(self, index):
self.__class__.coun
why [os.path.join(r'E:\Python', name) for name in []] returns [] ?
please explain it in detail !
--
http://mail.python.org/mailman/listinfo/python-list
在 2013年1月29日星期二UTC+8下午9时33分26秒,Steven D'Aprano写道:
> iMath wrote: > why [os.path.join(r'E:\Python', name) for name in []] returns
> [] ? Because you are iterating over an empty list, []. That list
> comprehension is the equivalent of: result = [] for name in []:
> r
please see the formated code at
https://stackoverflow.com/questions/72423464/matplotlib-basemap-colorbar-exception-given-element-not-contained-in-the-stack
--
https://mail.python.org/mailman/listinfo/python-list
在 2022年5月30日星期一 UTC+8 03:29:28, 写道:
> On 2022-05-29 13:57, iMath wrote:
> > please see the formated code at
> > https://stackoverflow.com/questions/72423464/matplotlib-basemap-colorbar-exception-given-element-not-contained-in-the-stack
> The problem might be that you're pa
Normally, the shelve data should be read and write by only one process at a
time, but unfortunately it was simultaneously read and write by two processes,
thus corrupted it. Is there any way to recover all data in it ? Currently I
just get "pickle data was truncated" exception after reading a po
> You have lost the data in that case.
But I found the size of the file of the shelve data didn't change much, so I
guess the data are still in it , I just wonder any way to recover my data.
--
https://mail.python.org/mailman/listinfo/python-list
在 2021年12月30日星期四 UTC+8 03:13:21, 写道:
> On Wed, 29 Dec 2021 at 18:33, iMath wrote:
> > But I found the size of the file of the shelve data didn't change much, so
> > I guess the data are still in it , I just wonder any way to recover my data.
> I agree with Barry, Chris
Thanks for all your kind help, wish you a promising year!
--
https://mail.python.org/mailman/listinfo/python-list
I need to use regex to search two types of Information within a web page, while
it seems searching the page two times rather than one is much time consuming ,
is it possible to search the page one time to get two or more types of
Information?
--
https://mail.python.org/mailman/listinfo/python-
each regex only has one matched result in the web page
--
https://mail.python.org/mailman/listinfo/python-list
for
regex.search(string[, pos[, endpos]])
The optional parameter endpos is the index into the string beyond which the RE
engine will not go, while this lead me to believe the RE engine will still
search on till the endpos position even after it returned the matched object,
is this Right ?
--
1. searching the page two times rather than one is a little bit time consuming .
2. starting the second search from the first match.endpos does reduce the time
consuming .
3. how to combine both patterns into one regex? while using the special |
regex operator only matches one regex not both
--
On Friday, August 19, 2016 at 9:19:22 PM UTC+8, Chris Angelico wrote:
> On Fri, Aug 19, 2016 at 11:13 PM, iMath wrote:
> > 1. searching the page two times rather than one is a little bit time
> > consuming .
>
> Have you measured that? If not, ignore it. You're searchi
On Friday, August 19, 2016 at 9:45:08 PM UTC+8, Friedrich Rentsch wrote:
> On 08/19/2016 09:02 AM, iMath wrote:
> > I need to use regex to search two types of Information within a web page,
> > while it seems searching the page two times rather than one is much time
> &
On Friday, August 19, 2016 at 10:09:19 PM UTC+8, Steve D'Aprano wrote:
> On Fri, 19 Aug 2016 09:14 pm, iMath wrote:
>
> >
> > for
> > regex.search(string[, pos[, endpos]])
> > The optional parameter endpos is the index into the string beyond which
> > t
Any easier solutions on returning a list of absolute file or directory path
within a directory? Mine is
list(map(lambda entry: os.path.join(directory,entry),os.listdir(directory)))
--
https://mail.python.org/mailman/listinfo/python-list
On Wednesday, September 7, 2016 at 4:00:31 PM UTC+8, Steven D'Aprano wrote:
> On Wednesday 07 September 2016 17:08, iMath wrote:
>
> > Any easier solutions on returning a list of absolute file or directory path
> > within a directory? Mine is
> >
> > list(map(l
the doc of os.fsencode(filename) says Encode filename to the filesystem
encoding 'strict' on Windows, what does 'strict' mean ?
--
https://mail.python.org/mailman/listinfo/python-list
Is it possible to set '\n\n' as the terminator when writing a formatted
LogRecord to a stream by changing the format parameter of logging.basicConfig?
I know it is possible using the terminator attribute of StreamHandler class to
implement this, I just wonder Is it possible to achieve this featu
Hello everyone ,
I'd like to introduce my Python/PyQt5 powered Bing wallpaper open source
project.
BingNiceWallpapers
https://github.com/redstoneleo/BingNiceWallpapers
BingNiceWallpapers can get background images from
http://www.bing.com/?mkt=zh-CN and set them as your desktop wallpaper by
Hello everyone ,
I'd like to introduce my Python/PyQt5 powered Bing wallpaper open source
project.
â ï
BingNiceWallpapers
https://github.com/redstoneleo/BingNiceWallpapers
BingNiceWallpapers can get background images from
http://www.bing.com/?mkt=zh-CN and set them as your desktop wallpaper by
I also posted the question here
https://stackoverflow.com/questions/51355926/send-pil-image-to-django-server-side-and-get-it-back
I don't know what's under the hood of sending an image from client side to
server side, so stuck by the following scenario.
I want to send a PIL.Image object to djang
Thanks, I solved it finally stackoverflow.com/a/51453785/1485853
--
https://mail.python.org/mailman/listinfo/python-list
The same question also posted here
https://stackoverflow.com/questions/51820473/right-way-to-use-zipimport-zipimport-zipimporterror-not-a-zip-file
I have managed to use [this module][1] without installation - just import it
from path to use ,
import sys
url = 'https://example.com'
s
I think someone gives the true reason caused the exception here
https://stackoverflow.com/a/51821910/1485853
Thanks to his explanation , I extracted the zip archive and then add the
extracted to a zip archive using Bandizip, this time
`zipimport.zipimporter(r'C:\Users\i\Downloads\you-get-0.4.11
I think someone gives the true reason caused the exception here
https://stackoverflow.com/a/51821910/1485853
Thanks to his explanation , I extracted the zip archive and then add the
extracted to a zip archive using Bandizip, this time
`zipimport.zipimporter(r'C:\Users\i\Downloads\you-get-0.4.11
Not works on Windows
>>> import sys
>>> sys.path.insert(0,
>>> 'C:/Users/i/Downloads/you-get-0.4.1128.zip/you-get-0.4.1128/src')
>>> from you_get import common
I am planning design an encrypted time-limited API on both Client and Server
sides, the server side is written in Django, the client side is a GUI program
which call the API by
import requests
c = requests.post("http://127.0.0.1:8000/VideoParser/";, data={'videoUrl':
videoUrl })
The way it call
On Friday, August 5, 2016 at 7:50:28 AM UTC+8, jj0ge...@gmail.com wrote:
> According to Python.org Mark Hammond has an Add-on (pywin32) that supports
> Win32 and COM.
>
> Does anyone know if the Add-on covers all Win32 API functions, and if not is
> there a list of the subset of Win32 API functi
During Loading this web page(http://www.iqiyi.com/v_19rrkkri8k.html) , the
browser makes many requests,now I need a certain request url (e.g.starts with
'http://cache.video.qiyi.com/vms?') during the Loading process ,and the request
is made on condition that the adobe flash player plugin for NPA
To find all js/css/image pathnames in a HTML document, I used regular
expression(in the last line of my code snippet) to do this as the following,
are there any other shorter regular expressions or more efficient ways to do
this ?
import re
translation='''
bee·tle™
I followed the official [Celery
guide](https://docs.celeryproject.org/en/stable/getting-started/next-steps.html#in-the-background)
to learn, everything works well when using `celery -A proj worker -l info` to
start the worker, however , if I run the worker in the background using `celery
multi
Asked 3 days ago at
https://stackoverflow.com/questions/63951696/celery-multi-celery-exceptions-timeouterror-the-operation-timed-out
But nobody helped yet, anyone ?
--
https://mail.python.org/mailman/listinfo/python-list
在 2020年9月21日星期一 UTC+8 下午8:02:44, 写道:
> Op 21-09-2020 om 12:14 schreef iMath:
> > Asked 3 days ago at
> > https://stackoverflow.com/questions/63951696/celery-multi-celery-exceptions-timeouterror-the-operation-timed-out
> >
> >
> > But nobody helped yet, any
is there anyway to run command line on Windows without showing DOS console
window ?
can you use the following command line to give a little example ?
wget -r -np -nd http://example.com/packages/
the path to wget is C:\Program Files\GnuWin32\bin\wget.exe
--
https://mail.python.org/mailman/lis
在 2013年11月20日星期三UTC+8下午10时49分50秒,Tim Golden写道:
> On 20/11/2013 14:44, iMath wrote:
>
> >
>
> >
>
> > is there anyway to run command line on Windows without showing DOS console
> > window ?
>
> >
>
> > can you use the following command
I want to a fixed length list-like container, it should have a sorted()-like
function that I can use to sort it,I think there should also a function I can
use it to detect whether the numbers of items in it reaches the length of the
container , because if the numbers of items in it reaches the l
All in all,I want to first fill the container, then sort it and process all the
contents in it
--
https://mail.python.org/mailman/listinfo/python-list
hey , you used
>>> sorted(a.queue)
this means the queue.Queue() has an attribute queue ,but I cannot find it
described in the DOC ,where you find it ?
--
https://mail.python.org/mailman/listinfo/python-list
it seems PriorityQueue satisfy my requirement here .
BTW ,the Queue object has an attribute 'queue' ,but I cannot find it described
in the DOC ,what it means ?
--
https://mail.python.org/mailman/listinfo/python-list
I have few wav files that I can use either of the following command line
mentioned here
https://trac.ffmpeg.org/wiki/How%20to%20concatenate%20%28join,%20merge%29%20media%20files
to concatenate
ffmpeg -f concat -i <(for f in ./*.wav; do echo "file '$f'"; done) -c copy
output.wav
ffmpeg -f conca
1 - 100 of 143 matches
Mail list logo