Re: matplotlib basemap colorbar exception : Given element not contained in the stack

2022-05-30 Thread iMath
在 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

Re: matplotlib basemap colorbar exception : Given element not contained in the stack

2022-05-29 Thread iMath
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

Re: recover pickled data: pickle data was truncated

2022-01-05 Thread iMath
Thanks for all your kind help, wish you a promising year! -- https://mail.python.org/mailman/listinfo/python-list

Re: recover pickled data: pickle data was truncated

2021-12-31 Thread iMath
在 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

Re: recover pickled data: pickle data was truncated

2021-12-29 Thread iMath
> 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

recover pickled data: pickle data was truncated

2021-12-25 Thread iMath
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

Re: celery multi celery.exceptions.TimeoutError: The operation timed out

2020-09-26 Thread iMath
在 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

celery multi celery.exceptions.TimeoutError: The operation timed out

2020-09-21 Thread iMath
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

celery multi celery.exceptions.TimeoutError: The operation timed out

2020-09-18 Thread iMath
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

find all js/css/image pathnames in a HTML document

2019-05-11 Thread iMath
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™

Re: right way to use zipimport, zipimport.ZipImportError: not a Zip file

2018-08-15 Thread iMath
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

Re: right way to use zipimport, zipimport.ZipImportError: not a Zip file

2018-08-14 Thread iMath
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

Re: right way to use zipimport, zipimport.ZipImportError: not a Zip file

2018-08-14 Thread iMath
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

right way to use zipimport, zipimport.ZipImportError: not a Zip file

2018-08-13 Thread iMath
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

Re: send PIL.Image to django server side and get it back

2018-07-22 Thread iMath
Thanks, I solved it finally stackoverflow.com/a/51453785/1485853 -- https://mail.python.org/mailman/listinfo/python-list

send PIL.Image to django server side and get it back

2018-07-16 Thread iMath
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

Re: using HTTPHandler cause Django server side shows http 400 and Invalid HTTP_HOST header message

2017-04-10 Thread iMath
On Tuesday, April 11, 2017 at 12:00:27 AM UTC+8, iMath wrote: > > Are you sure you posted the code you are actually using? Because the > > error message suggests a difference. > > > I am sure ! > > As I have tested: If I pass the IP address of my web server

Re: using HTTPHandler cause Django server side shows http 400 and Invalid HTTP_HOST header message

2017-04-10 Thread iMath
On Tuesday, April 11, 2017 at 12:00:27 AM UTC+8, iMath wrote: > > Are you sure you posted the code you are actually using? Because the > > error message suggests a difference. > > > I am sure ! > > As I have tested: If I pass the IP address of my web server

Re: using HTTPHandler cause Django server side shows http 400 and Invalid HTTP_HOST header message

2017-04-10 Thread iMath
> Are you sure you posted the code you are actually using? Because the > error message suggests a difference. > I am sure ! As I have tested: If I pass the IP address of my web server to the host parameter of HTTPHandler, the server side would show http 400 and Invalid HTTP_HOST header messag

Introducing my Python/PyQt5 powered Bing wallpaper open source project

2017-01-06 Thread iMath
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

Introducing my Python/PyQt5 powered Bing wallpaper open source project

2017-01-04 Thread iMath
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

python3 - set '\n\n' as the terminator when writing a formatted LogRecord

2016-12-29 Thread iMath
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

filesystem encoding 'strict' on Windows

2016-09-29 Thread iMath
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

Re: easy way to return a list of absolute file or directory path within a directory

2016-09-08 Thread iMath
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

easy way to return a list of absolute file or directory path within a directory

2016-09-07 Thread iMath
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

Re: index for regex.search() beyond which the RE engine will not go.

2016-08-20 Thread iMath
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

Re: use regex to search the page one time to get two types of Information

2016-08-20 Thread iMath
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 > &

Re: use regex to search the page one time to get two types of Information

2016-08-20 Thread iMath
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

Re: use regex to search the page one time to get two types of Information

2016-08-19 Thread iMath
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 --

index for regex.search() beyond which the RE engine will not go.

2016-08-19 Thread iMath
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 ? --

Re: use regex to search the page one time to get two types of Information

2016-08-19 Thread iMath
each regex only has one matched result in the web page -- https://mail.python.org/mailman/listinfo/python-list

use regex to search the page one time to get two types of Information

2016-08-19 Thread iMath
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-

get a certain request url during Loading a web page

2016-08-04 Thread iMath
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

Re: Win32 API in pywin32

2016-08-04 Thread iMath
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

Design an encrypted time-limited API on Client/Server side

2016-06-08 Thread iMath
​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

Re: get Coursera video download link via program

2015-06-30 Thread iMath
I know the two packages : BeautifulSoup and requests may help, I am also able to login in Coursera via requests, the difficulty is how to find out the video download link from the page. -- https://mail.python.org/mailman/listinfo/python-list

get Coursera video download link via program

2015-06-30 Thread iMath
I want extract Coursera video download link via program(mainly Python) behind those links https://www.coursera.org/learn/human-computer-interaction/lecture/s4rFQ/the-interaction-design-specialization https://www.coursera.org/learn/calculus1/lecture/IYGhT/why-is-calculus-going-to-be-so-much-fun

Re: Survey -- Move To Trash function in Python?

2015-05-18 Thread iMath
在 2015年5月14日星期四 UTC+8下午11:45:38,Steven D'Aprano写道: > I'd like to do a little survey, and get a quick show of hands. > > How many people have written GUI or text-based applications or scripts where > a "Move file to trash" function would be useful? > > Would you like to see that in the standard li

cx_Freeze:Fatal Python error: Py_Initialize: Unable to get the locale encoding ImportError: No module named 'encodings'

2015-02-02 Thread iMath
I downloaded cx_Freeze from here, installed it successfully on Ubuntu following this thread . After run python3 setup.py build in cx_Freeze/samples/simple,then change the dir to cx_Freeze/samples/simple/build/exe.linux-i686-3.4,run the following command ,I got the error ?7?4 exe.linux-i686-3.

Re: Future of python on android

2014-12-26 Thread iMath
在 2014年12月25日星期四UTC+8下午11时31分24秒,Fetchinson .写道: > Hi all, > > I was using sl4a for quite some time on android and it basically > worked very well although some features are missing. It looks like > sl4a is dead, although I could be wrong. Does anyone knowledgeable > have any further info on the f

Re: encrypt the http request url on the local machine

2014-12-12 Thread iMath
在 2014年12月9日星期二UTC+8下午2时58分36秒,iMath写道: > my software on the local machine needs to send http request to a specific web > server , is there any way to protect the http request url from being found by > Packet analyzer software like Wireshark and fiddler. The sever is not mine, >

Re: beautifulsoup VS lxml

2014-12-12 Thread iMath
在 2014年12月12日星期五UTC+8上午10时19分56秒,Michael Torrie写道: > On 12/11/2014 07:02 PM, iMath wrote: > > > > which is more easy and elegant for pulling data out of HTML? > > Beautiful Soup is specialized for HTML parsing, and it can deal with > badly formed HTML, but if I recall

Re: PyQt: user interface freezed when using concurrent.futures.ThreadPoolExecutor

2014-12-11 Thread iMath
在 2014年12月11日星期四UTC+8下午1时25分41秒,Michael Torrie写道: > On 12/10/2014 09:52 PM, iMath wrote: > > I think the user interface shouldn't be freezed when using > > concurrent.futures.ThreadPoolExecutor here,as it executes > > asynchronously , but it doesn't meet my expectat

beautifulsoup VS lxml

2014-12-11 Thread iMath
which is more easy and elegant for pulling data out of HTML? -- https://mail.python.org/mailman/listinfo/python-list

PyQt: user interface freezed when using concurrent.futures.ThreadPoolExecutor

2014-12-10 Thread iMath
I think the user interface shouldn't be freezed when using concurrent.futures.ThreadPoolExecutor here,as it executes asynchronously , but it doesn't meet my expectations,anyone can explain why ? any other solutions here to not let user interface freezed? code is here http://stackoverflow.com/qu

Re: encrypt the http request url on the local machine

2014-12-10 Thread iMath
在 2014年12月9日星期二UTC+8下午2时58分36秒,iMath写道: > my software on the local machine needs to send http request to a specific web > server , is there any way to protect the http request url from being found by > Packet analyzer software like Wireshark and fiddler. The sever is not mine, >

Re: encrypt the http request url on the local machine

2014-12-09 Thread iMath
在 2014年12月9日星期二UTC+8下午2时58分36秒,iMath写道: > my software on the local machine needs to send http request to a specific web > server , is there any way to protect the http request url from being found by > Packet analyzer software like Wireshark and fiddler. The sever is not mine, >

Re: encrypt the http request url on the local machine

2014-12-08 Thread iMath
在 2014年12月9日星期二UTC+8下午2时58分36秒,iMath写道: > my software on the local machine needs to send http request to a specific web > server , is there any way to protect the http request url from being found by > Packet analyzer software like Wireshark and fiddler. The sever is not mine, >

encrypt the http request url on the local machine

2014-12-08 Thread iMath
my software on the local machine needs to send http request to a specific web server , is there any way to protect the http request url from being found by Packet analyzer software like Wireshark and fiddler. The sever is not mine, so I can do nothing in the server . It would be better to show

Re: using ffmpeg command line with python's subprocess module

2013-12-09 Thread iMath
在 2013年12月6日星期五UTC+8下午10时59分43秒,Chris Angelico写道: > On Sat, Dec 7, 2013 at 1:54 AM, iMath wrote: > > > fp=tempfile.NamedTemporaryFile(delete=False) > > > fp.write(("file '"+fileName1+"'\n").encode('utf-8'))

Re: using ffmpeg command line with python's subprocess module

2013-12-06 Thread iMath
在 2013年12月4日星期三UTC+8下午6时51分49秒,Chris Angelico写道: > On Wed, Dec 4, 2013 at 8:38 PM, Andreas Perstinger > wrote: > > > "fp" is a file object, but subprocess expects a list of strings as > > > its first argument. > > > > More fundamentally: The subprocess's arguments must include the *name* >

Re: using ffmpeg command line with python's subprocess module

2013-12-06 Thread iMath
在 2013年12月6日星期五UTC+8下午5时23分59秒,Mark Lawrence写道: > On 06/12/2013 06:23, iMath wrote: > > > > Dearest iMath, wouldst thou be kind enough to partake of obtaining some > > type of email client that dost not sendeth double spaced data into this > > most illustrious

Re: using ffmpeg command line with python's subprocess module

2013-12-05 Thread iMath
在 2013年12月4日星期三UTC+8下午5时38分27秒,Andreas Perstinger写道: > iMath wrote: > > >I use the following code to do the test ,but error occurred ,it > > >prompts system cannot find specified files ,but the files are indeed > > >exists there ,any help ? > > > &g

Re: using ffmpeg command line with python's subprocess module

2013-12-03 Thread iMath
在 2013年12月3日星期二UTC+8上午9时42分11秒,rusi写道: > On Tuesday, December 3, 2013 6:45:42 AM UTC+5:30, iMath wrote: > > > so is there any way to create a temporary file by Python here ? > > > > http://docs.python.org/2/library/tempfile.html I use the following code to do the test

Re: using ffmpeg command line with python's subprocess module

2013-12-03 Thread iMath
在 2013年12月3日星期二UTC+8上午9时42分11秒,rusi写道: > On Tuesday, December 3, 2013 6:45:42 AM UTC+5:30, iMath wrote: > > > so is there any way to create a temporary file by Python here ? > > > > http://docs.python.org/2/library/tempfile.html I use the following code to do the test

Re: how to implement a queue-like container with sort function

2013-12-03 Thread iMath
在 2013年12月4日星期三UTC+8上午7时23分49秒,Cameron Simpson写道: > On 03Dec2013 16:34, Ned Batchelder wrote: > > > On 12/3/13 4:19 PM, Cameron Simpson wrote: > > > >And then I check the source:-( He actually said "I want to a fixed > > > >length list-like container". That still sounds like a limit to the > >

Re: using ffmpeg command line with python's subprocess module

2013-12-03 Thread iMath
在 2013年12月3日星期二UTC+8下午5时33分09秒,Alain Ketterlin写道: > Ben Finney writes: > > > > > Chris Angelico writes: > > > > > >> On Mon, Dec 2, 2013 at 10:34 PM, iMath wrote: > > >> > ffmpeg -f concat -i <(for f in ./*.wav; do echo "fi

Re: using ffmpeg command line with python's subprocess module

2013-12-02 Thread iMath
在 2013年12月3日星期二UTC+8上午5时19分21秒,Ben Finney写道: > Chris Angelico writes: > > > > > On Mon, Dec 2, 2013 at 10:34 PM, iMath wrote: > > > > ffmpeg -f concat -i <(for f in ./*.wav; do echo "file '$f'"; done) -c > > > copy output.wav &

Re: how to implement a queue-like container with sort function

2013-12-02 Thread iMath
在 2013年11月29日星期五UTC+8下午10时57分36秒,Mark Lawrence写道: > On 29/11/2013 12:33, iMath wrote: > > > > > > BTW ,the Queue object has an attribute 'queue' ,but I cannot find it > > described in the DOC ,what it means ? > > > > > > > Really? A

using ffmpeg command line with python's subprocess module

2013-12-02 Thread iMath
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

Re: how to implement a queue-like container with sort function

2013-11-29 Thread iMath
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

Re: how to implement a queue-like container with sort function

2013-11-28 Thread iMath
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

Re: how to implement a queue-like container with sort function

2013-11-28 Thread iMath
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

how to implement a queue-like container with sort function

2013-11-28 Thread iMath
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

Re: run command line on Windows without showing DOS console window

2013-11-23 Thread iMath
在 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

run command line on Windows without showing DOS console window

2013-11-20 Thread iMath
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

Re: pywin32 programming error on Win7 with shell.SHGetDesktopFolder, desktop.BindToObject, desktop.GetDisplayNameOf

2013-11-10 Thread iMath
I solved it like the following from win32com.shell import shell, shellcon import os def launch_file_explorer(path, files): ''' Given a absolute base path and names of its children (no path), open up one File Explorer window with all the child files selected ''' folder_pidl = sh

Re: pywin32 programming error on Win7 with shell.SHGetDesktopFolder, desktop.BindToObject, desktop.GetDisplayNameOf

2013-11-10 Thread iMath
I solved it like the following from win32com.shell import shell, shellcon import os def launch_file_explorer(path, files): ''' Given a absolute base path and names of its children (no path), open up one File Explorer window with all the child files selected ''' folder_pidl = sh

Re: pywin32 programming error on Win7 with shell.SHGetDesktopFolder, desktop.BindToObject, desktop.GetDisplayNameOf

2013-11-09 Thread iMath
thanks, I found out the reason: this question has no relationship with Win7 or WinXP,but related to the users' system setting . GetDisplayNameOf() only gives the DISPLAY name ,so the filename with or without extension acording to whether the user want to view files in the explorer with extensi

Re: pywin32 programming error on Win7 with shell.SHGetDesktopFolder, desktop.BindToObject, desktop.GetDisplayNameOf

2013-11-08 Thread iMath
在 2013年11月8日星期五UTC+8下午5时47分43秒,Tim Golden写道: > On 08/11/2013 03:30, iMath wrote: > > > > > > When running the following code on WinXP , all is fine , > > > -- > > > from win32co

Re: pywin32 programming error on Win7 with shell.SHGetDesktopFolder, desktop.BindToObject, desktop.GetDisplayNameOf

2013-11-08 Thread iMath
在 2013年11月8日星期五UTC+8下午5时47分43秒,Tim Golden写道: > On 08/11/2013 03:30, iMath wrote: > > > > > > When running the following code on WinXP , all is fine , > > > -- > > > from win32co

pywin32 programming error on Win7 with shell.SHGetDesktopFolder, desktop.BindToObject, desktop.GetDisplayNameOf

2013-11-07 Thread iMath
When running the following code on WinXP , all is fine , -- from win32com.shell import shell def launch_file_explorer(path, files): folder_pidl = shell.SHILCreateFromPath(path,0)[0] desktop = shell.SHGetDesktopFolder() shell

Resuming the HTTP Download of a File and HTTP compression

2013-08-07 Thread iMath
the file I want to download is 100 bytes uncompressed, the downloads was interrupted when 5000 bytes compressed data was transmitted .If I want to Resuming the HTTP Download ,I wonder what value of the HTTP Range header should be ,“bytes=5000-“ or “bytes= -”? why ? -- http://mail.python.org

Resuming the HTTP Download of a File and HTTP compression

2013-08-07 Thread iMath
the file I want to download is 100 bytes uncompressed, the downloads was interrupted when 5000 bytes compressed data was transmitted .If I want to Resuming the HTTP Download ,I wonder what value of the HTTP Range header should be ,“bytes=5000-“ or “bytes= -”? why ? -- http://mail.python.org

Re: how to detect the character encoding in a web page ?

2013-06-09 Thread iMath
在 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

Re: how to detect the character encoding in a web page ?

2013-06-09 Thread iMath
在 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

Re: how to detect the character encoding in a web page ?

2013-06-05 Thread iMath
在 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

Re: how to detect the character encoding in a web page ?

2013-06-05 Thread iMath
在 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

Re: how to detect the character encoding in a web page ?

2013-06-05 Thread iMath
在 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

use python to split a video file into a set of parts

2013-05-07 Thread iMath
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

python : how to Opens folder with specified items selected on Windows

2013-04-19 Thread iMath
I want to Opens folder with specified items selected on Windows ,I looked up the The Windows Shell Reference found a function fit for this job SHOpenFolderAndSelectItems http://msdn.microsoft.com/en-us/library/windows/desktop/bb762232(v=vs.85).aspx but I cannot find an example on how to use

Re: executor.map() TypeError: zip argument #2 must support iteration

2013-04-02 Thread iMath
在 2013年4月1日星期一UTC+8下午3时48分34秒,Steven D'Aprano写道: > On Sun, 31 Mar 2013 21:45:21 -0700, iMath wrote: > > > > > executor.map()TypeError: zip argument #2 must support iteration > > > > > > when I run it ,just generated TypeError: zip argument #2

executor.map() TypeError: zip argument #2 must support iteration

2013-03-31 Thread iMath
executor.map()TypeError: zip argument #2 must support iteration when I run it ,just generated TypeError: zip argument #2 must support iteration. can anyone help me fix this problem ? import time, concurrent.futures lst100=[i for i in range(100)] t1=time.clock() print(list(map(str,lst100))) t

changes on windows registry doesn’t take effect immediately

2013-03-14 Thread iMath
changes on windows registry doesn’t take effect immediately I am trying to change IE’s proxy settings by the following 2 code snippets to enable the proxy by this code from winreg import * with OpenKey(HKEY_CURRENT_USER,r"Software\Microsoft\Windows\CurrentVersion\Internet Settings" ,0, K

read and write the same text file

2013-03-09 Thread iMath
read and write the same text file Open a text file ,read the content ,then make some change on it ,then write it back to the file ,now the modified text should only has the modified content but not the initial content ,so can we implement this by only set the mode parameter with open() functio

which situations should we use thread. join() ?

2013-02-07 Thread iMath
which situations should we use thread. join() ? http://bpaste.net/show/yBDGfrlU7BDDpvEZEHmo/ why do we not put thread. join() in this code ? -- http://mail.python.org/mailman/listinfo/python-list

each process only has one main thread ,right ?

2013-02-06 Thread iMath
When a program starts up, one thread begins running immediately. This is usually called the main thread of the program ,so each process only has one main thread ,right ? -- http://mail.python.org/mailman/listinfo/python-list

how to change system-wide proxy settings by Python ?

2013-02-03 Thread iMath
I have already known a valid proxy server(63.141.216.159)and port(8087) which support both http and https protocols ,so how to change system-wide proxy settings to this proxy by Python ? I use WinXP ,can you show me an example of this ? thanks in advance ! -- http://mail.python.org/mailman/list

Re: [os.path.join(r'E:\Python', name) for name in []] returns []

2013-01-29 Thread iMath
在 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

[os.path.join(r'E:\Python', name) for name in []] returns []

2013-01-29 Thread iMath
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

what is the difference between commenting and uncommenting the __init__ method in this class?

2013-01-28 Thread iMath
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

anyone can make a Python bindings of VLC-Qt ?

2013-01-24 Thread iMath
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

Re: To make a method or attribute private

2013-01-20 Thread iMath
在 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

Re: To make a method or attribute private

2013-01-20 Thread iMath
在 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 > > > > &

To make a method or attribute private

2013-01-20 Thread 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: Beginning a variable name with a single underscore indicates that the variable should be treated

Re: How to implement mouse gesture by python or pyqt ?

2013-01-09 Thread iMath
在 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 ! > > >> > > >> >

How to call wget by python ?

2013-01-09 Thread iMath
can you give me an example code ? -- http://mail.python.org/mailman/listinfo/python-list

Re: how to download internet files by python ?

2013-01-09 Thread iMath
在 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

Re: How to get the selected text of the webpage in chrome through python ?

2013-01-09 Thread iMath
在 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

Re: How to implement mouse gesture by python or pyqt ?

2013-01-08 Thread iMath
在 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

  1   2   >