On 5/26/2023 8:30 PM, giuseppacef...@gmail.com wrote:
I have reinstalled python which reinstalls pip. I have added the
path:'C:\sers\Giuseppa\AppData\Local\Packages\PythonSoftwareFoundation.Pytho
n.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts and still
get the error below. Coul
On 2023-05-27 01:30, giuseppacef...@gmail.com wrote:
I have reinstalled python which reinstalls pip. I have added the
path:'C:\sers\Giuseppa\AppData\Local\Packages\PythonSoftwareFoundation.Pytho
n.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts and still
get the error below. Could
On 1/26/23, Olivier B. wrote:
>
> Does someone know why it would have been chosen to be different for
> debug builds?
It's assumed that a debug build would normally link with
"pythonXY_d.dll". Maybe it should be more defensive. Refer to the
following setup in PC/pyconfig.h:
/* For an MSVC DL
On 6/17/21 1:53 AM, Joachim Wuttke wrote:
How to write a platform-independent CMake install command
to install a Swig-generated Python module?
The following brings us very close to a solution:
```
execute_process(
COMMAND "${Python3_EXECUTABLE}"
-c "from distutils import sysconfig as s
On 10/29/20 11:07 AM, Gian_Xatzak. wrote:
>Hello!!
>
>
>
>I just download the latest version of python3 (Python3.9) and I have
>problem to download NumPy,… etc.
There are projects who have not released their 3.9-compatible wheels yet
- the schedule for doing so is up to each of
Op 09-09-2020 om 07:35 schreef James Moe via Python-list:
python 3.6.10
opensuse tumbleweed
Tumbleweed is a rolling distro, so that is extremely old for Tumbleweed.
I would expect Python 3.8.4 or 3.8.5 to be current there.
If you want to use another version, you would have to run in a virtual
> On 9 Sep 2020, at 06:35, James Moe via Python-list
> wrote:
>
> python 3.6.10
> opensuse tumbleweed
> linux 5.8.4
>
> An old program based on Python (BackInTime) has recently been having
> difficulties functioning. See below.
>
> Module PyQt5 is most definitely installed. Apparently there
On Aug 9, 2020 11:41 AM, "Mats Wichmann" wrote:
>
> On 8/9/20 12:51 AM, Gabor Urban wrote:
> > Hi guys,
> >
> > I have a quite simple question but I could not find the correct answer.
> >
> > I have twoo modules A and B. A imports B. If I import A in a script,
Will
> > be B imported automatically?
Hi guys,
Thanks for the answers. IT is clear Noé.
Gábor
--
https://mail.python.org/mailman/listinfo/python-list
On 8/9/20 12:51 AM, Gabor Urban wrote:
> Hi guys,
>
> I have a quite simple question but I could not find the correct answer.
>
> I have twoo modules A and B. A imports B. If I import A in a script, Will
> be B imported automatically? I guess not, but fő not know exactly.
>
> Thanks for your ans
Gabor Urban writes:
> Hi guys,
>
> I have a quite simple question but I could not find the correct answer.
>
> I have twoo modules A and B. A imports B. If I import A in a script, Will
> be B imported automatically? I guess not, but fő not know exactly.
>
> Thanks for your answer ín advance,
#+B
I'm not a professional coder. I'm an environmental consultant and I use a
I take it all back then...
No! No need to feel apologetic, the Python community works hard to be
inclusive - which I take to include levels of expertise, not merely
countering the various "-isms".
variety of tools de
On Fri, 27 Mar 2020, DL Neil via Python-list wrote:
My personal approach is to follow 'the Zen of Python' and prefer
"explicit" over "implicit". (it helps beginners, as well as us old-fogies
whose minds cannot retain things for very long)
DL,
That was my original approach.
I see little poin
Rich,
On 26/03/20 9:09 AM, Rich Shepard wrote:
I'm writing an application using Python3 and Tkinter. The views/ directory
contain multiple modules, including one called commonDlgs.py. This contains
classes (such as those for validating data entry) used by all the data
entry
views. Some classe
On Thu, 26 Mar 2020, Schachner, Joseph wrote:
I can only tell you my preference. I prefer that Python modules be as
self-contained as possible, because "global" is within a module; to share
between modules you have to import something, as you know.
Joseph,
This makes good sense. I don't know
On Monday, 27 August 2018 22:45:47 UTC+5:30, Peter Otten wrote:
> Sharan Basappa wrote:
>
> > I am running a program that I got as reference from GitHub.
> > I am running on windows OS.
> >
> > Here is a snippet of the code (initial few lines).
> >
> > #!/usr/bin/env python
> > # -*- coding: ut
Sharan Basappa wrote:
> I am running a program that I got as reference from GitHub.
> I am running on windows OS.
>
> Here is a snippet of the code (initial few lines).
>
> #!/usr/bin/env python
> # -*- coding: utf-8 -*-
> __author__ = 'Shilin He'
>
> import sys
> sys.path.insert(0, 'D:\Project
On Mon, Aug 27, 2018 at 11:20 AM, Sharan Basappa
wrote:
> I am running a program that I got as reference from GitHub.
> I am running on windows OS.
>
> Here is a snippet of the code (initial few lines).
>
> #!/usr/bin/env python
> # -*- coding: utf-8 -*-
> __author__ = 'Shilin He'
>
> import sys
>
On Tuesday, 8 May 2018 13:05:58 UTC+5:30, Steven D'Aprano wrote:
> On Mon, 07 May 2018 09:53:45 -0700, Sharan Basappa wrote:
>
> > I am a bit confused between module and package in Python. Does a module
> > contain package or vice versa? When we import something in Python, do we
> > import a modu
On Mon, 07 May 2018 09:53:45 -0700, Sharan Basappa wrote:
> I am a bit confused between module and package in Python. Does a module
> contain package or vice versa? When we import something in Python, do we
> import a module or a package?
The term "module" in Python has multiple meanings:
- a pa
Sharan Basappa writes:
> One question. So, we can import the entire package or just a module in
> a given package. Is this correct?
Each time you ‘import foo’, you are getting a module.
> For example,
> import nltk
That results in a module object, and you can use the name ‘nltk’ to
reference t
MRAB, ChirisA,
One question. So, we can import the entire package or just a module in a given
package. Is this correct?
For example,
import nltk
import nltk.stem
--
https://mail.python.org/mailman/listinfo/python-list
On Monday, 7 May 2018 23:09:41 UTC+5:30, Chris Angelico wrote:
> On Tue, May 8, 2018 at 2:53 AM, Sharan Basappa
> wrote:
> > I am a bit confused between module and package in Python.
> > Does a module contain package or vice versa?
> > When we import something in Python, do we import a module or
On Tue, May 8, 2018 at 2:53 AM, Sharan Basappa wrote:
> I am a bit confused between module and package in Python.
> Does a module contain package or vice versa?
> When we import something in Python, do we import a module or a package?
You import a module.
A package is one particular form of modu
On 2018-05-07 17:53, Sharan Basappa wrote:
I am a bit confused between module and package in Python.
Does a module contain package or vice versa?
When we import something in Python, do we import a module or a package?
A module is a file. A package is a collection of one or more modules.
--
http
Abdur-Rahmaan Janhangeer writes:
> i have a project at
>
> https://github.com/Abdur-rahmaanJ/honeybot
>
> see https://github.com/Abdur-rahmaanJ/honeybot/tree/master/honeybot
>
> my question is :
>
> how to include a util file / module that can be imported in both
> core_plugins and
> user_plugins?
I too facing the same issue related to pip file for other models
installation.
Installed Python 3.6.3 Amd64 in Windows 10 OS.
Want to install Tensor flow using native pip as suggested...
But, observed that pip3 file in Scripts folder is missing. Also, Scripts
folder is empty.
On 7 Dec 2017 3:02
On Thu, 7 Dec 2017 07:59 am, Bryan Zimmer wrote:
> I have been getting this message, "No module named '_socket'", since I
> installed python 3.6, about two months ago.
>
> My platform is Slackware Linux (14.2). I compiled python3.6 from source,
> because binary python packages aren't distributed
On Thu, Dec 7, 2017 at 7:59 AM, Bryan Zimmer wrote:
> I have been getting this message, "No module named '_socket'", since I
> installed python 3.6, about two months ago.
>
> My platform is Slackware Linux (14.2). I compiled python3.6 from source,
> because binary python packages aren't distribute
On Saturday, April 15, 2017 at 3:18:58 PM UTC+8, Peter Otten wrote:
> Ho Yeung Lee wrote:
>
> > Python 2.7.6 (default, Jun 22 2015, 18:00:18)
> > [GCC 4.8.2] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> import ssl
> > Traceback (most recent call last)
Ho Yeung Lee wrote:
> Python 2.7.6 (default, Jun 22 2015, 18:00:18)
> [GCC 4.8.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
import ssl
> Traceback (most recent call last):
> File "", line 1, in
> File "/home/martin/Documents/ssl.py", line 13, in
On Tue, Apr 5, 2016 at 5:26 PM, Steven D'Aprano
wrote:
>>> sys.modules isn't really a cache in that sense, though. The "hard
>>> problem" of cache invalidation comes from the fundamental assumption
>>> that a cache hit should be semantically identical to a cache miss;
>>
>> Following looks like a
On Tuesday 05 April 2016 14:27, Rustom Mody wrote:
> On Tuesday, April 5, 2016 at 9:53:30 AM UTC+5:30, Chris Angelico wrote:
>> On Tue, Apr 5, 2016 at 2:08 PM, Rustom Mody wrote:
>> >> 'import tk.ttk' looks for 'tk' in sys.modules, does not find it, looks
>> >> for a module named 'tk' on disk, do
On Tuesday, April 5, 2016 at 9:53:30 AM UTC+5:30, Chris Angelico wrote:
> On Tue, Apr 5, 2016 at 2:08 PM, Rustom Mody wrote:
> >> 'import tk.ttk' looks for 'tk' in sys.modules, does not find it, looks
> >> for a module named 'tk' on disk, does not find it, and says so.
> >
> > A well-known quote c
On Tue, Apr 5, 2016 at 2:08 PM, Rustom Mody wrote:
>> 'import tk.ttk' looks for 'tk' in sys.modules, does not find it, looks
>> for a module named 'tk' on disk, does not find it, and says so.
>
> A well-known quote comes to mind:
>
> | There are only two hard things in Computer Science: cache inva
On Tuesday, April 5, 2016 at 2:17:24 AM UTC+5:30, Terry Reedy wrote:
> On 4/4/2016 11:31 AM, ast wrote:
> > hello
> >
> import tkinter as tk
> import tk.ttk as ttk
> >
> > Traceback (most recent call last):
> > File "", line 1, in
> > import tk.ttk as ttk
> > ImportError: No module
On 4/4/2016 11:31 AM, ast wrote:
hello
import tkinter as tk
import tk.ttk as ttk
Traceback (most recent call last):
File "", line 1, in
import tk.ttk as ttk
ImportError: No module named 'tk'
of course
import tkinter.ttk as ttk
works
Strange, isn't it ?
Nope. As other said, 'im
On Tue, 5 Apr 2016 01:31 am, ast wrote:
> hello
>
import tkinter as tk
import tk.ttk as ttk
>
> Traceback (most recent call last):
> File "", line 1, in
> import tk.ttk as ttk
> ImportError: No module named 'tk'
>
>
> of course
>
import tkinter.ttk as ttk
>
> works
>
>
On Monday, April 4, 2016 at 11:31:41 AM UTC-4, ast wrote:
> hello
>
> >>> import tkinter as tk
> >>> import tk.ttk as ttk
>
> Traceback (most recent call last):
> File "", line 1, in
> import tk.ttk as ttk
> ImportError: No module named 'tk'
>
>
> of course
>
> >>> import tkinter.ttk as
On Fri, Aug 14, 2015 at 12:25 PM, Joseph L. Casale
wrote:
> Yeah that wasn't clear. The plugins are invoked in fresh interpreter processes
> and hence modules with import side effects or simply large modules can
> manifest over time.
If they're invoked in fresh processes, then you're looking at p
> Importing is not the same as instantiation.
>
> When you import a module, the code is only read from disk and instantiated
> the first time. Then it is cached. Subsequent imports in the same Python
> session use the cached version.
I do mean imported, in the original design there were many ctype
On Fri, 14 Aug 2015 07:12 am, Joseph L. Casale wrote:
>> What makes you think the import might be a problem? That's a one-time
>> thing. Or is your application a command-line tool or so that needs to
>> start and terminate quickly?
>
> The code is used within plugin points and soon to be asynchro
Hi Stefan,
> How is the DLL binding implemented? Using "ctypes"? Or something else?
It is through ctypes.
> Obviously, instantiating a large ctypes wrapper will take some time. A
> binary module would certainly be quicker here, both in terms of import time
> and execution time. Since you're gene
Joseph L. Casale schrieb am 13.08.2015 um 18:56:
> I have an auto generated module that provides functions exported from a
> c dll. Its rather large and we are considering some dynamic code generation
> and caching, however before I embark on that I want to test import times.
>
> As the module is
On 10/07/2015 01:04, Marko Rauhamaa wrote:
Chris Angelico :
Your descriptions conflict. A safe binary replacement usually cannot
even add new features, in case this breaks something.
New functions in C libraries do not cause runtime breakage.
It's good to know that there's never been a cra
Chris Angelico :
> Your descriptions conflict. A safe binary replacement usually cannot
> even add new features, in case this breaks something.
Linus Torvalds is adamant about maintaining ABI compatibility across
Linux versions. That hasn't prevented him from accepting numerous new
system calls.
On Fri, Jul 10, 2015 at 7:33 AM, Marko Rauhamaa wrote:
>> And just how compatible does it have to be to get a tick?
>
> It must be a safe binary replacement of the earlier version. Bug fixes
> and new features are ok, but none of the old functionality can be
> obsoleted.
Your descriptions conflic
Chris Angelico :
> On Fri, Jul 10, 2015 at 7:11 AM, Marko Rauhamaa wrote:
>> Whoever creates B-1.1 ought to make it backward-compatible, but he
>> should also say so. The majority of developers are careless about
>> backward-compatibility; having the component system make wishful
>> assumptions wi
On Fri, Jul 10, 2015 at 7:11 AM, Marko Rauhamaa wrote:
> Chris Angelico :
>
>> In general, I would expect that B 1.1 is backward-compatible with B
>> 1.0, unless otherwise stated. Why must it be declared in any way other
>> than the version number?
>
> To make it explicit. The generic component sy
Chris Angelico :
> In general, I would expect that B 1.1 is backward-compatible with B
> 1.0, unless otherwise stated. Why must it be declared in any way other
> than the version number?
To make it explicit. The generic component system shouldn't impose
(m)any assumptions on version numbering. Ve
On Fri, Jul 10, 2015 at 6:36 AM, Marko Rauhamaa wrote:
> Chris Angelico :
>
>> How do you expect the end result to work? Will it be that your code
>> imports one version of a module, but other code imports another? You
>> would have to rename one of them or something.
>
> At work, we have created
Chris Angelico :
> How do you expect the end result to work? Will it be that your code
> imports one version of a module, but other code imports another? You
> would have to rename one of them or something.
At work, we have created an analogous component system that has solved
this issue the way
On Fri, Jul 10, 2015 at 5:55 AM, Cyril Scetbon wrote:
> It's just a sample. I'd like to get a general answer. So think about the
> worst case.
(Please don't top-post on this list.)
The worst case is virtually impossible to handle. Somewhere along the
way, you need to say "import B" and Python h
It's just a sample. I'd like to get a general answer. So think about the worst
case.
> On Jul 9, 2015, at 21:50, Chris Angelico wrote:
>
> On Fri, Jul 10, 2015 at 5:08 AM, Cyril Scetbon wrote:
>> Forcing my-module to use B=1.1 fixes the issue. However it's just a sample
>> and my code is using
On Fri, Jul 10, 2015 at 5:08 AM, Cyril Scetbon wrote:
> Forcing my-module to use B=1.1 fixes the issue. However it's just a sample
> and my code is using a lot of modules that use other shared modules too. Is
> there a way to let dependencies use their own version of the modules they
> need whi
On 2015-06-01 23:48, Mark Lawrence wrote:
On 01/06/2015 21:29, Tim Chase wrote:
Is Python supposed to support POSIX "equivalence classes"? I tried
the following in Py2 and Py3:
>>> re.sub('[[=a=]]', 'A', 'aáàãâä', re.U)
'aáàãâä'
which suggests that it doesn't (I would have expected "AAA
On 01/06/2015 21:29, Tim Chase wrote:
Is Python supposed to support POSIX "equivalence classes"? I tried
the following in Py2 and Py3:
>>> re.sub('[[=a=]]', 'A', 'aáàãâä', re.U)
'aáàãâä'
which suggests that it doesn't (I would have expected "AA" as the
result).
Is there a way to get
Is Python supposed to support POSIX "equivalence classes"? I tried
the following in Py2 and Py3:
>>> re.sub('[[=a=]]', 'A', 'aáàãâä', re.U)
'aáàãâä'
which suggests that it doesn't (I would have expected "AA" as the
result).
Is there a way to get this behavior?
I found that perl knows a
Steven D'Aprano :
> Some people prefer to say "Python has no variables, it has name
> bindings". I think that it's better to say that Python's variables are
> not *like* C or Pascal variables, rather than invent a distinction
> between name bindings and variables. Name bindings are a type of
> var
On Thu, 26 Mar 2015 08:48 pm, Mario Figueiredo wrote:
> Sorry for the late reply. We experienced a 3 day blackout following
> one of the most amazing thunderstorms I've witnessed in my life.
Wow. Where abouts are you? Apart from the blackout, did you get through it
alright?
More below...
> On T
On Fri, 27 Mar 2015 04:11 am, Gregg Dotoli wrote:
>> Thanks for your help and patience. I'm new with Python.
No problems! If you hang around here, pay attention to the constructive
criticism you are given, and ignore the troll over on the "test1" thread,
you'll learn a lot.
Let's look at your co
On 03/26/2015 01:11 PM, Gregg Dotoli wrote:
On Wednesday, March 25, 2015 at 3:43:38 PM UTC-4, Gregg Dotoli wrote:
This basic script will help to find
evidence of CryptoWall on a slave drive. Although it is
just a string, more complex regex patterns can be
replaced with the string. It is incredib
On Wednesday, March 25, 2015 at 3:43:38 PM UTC-4, Gregg Dotoli wrote:
> This basic script will help to find
> evidence of CryptoWall on a slave drive. Although it is
> just a string, more complex regex patterns can be
> replaced with the string. It is incredible how fast Python is and
> how easy
> Gregg Dotoli
Are you reminding everyone who had a PC running DOS2.X-3X in 1990.
It was really a pain at that time
that a hard disk of an intel-MS based PC was sold hundreds of dollars, and
another pain was that the buyer had to use the disabled
dir in DOS after buying a HD.
--
https://ma
On Thu, Mar 26, 2015 at 8:53 PM, Mario Figueiredo wrote:
> However, lambda functions do read well in my mind and I find it hard
> to spot where they obscure the code more than a function. So the
> explicit vs. implicit part of the argument doesn't translate well with
> me. I however agree that a f
On Tue, 24 Mar 2015 15:33:41 -0400, Terry Reedy
wrote:
>
>You have discovered one of advantages of a def statement over a
>name=lambda assignment statement. In Python, there is no good reason to
>use the latter form and PEP 8 specifically discourages it: "Always use a
>def statement instead o
Sorry for the late reply. We experienced a 3 day blackout following
one of the most amazing thunderstorms I've witnessed in my life.
On Tue, 24 Mar 2015 22:49:49 +1100, Steven D'Aprano
wrote:
>On Tue, 24 Mar 2015 07:55 pm, Mario Figueiredo wrote:
>
>> Reading PEP 257 and 258 I got the impression
On 2015-03-25 21:20, Dave Angel wrote:
>> pattern="DECRYPT_I"
>> regexp=re.compile(pattern)
>
> That could explain why it's so fast.
While I might have missed it in the thread, it also seems that
regexpen are overkill for this. Why not just test for
if pattern in name:
...
-tkc
--
http
On 03/25/2015 03:43 PM, Gregg Dotoli wrote:
This basic script will help to find
evidence of CryptoWall on a slave drive. Although it is
just a string, more complex regex patterns can be
replaced with the string. It is incredible how fast Python is and
how easy it has helped in quickly assessing
This basic script will help to find
evidence of CryptoWall on a slave drive. Although it is
just a string, more complex regex patterns can be
replaced with the string. It is incredible how fast Python is and
how easy it has helped in quickly assessing a pool of slave drives.
I'm improving it as
On 3/24/2015 4:55 AM, Mario Figueiredo wrote:
Reading PEP 257 and 258 I got the impression that I could document
module attributes and these would be available in the __doc__
attribute of the object.
So things like the one below are something I got used to do, but that
don't work after all, as I
On Tue, 24 Mar 2015 07:55 pm, Mario Figueiredo wrote:
> Reading PEP 257 and 258 I got the impression that I could document
> module attributes and these would be available in the __doc__
> attribute of the object.
PEP 258 is rejected, so you can't take that as definitive.
PEP 257 has this defini
On Tue, Mar 24, 2015 at 7:55 PM, Mario Figueiredo wrote:
> So things like the one below are something I got used to do, but that
> don't work after all, as I learned today:
>
> value_factory = lambda _, row: row[0]
> """Row factory. To be used with single-column queries."""
>
> There are o
Yes, Paul Rubin had it right: I hadn't thought of the term "screen
scraper," but that might help my searching.
On 15 March 2015 at 05:50, Terry Reedy wrote:
>
> Perhaps you can use the guts of a terminal emulation program, removing
the part that displays the interpreted stream (a 24 x 80 array) o
On 3/14/2015 6:50 AM, Jason Heeris wrote:
I am trying to automate the use of some old, in-house terminal-based
programs that use screen redrawing for their interface. This includes
single line redrawing (eg. using '\r' and overwriting), complete screen
clearing, and fine-grained cursor movement a
Dave Angel writes:
>> Is there a module/library that can help me with this?
> https://docs.python.org/3/howto/curses.html
That's the opposite of what the OP wanted. Curses generates the escape
codes and so on to draw your desired stuff on the terminal. The OP
wants a screen scraper, something t
On 03/14/2015 06:50 AM, Jason Heeris wrote:
I am trying to automate the use of some old, in-house terminal-based
programs that use screen redrawing for their interface. This includes
single line redrawing (eg. using '\r' and overwriting), complete screen
clearing, and fine-grained cursor movement
To: sam pendleton
On 12/07/2014 11:50 AM, sam pendleton wrote:
> Thanks for getting back with me!
>
> On Sun, Dec 7, 2014 at 11:26 AM, Dave Angel wrote:
>> On 12/05/2014 11:50 PM, sam pendleton wrote:
>>>
>>> garage/
>>> |- __init__.py
>>> |- cars/
>>> |- __init__.py
>>>
On Sun, Dec 7, 2014 at 9:50 AM, sam pendleton wrote:
> Having to put the garage package on the sys.path seems a little off,
> why wouldn't relative imports work?
Relative imports are relative to a package's hierarchy of namespaces, not
relative to the file system. As such, you can't perform a rel
- Original Message -
> From: "sam pendleton"
> Having to put the garage package on the sys.path seems a little off,
> why wouldn't relative imports work?
>
> Do most people somehow put their packages in sys.path when bundling
> their python packages up to be shared with setuptools or othe
On 12/07/2014 11:50 AM, sam pendleton wrote:
Thanks for getting back with me!
On Sun, Dec 7, 2014 at 11:26 AM, Dave Angel wrote:
On 12/05/2014 11:50 PM, sam pendleton wrote:
garage/
|- __init__.py
|- cars/
|- __init__.py
|- hummer.py
tests/
|- test_cars.
Thanks for getting back with me!
On Sun, Dec 7, 2014 at 11:26 AM, Dave Angel wrote:
> On 12/05/2014 11:50 PM, sam pendleton wrote:
>>
>> garage/
>> |- __init__.py
>> |- cars/
>> |- __init__.py
>> |- hummer.py
>> tests/
>> |- test_cars.py
>>
>> at the top of test_c
On 12/05/2014 11:50 PM, sam pendleton wrote:
garage/
|- __init__.py
|- cars/
|- __init__.py
|- hummer.py
tests/
|- test_cars.py
at the top of test_cars.py, there is this:
from garage.cars import hummer
pytest is on this import statement, so i guess it's inc
On Sun, Aug 17, 2014 at 8:15 AM, Chris Angelico wrote:
> In a class definition, you have explicit state parameters on your
> functions - 'self':
>
> class C:
> def foo(self, arg):
> # blah blah
>
> At module level, there's equivalent state - the function "knows" what
> module it came
On Mon, Aug 18, 2014 at 1:59 AM, Steven D'Aprano
wrote:
> But inside class methods we have a problem:
>
> class X:
> def method():
> a = b + c
>
> We can trivially decide on a rule that a must be a local, but how about b
> and c? Are they globals or attributes of the instance? Python d
Chris Angelico wrote:
> In a class definition, you have explicit state parameters on your
> functions - 'self':
>
> class C:
> def foo(self, arg):
> # blah blah
>
> At module level, there's equivalent state - the function "knows" what
> module it came from - but it's implicit:
>
> d
On 2014-07-07 12:56, Steven D'Aprano wrote:
On Mon, 07 Jul 2014 12:15:51 +0100, Robert Kern wrote:
On 2014-07-07 09:57, Steven D'Aprano wrote:
What I don't understand is how "import pg" gets turned into "run
pgmodule.so"?
This has been standard Python behavior for extension modules since
for
On Mon, Jul 7, 2014 at 9:56 PM, Steven D'Aprano
wrote:
> Hmmm. Well, that is very special. Is this documented anywhere?
"Special", in the sense of Shepherd Book addressing Mal. "Isn't
that... special."
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, 07 Jul 2014 12:15:51 +0100, Robert Kern wrote:
> On 2014-07-07 09:57, Steven D'Aprano wrote:
>> What I don't understand is how "import pg" gets turned into "run
>> pgmodule.so"?
>
> This has been standard Python behavior for extension modules since
> forever. It's a very old practice and
On 2014-07-07 09:57, Steven D'Aprano wrote:
Ah, I think I have a partial answer... but not a complete answer.
On Mon, 07 Jul 2014 07:57:21 +, Steven D'Aprano wrote:
Can anyone explain how "import pg" can end up coming from pgmodule.so?
Sure enough:
import pg
pg.__file__
'/usr/local/l
Steven D'Aprano wrote:
> Ah, I think I have a partial answer... but not a complete answer.
>
>
> On Mon, 07 Jul 2014 07:57:21 +, Steven D'Aprano wrote:
>
>> Can anyone explain how "import pg" can end up coming from pgmodule.so?
>>
>>
>> Sure enough:
>>
> import pg
> pg.__file__
>
On Mon, 07 Jul 2014 19:03:33 +1000, Chris Angelico wrote:
> On Mon, Jul 7, 2014 at 6:57 PM, Steven D'Aprano
> wrote:
>> which suggests that the pgmodule.so file creates a module called "pg".
>> What I don't understand is how "import pg" gets turned into "run
>> pgmodule.so"?
>
> What happens if
On Mon, Jul 7, 2014 at 7:03 PM, Steven D'Aprano wrote:
> On Mon, 07 Jul 2014 18:04:36 +1000, Chris Angelico wrote:
>
>> On Mon, Jul 7, 2014 at 5:57 PM, Steven D'Aprano
>> wrote:
>>> Can anyone explain how "import pg" can end up coming from pgmodule.so?
>>
>> First guess: There's a "pg.py" somewhe
On Mon, 07 Jul 2014 18:04:36 +1000, Chris Angelico wrote:
> On Mon, Jul 7, 2014 at 5:57 PM, Steven D'Aprano
> wrote:
>> Can anyone explain how "import pg" can end up coming from pgmodule.so?
>
> First guess: There's a "pg.py" somewhere that imports the so, then
> replaces itself in sys.modules.
On Mon, Jul 7, 2014 at 6:57 PM, Steven D'Aprano wrote:
> which suggests that the pgmodule.so file creates a module called "pg".
> What I don't understand is how "import pg" gets turned into "run
> pgmodule.so"?
What happens if you *don't* import pg? Is there a sys.modules["pg"]
already? If so, I'
Ah, I think I have a partial answer... but not a complete answer.
On Mon, 07 Jul 2014 07:57:21 +, Steven D'Aprano wrote:
> Can anyone explain how "import pg" can end up coming from pgmodule.so?
>
>
> Sure enough:
>
import pg
pg.__file__
> '/usr/local/lib/python2.6/dist-packages/
On Mon, Jul 7, 2014 at 5:57 PM, Steven D'Aprano wrote:
> Can anyone explain how "import pg" can end up coming from pgmodule.so?
First guess: There's a "pg.py" somewhere that imports the so, then
replaces itself in sys.modules.
# importme.py
import sys
sys.modules["importme"]=sys
>>> import imp
On Fri, 13 Jun 2014 17:17:06 +0200, BrJohan wrote:
> Or to put the namevariants in some sequence of sets having elements
> like: ("Kristina", "Christina", "Cristine", "Kristine")
> Matching is then just applying the 'in' operator.
That's definitely a better approach, for the reasons you mention
BrJohan wrote:
> On 11/06/2014 14:23, BrJohan wrote:
>> For some genealogical purposes I consider using Python's re module.
>>
>> Rather many names can be spelled in a number of similar ways, and in
>> order to match names even if they are spelled differently, I w
On 11/06/2014 14:23, BrJohan wrote:
For some genealogical purposes I consider using Python's re module.
Rather many names can be spelled in a number of similar ways, and in
order to match names even if they are spelled differently, I will build
regular expressions, each of which is suppos
1 - 100 of 1029 matches
Mail list logo