From wlq6037 at 163.com Mon Jul 13 04:57:59 2015 From: wlq6037 at 163.com (=?GBK?B?zfXA+8e/?=) Date: Mon, 13 Jul 2015 10:57:59 +0800 (CST) Subject: [python-win32] [issue570] [windows server 2003]Datagram Socket on windows server 2003 (python winsock not work well)) Message-ID: <56260036.6def.14e85590113.Coremail.wlq6037@163.com> -------- Forwarding messages -------- From: "johnny_wang" Date: 2015-07-10 17:33:58 To: wlq6037 at 163.com Subject: [issue570] [windows server 2003]Datagram Socket on windows server 2003 (python winsock not work well)) New submission from johnny_wang: when use: s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.setsockopt(socket.IPPROTO_IP, socket.IP_HDRINCL, 1) s.bind(('', 1029)) while True try : databuffer, (raddress, rport) = s.recvfrom(1024) except socket.timeout: logging.error("Write timeout on socket") continue databuffer is nothing in it! http://stackoverflow.com/questions/31316216/how-to-detect-or-capture-udp-packet-on-a-local-port69-with-python-on-windows ---------- messages: 2978 nosy: johnny_wang priority: bug status: unread title: [windows server 2003]Datagram Socket on windows server 2003 (python winsock not work well)) _______________________________________________________ PSF Meta Tracker _______________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From alan.gauld at btinternet.com Mon Jul 13 09:05:42 2015 From: alan.gauld at btinternet.com (Alan Gauld) Date: Mon, 13 Jul 2015 08:05:42 +0100 Subject: [python-win32] [issue570] [windows server 2003]Datagram Socket on windows server 2003 (python winsock not work well)) In-Reply-To: <56260036.6def.14e85590113.Coremail.wlq6037@163.com> References: <56260036.6def.14e85590113.Coremail.wlq6037@163.com> Message-ID: On 13/07/15 03:57, ??? wrote: > New submission from johnny_wang: > > when use: s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) > s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) > s.setsockopt(socket.IPPROTO_IP, socket.IP_HDRINCL, 1) > s.bind(('', 1029)) > while True > try : > databuffer, (raddress, rport) = s.recvfrom(1024) > except socket.timeout: > logging.error("Write timeout on socket") > continue > databuffer is nothing in it! How do you know? You read forever and never exit the loop (unless you get a different exception). You never do anything with databuffer. So how do you know there is nothing in it? Are you stepping through the code in a debugger maybe? If so tell us what you are doing to come to this conclusion. Or if this is only partial code show us something that we can run and reproduce the problem. And while you are doing that please give the Python version -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos From A.Holtz at gmx.net Mon Jul 13 23:40:00 2015 From: A.Holtz at gmx.net (Andreas Holtz) Date: Mon, 13 Jul 2015 23:40:00 +0200 Subject: [python-win32] printing landscape in Windows In-Reply-To: References: Message-ID: <55A43030.9070703@gmx.net> Think about using a batch print tool like http://www.verypdf.com/app/pdf-print-cmd/ or http://www.doc2prn.com/ I used the first one and implemented a Python script to create the command (it prints more than PDF). Some professional printer offer a webserver where you can upload the files. Check this, too. As you only want to print text files, you can use AutoIt to automate Notepad++ or the like. Set the default setting of the printer to landscape manually before. Regards Andreas Hans Becker schrieb am 10.06.2015 um 20:48: > Just about a month ago I started reading Learning Python by Mark Lutz. > It's a new paradigm for me. I have a whole bunch of old mainframe files > with carriage control characters as the 1st character in each line. > Well, a got a very simple script working except I need to be able to > print landscape on my pc printer. Does anyone by chance have sample code I > could cut and paste to print landscape? I'm running Windows 7 Pro and > Python 2.7 > > > #prt1a is a copy of prt11 > > import os, sys, tempfile > import win32api, win32print > > printer_name = win32print.GetDefaultPrinter () > hPrinter = win32print.OpenPrinter (printer_name) > > hJob = win32print.StartDocPrinter (hPrinter, 1, ('alfie', None, "RAW")) > win32print.StartPagePrinter (hPrinter) > > for line in open('alf1'): > cc = line[0] > line = line[1:] > line = line.rstrip() > > if cc == '1': line = '\f' + line > elif cc == ' ': line = '\n' + line > elif cc == '0': line = '\n\n' + line > elif cc == '-': line = '\n\n\n' + line > > line = line + '\r' # takes care of the overprinting > win32print.WritePrinter(hPrinter, line) > > win32print.WritePrinter(hPrinter,"\f") > win32print.EndPagePrinter (hPrinter) > win32print.EndDocPrinter (hPrinter) > win32print.ClosePrinter (hPrinter) > > > my test data 'alf1': > > 1 QWDDNNNDNDN > ++2 /111111111 > ++2a XXXXXXXX11 > 3 ZDDDDNDNDNNN > ++4 #/1111111111 > ++4a #XXXXXXXXX11 > ++4 b #WWWWWWWWWW1 > 5 MMMMMMNMMMMMMMMNMNNNNMNNNM > ++6 IIIIII1IIIIIIII1I1111I111I > ++6a IIIIII1IIIIIIII1I1111I111I > 7 NNMNNNNNNNNNNNNNNNNNNNNNMM > ++8 11I111111111111111111111II > 9 .......................... > 10 -------------------------- > 11 ;;;;;;;; > > > Thanks > > Hans Becker > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > From smitty1e at gmail.com Tue Jul 21 12:19:43 2015 From: smitty1e at gmail.com (Chris Smith) Date: Tue, 21 Jul 2015 10:19:43 +0000 Subject: [python-win32] SourceForge Mercrial Hosting Message-ID: Has the URL for a pywin32 checkout changed, or is their server on a walkabout? Thanks, Chris -- Cheers, Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at timgolden.me.uk Tue Jul 21 12:24:19 2015 From: mail at timgolden.me.uk (Tim Golden) Date: Tue, 21 Jul 2015 11:24:19 +0100 Subject: [python-win32] SourceForge Mercrial Hosting In-Reply-To: References: Message-ID: <55AE1DD3.1080502@timgolden.me.uk> They're having a major outage. TJG On 21/07/2015 11:19, Chris Smith wrote: > Has the URL for a pywin32 checkout changed, or is their server on a > walkabout? > Thanks, > Chris > -- > Cheers, > Chris > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > From trent at snakebite.org Fri Jul 31 22:14:43 2015 From: trent at snakebite.org (Trent Nelson) Date: Fri, 31 Jul 2015 16:14:43 -0400 Subject: [python-win32] PyParallel - an experimental "multicore" fork of Python 3 for Windows Message-ID: <20150731201443.GB24500@trent.me> Hi folks, Bit off-topic, but just wanted to let people know about an experimental proof-of-concept fork of Python 3 I've been working on for the past couple of years called PyParallel: http://pyparallel.org. It essentially gets around the GIL limitations and allows Python code to run simultaneously in multiple threads from within a single interpreter/process. It's Windows only -- so I figured it might be of interest to this list. It exclusively uses the threadpool APIs that got introduced in Vista, and has been built from the ground up to leverage the "Windows-way" of achieving high-performance socket I/O (using overlapped I/O *and* multiple cores to service completions -- not just polling GQCS() in a single-threaded event loop). The performance is pretty phenomenal and it's appearing to scale very linearly with CPU cores and I/O bandwidth, which is neat. The installer includes a PyParallel-compatible version of NumPy and pyodbc, so you can access large NumPy arrays or connect to databases in parallel callbacks. It's an experimental project though at heart -- don't go using it in production yet or anything. Regards, Trent. From bhood2 at comcast.net Fri Jul 31 23:05:14 2015 From: bhood2 at comcast.net (Bob Hood) Date: Fri, 31 Jul 2015 15:05:14 -0600 Subject: [python-win32] PyParallel - an experimental "multicore" fork of Python 3 for Windows In-Reply-To: <20150731201443.GB24500@trent.me> References: <20150731201443.GB24500@trent.me> Message-ID: <55BBE30A.8000304@comcast.net> On 7/31/2015 2:14 PM, Trent Nelson wrote: > Hi folks, > > Bit off-topic, but just wanted to let people know about an experimental > proof-of-concept fork of Python 3 I've been working on for the past > couple of years called PyParallel: http://pyparallel.org. It essentially > gets around the GIL limitations and allows Python code to run simultaneously > in multiple threads from within a single interpreter/process. > > It's Windows only -- so I figured it might be of interest to this list. > It exclusively uses the threadpool APIs that got introduced in Vista, > and has been built from the ground up to leverage the "Windows-way" of > achieving high-performance socket I/O (using overlapped I/O *and* > multiple cores to service completions -- not just polling GQCS() in a > single-threaded event loop). > > The performance is pretty phenomenal and it's appearing to scale very > linearly with CPU cores and I/O bandwidth, which is neat. The installer > includes a PyParallel-compatible version of NumPy and pyodbc, so you can > access large NumPy arrays or connect to databases in parallel callbacks. > > It's an experimental project though at heart -- don't go using it in > production yet or anything. Outstanding, Trent. Python's horrible multithreading support is something that has really kept it from being used in serious environments. Your work may not cover all platforms yet, but this is a great first step! Thanks for your efforts.