Re: remove path forever

2017-09-07 Thread eryk sun
On Thu, Sep 7, 2017 at 9:25 AM, Andrej Viktorovich wrote: > On Thursday, 7 September 2017 14:35:58 UTC+3, eryk sun wrote: >> On Thu, Sep 7, 2017 at 1:39 AM, Andrej Viktorovich >> wrote: >> > >> > I have 64 bit python on my windows 10 machine. Install contains

Re: remove path forever

2017-09-07 Thread eryk sun
On Thu, Sep 7, 2017 at 1:39 AM, Andrej Viktorovich wrote: > > I have 64 bit python on my windows 10 machine. Install contains 32 bit python > libs in path > and I would like to remove them. > > I do > imprt sys > sys.path.remove("C:\\Users\\me\\AppData\\Local\\Programs\\Python\\Python36-32") > >

Re: Python console's workspace path

2017-09-05 Thread eryk sun
On Tue, Sep 5, 2017 at 9:26 AM, Andrej Viktorovich wrote: > > I run Python 3.6 console under windows 10. Where is default console directory? The working directory for the console (i.e. conhost.exe) is irrelevant to Python. So I assume you mean the default working directory of the Python shell (i.

Re: ANN: psutil 5.3.0 with full unicode support is out

2017-09-03 Thread eryk sun
On Sun, Sep 3, 2017 at 11:09 PM, Giampaolo Rodola' wrote: > > This is an example which filters processes with a funky name which works > with both Python 2 > and 3: > > import psutil, sys > > PY3 = sys.version_info[0] == 2 > LOOKFOR = u"ƒőő.exe" > for proc in psutil.process_iter(at

Re: ANN: psutil 5.3.0 with full unicode support is out

2017-09-03 Thread eryk sun
On Sun, Sep 3, 2017 at 9:58 AM, Giampaolo Rodola' wrote: > > - #1040: all strings are encoded by using OS fs encoding. > - #1040: the following Windows APIs on Python 2 now return a string instead > of > unicode: > - Process.memory_maps().path > - WindowsService.bin_path() > - WindowsServi

Re: Run Windows commands from Python console

2017-09-03 Thread eryk sun
On Sun, Sep 3, 2017 at 7:56 AM, wrote: > > I run Python console in Windows. Can I run cmd prompt commands > there? Python doesn't know the first thing about CMD's "batch" language. Also, Python's shell (i.e. REPL) is not a system administration shell that implicitly runs external commands. You n

Re: Delay a computation in another thread

2017-09-02 Thread eryk sun
On Sat, Sep 2, 2017 at 5:53 AM, Steve D'Aprano wrote: > > The problem is that after the message is printed, the REPL's prompt is > disrupted. This is especially annoying when I'm in the middle of typing a > line. > This is just a cosmetic flaw, but it would be nice if I could tell Python to > red

Re: If you are running 32-bit 3.6 on Windows, please test this

2017-09-01 Thread eryk sun
On Fri, Sep 1, 2017 at 2:24 AM, Pavol Lisy wrote: > > I was trying to call sqrt using ctypes from msvcrt but I am not succesful: > > import ctypes > msc = ctypes.windll.msvcrt msvcrt.dll is private to Windows components. It's not intended for applications. See my previous post in this thread for

Re: If you are running 32-bit 3.6 on Windows, please test this

2017-09-01 Thread eryk sun
On Fri, Sep 1, 2017 at 3:23 AM, Peter Otten <__pete...@web.de> wrote: > > I think you have to specify the types yourself: > import ctypes libm = ctypes.cdll.LoadLibrary("libm.so") libm.sqrt(42) > 0 libm.sqrt.argtypes = [ctypes.c_double] libm.sqrt.restype = ctypes.c_double >

Re: Python 3 removes name binding from outer scope

2017-07-25 Thread eryk sun
On Tue, Jul 25, 2017 at 8:43 AM, Chris Angelico wrote: > > I'm not actually sure what happens if you use a global declaration at > top level. Is it ignored? Is it an error? It isn't ignored, but it shouldn't make a difference since normally at module level locals and globals are the same. It make

Re: Check Python version from inside script? Run Pythons script in v2 compatibility mode?

2017-07-07 Thread eryk sun
On Fri, Jul 7, 2017 at 7:53 AM, Steve D'Aprano wrote: > On Fri, 7 Jul 2017 04:30 pm, Ben S. wrote: > >> Is there a way to execute a python script with v3 python engine in v2 >> compatibility mode? I am thinking about a command parameter like (python.exe >> is v3.*): >> >> python.exe -execute_as_

Re: Python threading and sharing variables

2017-07-05 Thread eryk sun
On Wed, Jul 5, 2017 at 5:06 PM, Chris Angelico wrote: > On Thu, Jul 6, 2017 at 2:24 AM, eryk sun wrote: >>> But what could it do? Most likely, it's going to end up mutating a >>> dict (the core type), so unless the __setitem__ is itself maintaining >>> complex

Re: Python threading and sharing variables

2017-07-05 Thread eryk sun
On Wed, Jul 5, 2017 at 4:04 PM, Chris Angelico wrote: > On Thu, Jul 6, 2017 at 12:39 AM, eryk sun wrote: >>> This doesn't show a potential concurrency problem. Calculating a hash >>> on "cnt" is independent of other threads; the actual work of >>>

Re: Python threading and sharing variables

2017-07-05 Thread eryk sun
On Wed, Jul 5, 2017 at 2:03 PM, Chris Angelico wrote: > On Wed, Jul 5, 2017 at 11:50 PM, eryk sun wrote: >> Assignment of a single variable in an unoptimized namespace isn't >> completely immune to this -- in principle. Think __setitem__, >> __getitem__, __hash_

Re: Python threading and sharing variables

2017-07-05 Thread eryk sun
On Wed, Jul 5, 2017 at 12:14 PM, Peter Otten <__pete...@web.de> wrote: > Chris Angelico wrote: > >> You can be confident that a single assignment will happen atomically. >> Even if "self.cnt = i" requires multiple instructions to perform > > For name binding > > cnt = i > > maybe, but > > self.cnt

Re: Python installer

2017-06-30 Thread eryk sun
On Fri, Jun 30, 2017 at 8:30 PM, Debiller 777 wrote: > I just get error that there is no module name 'encodings' First make sure that neither PYTHONHOME nor PYTHONPATH are defined in your environment. To check this type `set python` in a command prompt. Neither variable should be listed. -- http

Re: sys.exc_info

2017-06-29 Thread eryk sun
On Thu, Jun 29, 2017 at 6:50 AM, Steven D'Aprano wrote: > try: > something > except: > exc_type, exc, tb = sys.exc_info() > print(traceback.extract_tb(tb)) > raise > > Why does it return the exception type separately from the exception, when > the type can be derived by calling `ty

Re: "Python launcher" required to run *.py scripts on Windows?

2017-06-27 Thread eryk sun
On Tue, Jun 27, 2017 at 5:41 AM, Ben S. via Python-list wrote: > > When I always call Python script from CommandPrompt like > > D:\tools\Python\python.exe mypythonscript.py > > then this Launcher should not be necessary. The launcher implements shebang support for directly running Python scripts

Re: Question about propagating universal_newlines through subprocess.Popen to io.TextIOWrapper

2017-06-26 Thread eryk sun
On Mon, Jun 26, 2017 at 8:59 PM, Bill Deegan wrote: > > Ideally (for my use case) it would be something which propagated > universal_newlines to io.TextIOWrapper().. rather than discards it. > In my case I want the stdout to be encoded utf-8, but I do not want \r's > changed to \n's as my test sys

Re: Question about propagating universal_newlines through subprocess.Popen to io.TextIOWrapper

2017-06-26 Thread eryk sun
On Mon, Jun 26, 2017 at 5:23 PM, Bill Deegan wrote: > > That universal_newlines value is discarded due to: > > text_mode = encoding or errors or universal_newlines > > ... > > if text_mode: > self.stdout = io.TextIOWrapper(self.stdout, > encoding=encoding, errors=errors) > > There

Re: Access flles on a Android device from Windows PC

2017-06-06 Thread eryk sun
On Tue, Jun 6, 2017 at 7:36 PM, Fred Fishbin wrote: > > I want to write little program that my friend can run - he'll plug a USB drive > into his Windows 7 PC, plug his phone in a USB port on same PC, then run my > program and it'll xfer some audiobook files over for him. > > I plugged the USB dri

Re: How to install Python package from source on Windows

2017-05-25 Thread eryk sun
On Thu, May 25, 2017 at 11:11 PM, Deborah Swanson wrote: > Unfortunately I deleted that message and now I no longer have a pip You still have ensurepip to be able to install and upgrade pip: python -m ensurepip --verbose --default-pip python -m pip install --upgrade pip Or use get-pip.p

Re: How to install Python package from source on Windows

2017-05-25 Thread eryk sun
On Thu, May 25, 2017 at 4:09 PM, Deborah Swanson wrote: > Could be, maybe it's something they do for every installation, whether > it will use it or not. But it always breaks when it can't install Visual > Studio. Upgrade pip does run and it works up to that point. It gets as > far as uninstalling

Re: How to install Python package from source on Windows

2017-05-24 Thread eryk sun
On Thu, May 25, 2017 at 12:18 AM, Deborah Swanson wrote: > > When I tried to upgrade pip it failed because it could neither > find nor install Visual Studio 2015. Installing and upgrading pip does not require a C compiler. > So now I'm pipless. Read the thread if you want to know why I don't hav

Re: How to install Python package from source on Windows

2017-05-22 Thread eryk sun
On Sun, May 21, 2017 at 5:40 PM, bartc wrote: > I think it was YOU that got me wasting time downloading that VS2015 > solution, all 1MB of it [download size; unknown installation size], Visual Studio installs a multi-architecture (x86, x64, arm, arm64) build environment for native and managed

Re: How to install Python package from source on Windows

2017-05-19 Thread eryk sun
On Fri, May 19, 2017 at 9:18 PM, bartc wrote: > On 19/05/2017 19:53, eryk sun wrote: >> >> On Fri, May 19, 2017 at 1:57 PM, bartc wrote: > > >>> The 'improvement' seems to involve making things more complicated rather >>> than less. > > &

Re: How to install Python package from source on Windows

2017-05-19 Thread eryk sun
On Wed, May 17, 2017 at 10:49 PM, Michael Torrie wrote: > > In fact Python 3.6 ships with the latest version of the MSVCRT universal > runtime. Windows Python 3.6 is distributed with vcruntime140.dll, which is a relatively small component of the CRT that's closely coupled to the compiler. The Un

Re: How to install Python package from source on Windows

2017-05-19 Thread eryk sun
On Fri, May 19, 2017 at 1:57 PM, bartc wrote: >> Yes, we acknowledge that there's much improvement needed to building >> Python, especially on Windows. > > The 'improvement' seems to involve making things more complicated rather > than less. > > (So I need VS2015, .NET, GIT, SVN and MSBUILD. Or ma

Re: How to install Python package from source on Windows

2017-05-15 Thread eryk sun
On Tue, May 16, 2017 at 12:51 AM, Chris Angelico wrote: > > The Python.org support policy is that Python X.Y will be > supported on Windows Z if and only if Windows Z was supported by > Microsoft as of when Python X.Y.0 was released. Python 3.4 is the last to support XP (2014-04-08 EOL). Python 3

Re: How to install Python package from source on Windows

2017-05-15 Thread eryk sun
On Mon, May 15, 2017 at 7:43 PM, MRAB wrote: > On 2017-05-15 13:52, eryk sun wrote: >> >> The wheel doesn't need a compiler. It has an ABI tag because it >> already includes the compiled extension module. >> > I used pip to install into Python 3.4 (32-bit) f

Re: How to install Python package from source on Windows

2017-05-15 Thread eryk sun
On Mon, May 15, 2017 at 6:37 AM, Deborah Swanson wrote: > > Where did you find recordclass-0.4.3-cp34-cp34m-win32.whl? There > weren't any win32 builds on https://pypi.python.org/pypi/recordclass. It's in the middle of the file list: recordclass-0.4.3-cp34-cp34m-win32.whl (md5) Python Wheel

Re: How to install Python package from source on Windows

2017-05-14 Thread eryk sun
On Mon, May 15, 2017 at 4:19 AM, Deborah Swanson wrote: > Unfortunately I don't have Visual Studio 2015+ installed and I can't > install it on Windows XP SP2 (plus I really don't want to). Probably I > should have mentioned that, but I didn't know I'd need to build C/C++. 3.5+ doesn't work in XP,

Re: How to install Python package from source on Windows

2017-05-14 Thread eryk sun
On Sun, May 14, 2017 at 8:46 PM, Deborah Swanson wrote: > I want to install the recordclass package: > https://pypi.python.org/pypi/recordclass > > But they've only released wheel files for two platforms, macosx and > win_amd64, neither of which will install on my system. I need win_x86 or > intel

Re: Out of memory while reading excel file

2017-05-12 Thread eryk sun
On Fri, May 12, 2017 at 8:03 PM, Peter Otten <__pete...@web.de> wrote: > I don't have a Windows system to test, but doesn't that mean that on Windows > > with open("tmp.csv", "w") as f: > csv.writer(f).writerows([["one"], ["two"]]) > with open("tmp.csv", "rb") as f: > print(f.read()) > > wo

Re: Embedded Python import fails with zip/egg files (v3.6.1)

2017-05-11 Thread eryk sun
On Thu, May 11, 2017 at 9:02 PM, Griebel, Herbert wrote: > > 07:59:04,3205458python.exe4224CreateFile > C:\Users\hansi\Downloads\python-emb\python36.zipSUCCESS Desired Access: > Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO > Non-Alert, Open Reparse Point

Re: Low level I/O: because I could

2017-05-10 Thread eryk sun
On Wed, May 10, 2017 at 10:30 PM, Rob Gaddi wrote: > Sorry, but I'm just too proud of this. > > Given that you have: > > class RegisterLayout(ctypes.Structure): > ...yadayadayada... > > You can then: > > fh = os.open('/dev/devicethingy', os.O_RDWR) > mm = mmap.mmap(fh, ctypes.sizeof(Regi

Re: Python 2.7: no such module pip

2017-05-05 Thread eryk sun
On Fri, May 5, 2017 at 4:57 PM, jeff saremi wrote: > > There is no such option in the installation. Please take a look at the > screenshot I enclosed. Sorry, I overlooked that you said you're installing "python-2.7.amd64.msi" -- as in 2.7.0. Please download and install 2.7.13: https://www.python

Re: Python 2.7: no such module pip

2017-05-05 Thread eryk sun
On Fri, May 5, 2017 at 4:30 PM, jeff saremi wrote: > i checked the installation again. There is no option to select or deselect > PIP. I installed with everything included. No pip module is present despite > the fact that Python documentation says that PIP is a part of Python > installation and do

Re: Python 2.7 on Windows: Copy&Paste install

2017-05-04 Thread eryk sun
On Thu, May 4, 2017 at 8:27 PM, jeff saremi wrote: > I have scoured the net for any hints on this. We have some prod machines > where we're not able to run MSI installations. > Is it possible to copy Python2.7 from say c:\Python2.7 from one machine to > another? > What other steps do we need bey

Re: Python 2.7: no such module pip

2017-05-04 Thread eryk sun
On Thu, May 4, 2017 at 8:24 PM, jeff saremi wrote: > Did a fresh install of python-2.7.amd64.msi on windows 10. > > The install finishes with success. Python runs. No pip when the following is > run: > > C:\> python -m pip install elastalert > C:\Python27\python.exe: No module named pip Maybe yo

Re: how to share/access variables from multiprocessing target function

2017-05-03 Thread eryk sun
On Wed, May 3, 2017 at 2:04 PM, Iranna Mathapati wrote: > how to share/access the " global returndict_st_FP,returndict_st_RP" target > function variables acors the main program.. You can share a dict using a Manager. https://docs.python.org/3/library/multiprocessing.html#managers -- https://ma

Re: tempname.mktemp functionality deprecation

2017-05-01 Thread eryk sun
On Sat, Apr 29, 2017 at 6:45 PM, Tim Chase wrote: > Working on some deduplication code, I want do my my best at > performing an atomic re-hard-linking atop an existing file, akin to > "ln -f source.txt dest.txt" > > However, when I issue > > os.link("source.txt", "dest.txt") > > it fails with an

Re: "Edit with IDLE" doesn't work any more ?

2017-04-28 Thread eryk sun
On Fri, Apr 28, 2017 at 12:32 PM, Yip, Kin wrote: > Traceback (most recent call last): > File "c:\Program Files\Python36\lib\idlelib\pyshell.py", line 4, in > from tkinter import * > File "C:\Users\kinyip\Desktop\Python Codes\tkinter.py", line 1, in > from turtle import * > File "c

Re: "Edit with IDLE" doesn't work any more ?

2017-04-28 Thread eryk sun
On Fri, Apr 28, 2017 at 12:04 PM, Yip, Kin wrote: > > I've tried to do : > > "c:\program files\python36\pythonw.exe" -m idlelibmypythoncodes.py Change this to use "python.exe" and run it from a command prompt. This way you can see the traceback if an exception is raised. -- https://mail.py

Re: Unable to subclass ctypes.c_uint64: was: Re: Battle of the garbage collectors, or ARGGHHHHHH!!!!

2017-04-27 Thread eryk sun
On Thu, Apr 27, 2017 at 8:55 PM, CFK wrote: > > I'm still working on fixing the battle of the garbage collectors, but as a > part of that work I've realized that it would be handy for me to subclass > various ctypes like so: > > """ > from ctypes import * > class foo(c_uint64): > def __init__(

Re: I encounter a problem during installations!!!

2017-04-26 Thread eryk sun
On Wed, Apr 26, 2017 at 2:51 PM, Paul Moore wrote: > > You could probably also install the UCRT manually from > https://www.microsoft.com/en-us/download/details.aspx?id=48234. KB3118401 is a more recent version. https://support.microsoft.com/en-us/kb/3118401 -- https://mail.python.org/mailman/

Re: String escaping utility for Python (was: Rawest raw string literals)

2017-04-22 Thread eryk sun
On Sun, Apr 23, 2017 at 2:06 AM, Mikhail V wrote: > > But are you joking, right? Even if it worked, how can this be convinient, > e.g. in console one cannot even select and copy paste easily. The X terminals that I've used make it easy to copy text to the clipboard. For Windows, it's a pain prior

Re: OrderedDict with kwds

2017-04-22 Thread eryk sun
On Fri, Apr 21, 2017 at 6:08 PM, Albert-Jan Roskam wrote: > Would the insertion order be preserved if the last line were to be > replaced with: > > if kwds: > for k, v in kwds.items(): > self[k] = v > if args: > self.__update(*args) # no **kwds! The basic problem is that kwds is

Re: Rawest raw string literals

2017-04-20 Thread eryk sun
On Thu, Apr 20, 2017 at 5:27 PM, Chris Angelico wrote: > On Fri, Apr 21, 2017 at 2:26 AM, wrote: >> I find this:- >> >> s = r"ffmpeg -i '\\server-01\D\SER_Bigl.mpg' " >> >> vastly superior. > > It's semantically different though. I don't know whether single quotes > are valid in that context, o

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread eryk sun
On Tue, Apr 18, 2017 at 1:37 AM, MRAB wrote: > In Python 3 it's: > > c = next(itertools.dropwhile( > lambda c: c==' ', > iter(lambda: sys.stdin.read(1),None) > )) iter's sentinel should be an empty string. -- https://mail.python.org/mailman/listinfo/python-list

Re: Unable to use Python IDLE after downloading the application

2017-04-17 Thread eryk sun
On Mon, Apr 17, 2017 at 9:06 PM, ASHISH A wrote: > > I could not launch IDLE and it gave me an error saying DLL file missing > (attached snapshot). python-list doesn't send attachments. Please do your best to paraphrase error messages that can't be pasted as plain text. > I have downloaded the D

Re: Buffers and pointers (Py3.4)

2017-04-17 Thread eryk sun
On Mon, Apr 17, 2017 at 5:58 PM, Rob Gaddi wrote: > buffertype = c_uint8 * size > return addressof(buffertype.from_buffer(buf, offset)) > > works but is inefficient and woefully inelegant. A lot of the cost there is in creating buffertype, but why do you need that? You can use c_char.from_buffer

Re: Check multiple file parms in single os.access?

2017-04-13 Thread eryk sun
On Thu, Apr 13, 2017 at 1:46 PM, Ben Bacarisse wrote: > James McMahon writes: > >> Is there a way to mask the F_OK, R_OK, and W_OK in a single os.access >> call? I'm guessing there must be, rather than doing this >> >> if ( os.access(fqfname,os.F_OK) and os.access(fqfname,os.R_OK) and >> os.acces

Re: Calling dunder methods manually

2017-04-13 Thread eryk sun
On Thu, Apr 13, 2017 at 8:24 AM, Chris Warrick wrote: > On 13 April 2017 at 09:43, eryk sun wrote: >> The functions in the operator module implement abstract behavior (e.g. >> PyNumber_Add in CPython): >> >> >>> operator.__add__(C(), D()) >>

Re: Calling dunder methods manually

2017-04-13 Thread eryk sun
On Thu, Apr 13, 2017 at 5:29 AM, Steven D'Aprano wrote: > > my_number.__add__(another_number) > > The short answer is: > > NO! In general, you shouldn't do it. For example: class C: def __add__(self, other): return NotImplemented class D: def __radd__(self, o

Re: Calling dunder methods manually

2017-04-13 Thread eryk sun
On Thu, Apr 13, 2017 at 5:29 AM, Steven D'Aprano wrote: > Should you call dunder methods (Double leading and trailing UNDERscores) > manually? For example: > > > my_number.__add__(another_number) > > > The short answer is: > > NO! In general, you shouldn't do it. > > > Guido recently commented: >

Re: IOError: [Errno 12] Not enough space

2017-04-11 Thread eryk sun
On Tue, Apr 11, 2017 at 12:30 PM, LnT wrote: > Opening browser 'firefox' to base url 'https://onbdev.nbpa.com/zae' > [ WARN ] Keyword 'Capture Page Screenshot' could not be run on failure: > No browser is open > | FAIL | > IOError: [Errno 12] Not enough space >

Re: Installing Python 3.6.1 on a Windows 10

2017-04-10 Thread eryk sun
On Mon, Apr 10, 2017 at 3:45 PM, Colin J. Williams wrote: > Below is the tail of my Install Log. > Is this a problem that I should be able to resolve? > Advice sought. Open a Windows / Installation issue on bugs.python.org. Zip up the installation logs and attach the zip to the issue. -- https:/

Re: Problem installing 3.6.1 AMD64

2017-04-05 Thread eryk sun
On Thu, Apr 6, 2017 at 12:12 AM, MRAB wrote: import os [p for p in os.environ['PATH'].split(';') if 'Python35' in p] > > Remove those references from the PATH environment variable: > os.environ['PATH'] = ';'.join(p for p in os.environ['PATH'].split(';') if 'Python35' not in p)

Re: Problem installing 3.6.1 AMD64

2017-04-05 Thread eryk sun
On Wed, Apr 5, 2017 at 6:46 PM, Colin J. Williams wrote: >Successful install reported, but: > > Microsoft Windows [Version 10.0.14393] > (c) 2016 Microsoft Corporation. All rights reserved. You're using Windows 10. > C:\Users\CJW>cd\python > The system cannot find the pat

Re: Which directory should requests and openpyxl modules be installed to?

2017-04-03 Thread eryk sun
On Tue, Apr 4, 2017 at 1:45 AM, Dennis Lee Bieber wrote: > > C:\Users\Wulfraed>assoc .py > .py=Python.File > > C:\Users\Wulfraed>ftype python.file > python.file="C:\Python27\python.exe" "%1" %* The Windows shell stores the user file-association choice in HKCU\Software\Microsoft\Windows\CurrentVer

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread eryk sun
On Mon, Apr 3, 2017 at 1:20 PM, Paul Moore wrote: > On Monday, 3 April 2017 14:00:18 UTC+1, eryk sun wrote: >> It should service the request and return to the serve_forever() loop. >> Do you see a line logged for each request, like "[IP] - - [date] "GET >> ...&quo

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread eryk sun
On Mon, Apr 3, 2017 at 12:34 PM, Paul Moore wrote: > On Monday, 3 April 2017 13:23:11 UTC+1, eryk sun wrote: >> It works for me when run from a command prompt in Windows 10. >> serve_forever() uses select() with a timeout of 0.5s, so it doesn't >> block the main t

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread eryk sun
On Mon, Apr 3, 2017 at 9:08 AM, Paul Moore wrote: > I know I've seen this before, but for the life of me I can't find any > reference. > > If I write a simple web server using wsgiref, something like > > from wsgiref.simple_server import make_server, demo_app > > with make_server('', 800

Re: VirtualEnvs (venv) and Powershell

2017-04-01 Thread eryk sun
On Sat, Apr 1, 2017 at 12:03 AM, Carl Caulkett wrote: > I've just started to investigate VirtualEnvironments as a means of > preventing my 3rd party code becoming chaotic. I've discovered that > venv's can be managed quite effectively using Powershell. When > Activate.ps1 is run, the PowerShell ch

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread eryk sun
On Sat, Apr 1, 2017 at 5:38 PM, Steve D'Aprano wrote: > Or, for Windows, I suppose a dozen or so more characters: > > https://support.office.com/en-us/article/Invalid-characters-in-file-or-folder-names-or-invalid- > file-types-in-OneDrive-for-Business-64883A5D-228E-48F5-B3D2-EB39E07630FA It's mor

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread eryk sun
On Sat, Apr 1, 2017 at 4:55 PM, Chris Angelico wrote: > On Sun, Apr 2, 2017 at 2:43 AM, Marko Rauhamaa wrote: >> Steve D'Aprano : >> >>> Open your eyes, there is a whole world past the borders of your insular, >>> close-minded little country. 95% of the world is not American, and there >>> are mi

Re: Python under PowerShell adds characters

2017-03-29 Thread eryk sun
On Wed, Mar 29, 2017 at 7:13 PM, Marko Rauhamaa wrote: > eryk sun : >> PowerShell is far more invasive. Instead of giving the child process a >> handle for the file, it gives it a handle for a *pipe*. PowerShell >> reads from the pipe, and like an annoying busybody that no

Re: Python under PowerShell adds characters

2017-03-29 Thread eryk sun
On Wed, Mar 29, 2017 at 5:42 PM, Jay Braun wrote: > > I'm not using ISE. I'm using a pre-edited script, and running it with the > python command. > > Consider the following simple script named hello.py (Python 2.7): > > print "Hello" > > If I enter: > python hello.py > out.txt > > from cmd.exe I

Re: Python under PowerShell adds characters

2017-03-29 Thread eryk sun
On Wed, Mar 29, 2017 at 4:06 PM, wrote: > I wrote a Python script, which executed as intended on Linux and > from cmd.exe on Windows. Then, I ran it from the PowerShell >command line, all print statements added ^@ after every character. ISE is the only command-line environment that's specific t

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread eryk sun
On Sun, Mar 26, 2017 at 6:57 PM, Chris Angelico wrote: > > In actual UCS-2, surrogates are entirely disallowed; in UTF-16, they *must* be > correctly paired. Strictly-speaking UCS-2 disallows codes that aren't defined by the standard, but the kernel couldn't be that restrictive. Unicode was a mov

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread eryk sun
On Sun, Mar 26, 2017 at 5:49 PM, eryk sun wrote: > On Sun, Mar 26, 2017 at 5:29 PM, Chris Angelico wrote: >> Rounded corners? >> >> ╭─┬─╮ >> ├─┼─┤ >> ╰─┴─╯ > > This prints fine in the Windows console with Consolas as the font, but > the older Courier Ne

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread eryk sun
On Sun, Mar 26, 2017 at 5:58 PM, Chris Angelico wrote: >> The Windows console can render any character in the BMP, but it >> requires configuring font linking for fallback fonts. It's Windows, so >> of course the supported UTF format is UTF-16. The console's UTF-8 >> support (codepage 65001) is to

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread eryk sun
On Sun, Mar 26, 2017 at 5:29 PM, Chris Angelico wrote: > Rounded corners? > > ╭─┬─╮ > ├─┼─┤ > ╰─┴─╯ This prints fine in the Windows console with Consolas as the font, but the older Courier New and Lucida Console fonts lack glyphs for the rounded corners. -- https://mail.python.org/mailman/listin

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread eryk sun
On Sun, Mar 26, 2017 at 3:37 PM, Chris Angelico wrote: > > Just use Unicode. Everything else, these days, is a subset of Unicode > anyway. Unless you're stuck on the default Windows shell/terminal, you > should be able to use UTF-8 everywhere and have the entire Unicode > range available. The Win

Re: Installation issue with Python 3.6.1 for 64 bit Windows

2017-03-26 Thread eryk sun
On Sun, Mar 26, 2017 at 4:01 AM, arjun.janah wrote: > > I ran the file and it appeared to install properly. But when I tried to run > Python from > the Windows All Programs menu tab, I got the following message, in a small > window by the window with a black screen: >

Re: Subprocess .wait() is not waiting

2017-03-24 Thread eryk sun
On Fri, Mar 24, 2017 at 8:44 PM, adam.c.bernier wrote: > On Friday, March 24, 2017 at 1:37:49 PM UTC-7, eryk sun wrote: > >> Without knowing the command you're running, all we can do is >> speculate. It could be that it's an application that uses a single >&g

Re: Subprocess .wait() is not waiting

2017-03-24 Thread eryk sun
On Fri, Mar 24, 2017 at 8:24 PM, Ian Kelly wrote: > On Fri, Mar 24, 2017 at 2:09 PM, Chris Angelico wrote: > >> Errr been a while since I messed with Windows from memory, I >> think you can "start /wait programname" to make it wait?? Worth a try, >> at least. > > start /wait is for batch

Re: Subprocess .wait() is not waiting

2017-03-24 Thread eryk sun
On Fri, Mar 24, 2017 at 6:42 PM, adam.c.bernier wrote: > > I am on Windows 7. Python 2.7 > > I'm trying to have a program run another program using `subprocess.Popen` > > import subprocess as sp > > args = shlex.split(args) Is this command supposed to run cross-platform? If not, then spli

Re: python script Non-ASCII character

2017-03-19 Thread eryk sun
On Sun, Mar 19, 2017 at 11:06 PM, MRAB wrote: > > If you're using Unicode string literals, your choices are: > > 1. Raw string literals: > > var1 = ur"C:\Users\username\Desktop\η γλωσσα μου\mylanguage\myfile" Raw unicode literals are practically useless in Python 2. They're not actually raw b

Re: When will os.remove fail?

2017-03-14 Thread eryk sun
On Tue, Mar 14, 2017 at 10:05 PM, Dennis Lee Bieber wrote: > On Wed, 15 Mar 2017 00:07:32 +1100, Chris Angelico > >>Yes, but you can't always control the process that opens them. For >>example, it's annoyingly difficult to update a running executable. >> > I wouldn't be surprised if Windows mmap(

Re: When will os.remove fail?

2017-03-14 Thread eryk sun
On Tue, Mar 14, 2017 at 7:01 PM, Grant Edwards wrote: > > 1. I think I can see the VMS heritage of Windows shining through. That's not surprising considering that VMS and NT have the same architect -- Dave Cutler -- and that I/O system and file systems were design by former DEC programmers that h

Re: When will os.remove fail?

2017-03-14 Thread eryk sun
On Tue, Mar 14, 2017 at 1:07 PM, Chris Angelico wrote: > On Tue, Mar 14, 2017 at 10:32 PM, Steve D'Aprano > wrote: > >> I take it that you *can* delete open files, but only if the process that >> opens them takes special care to use "delete sharing". Is that correct? > > Yes, but you can't always

Re: When will os.remove fail?

2017-03-14 Thread eryk sun
On Tue, Mar 14, 2017 at 11:32 AM, Steve D'Aprano wrote: > On Mon, 13 Mar 2017 08:47 pm, eryk sun wrote: > >> One hurdle to getting delete access is the sharing mode. If there are >> existing File objects that reference the file, they all have to share >> delete acc

Re: When will os.remove fail?

2017-03-13 Thread eryk sun
On Sun, Mar 12, 2017 at 5:48 PM, Steve D'Aprano wrote: > > Does os.remove work like this under Windows too? os.remove calls DeleteFile on Windows. This in turn calls NtOpenFile to instantiate a kernel File object that has delete access and return a handle to it. Next it calls NtSetInformationFile

Re: Compiling new Pythons on old Windows compilers

2017-03-12 Thread eryk sun
On Sun, Mar 12, 2017 at 5:02 PM, Eric Frederich wrote: > Any idea why compatibility was dropped recently? There used to be a PC > directory with different VS directories in the source tree, now it isn't > there any more. CPython 3.5+ uses the Universal CRT on Windows, which is a system component

Re: No module named 'encodings' Python 3.6 on Windows 10 failure

2017-03-07 Thread eryk sun
On Wed, Mar 8, 2017 at 1:24 AM, wrote: > > Every attempt to make Python 3.6.0 or 3.6.1rc1 to run on Windows 10 > has resulted in the error message shown below. I was running Python > 3.5.2 successfully and wanted to upgrade. > > C:\Python36-32>python > Fatal Python error: Py_Initialize: unable t

Re: Importing with ctypes in Python: fighting overflows

2017-03-07 Thread eryk sun
On Tue, Mar 7, 2017 at 12:45 PM, wrote: > Importing with ctypes in Python: fighting overflows: > https://www.cossacklabs.com/blog/fighting-ctypes-overflows.html C int is 32-bit on all platforms currently supported by CPython -- both 32-bit and 64-bit. It's the default result type and the default

Re: Export Event log via python in .txt

2017-03-06 Thread eryk sun
On Mon, Mar 6, 2017 at 3:36 PM, wrote: > I'm a student learning about python I would like to know how to export > Security log Application and generate folder path via python please help If you're asking about the Windows event logs, then it'll be easiest from a scripting POV to use wevtutil.exe

Re: How to access installed scripts on Windows?

2017-03-05 Thread eryk sun
On Sun, Mar 5, 2017 at 2:35 AM, ddbug wrote: > >> You can also develop using venv virtual environments. You can symlink >> or shell-shortcut to the activation script of a virtual environment. > > Interesting idea. But I have not seen any installers or guidance how to > deploy something packaged >

Re: Odd wording it docs for shutil.move?

2017-03-03 Thread eryk sun
On Fri, Mar 3, 2017 at 5:13 PM, Grant Edwards wrote: > At https://docs.python.org/2/library/shutil.html it says: > > shutil.move(src, dst) > > Recursively move a file or directory (src) to another location > (dst). > > [...] > > If the destination is on the current filesystem, the

Re: Python 3.6 installation doesn't add launcher to PATH

2017-02-26 Thread eryk sun
On Sun, Feb 26, 2017 at 3:09 PM, ChrisW wrote: > On Saturday, 25 February 2017 07:21:30 UTC, eryk sun wrote: >> On Fri, Feb 24, 2017 at 12:38 PM, ChrisW wrote: >> > However, I've installed Python 3.6 with the 'include PATH' checkbox ticked >> > for my

Re: Python 3.6 installation doesn't add launcher to PATH

2017-02-24 Thread eryk sun
On Fri, Feb 24, 2017 at 12:38 PM, ChrisW wrote: > However, I've installed Python 3.6 with the 'include PATH' checkbox ticked > for my user only, and although C:\Windows\py.exe exists, it has not been > added to my PATH. > > I also tried installing for all users, and this also doesn't add it to the

Re: [Glitch?] Python has just stopped working

2017-02-23 Thread eryk sun
On Thu, Feb 23, 2017 at 8:14 AM, wrote: > W dniu wtorek, 16 lutego 2016 21:09:50 UTC+1 użytkownik Theo Hamilton napisał: >> I woke up two days ago to find out that python literally won't work any >> more. I have looked everywhere, asked multiple Stack Overflow questions, >> and am ready to give u

Re: Python application launcher (for Python code)

2017-02-21 Thread eryk sun
On Tue, Feb 21, 2017 at 1:25 AM, Steve D'Aprano wrote: > (2) Add each category to the PYTHONPATH. One easy way to do so is by adding > the directories to a .pth file. PYTHONPATH isn't a synonym for sys.path. The PYTHONPATH environment variable gets used by every installed interpreter, which can b

Re: How to access installed scripts on Windows?

2017-02-18 Thread eryk sun
On Sat, Feb 18, 2017 at 8:38 PM, ddbug wrote: > I am very perplexed by inability to tell the Windows installer (bdist_wininst > or pip) where to > install scripts (or "entry points"). > > By default (and I don't see other options) scripts go to > %USERPROFILE%/Appdata/Roaming/Python/Scripts. Tha

Re: os.path.isfile

2017-02-12 Thread eryk sun
On Sun, Feb 12, 2017 at 4:29 AM, Chris Angelico wrote: > Registry subkeys aren't paths, and the other two cases are extremely > narrow. Convert slashes to backslashes ONLY in the cases where you > actually need to. \\?\ paths are required to exceed MAX_PATH (a paltry 260 characters) or to avoid q

Re: Rename file without overwriting existing files

2017-02-12 Thread eryk sun
On Sun, Feb 12, 2017 at 4:09 AM, Steve D'Aprano wrote: > On Fri, 10 Feb 2017 12:07 am, eryk sun wrote: > >> On Thu, Feb 9, 2017 at 11:46 AM, Steve D'Aprano >> wrote: >>> >>> So to summarise, os.rename(source, destination): >>> >>>

Re: os.path.isfile

2017-02-11 Thread eryk sun
On Sun, Feb 12, 2017 at 3:52 AM, Steve D'Aprano wrote: > In Python, you should always use forward slashes for paths, even on Windows. There are cases where slash doesn't work (e.g. some command lines; \\?\ prefixed paths; registry subkey paths), so it's simpler to follow a rule to always convert

Re: os.path.isfile

2017-02-10 Thread eryk sun
On Fri, Feb 10, 2017 at 9:09 PM, Vincent Vande Vyvre wrote: > Le 10/02/17 à 22:03, Vincent Vande Vyvre a écrit : >> Le 10/02/17 à 21:36, Peter Otten a écrit : >>> Vincent Vande Vyvre wrote: Le 10/02/17 à 19:11, epro...@gmail.com a écrit : > > Python 3.5.2 > > Windows 10 >

<    1   2   3   4   5   6   7   >