On 09Oct2019 16:50, DL Neil wrote:
Another option might be to add a symlink* from the application's
directory to wherever you've downloaded and expanded the GitHub .zip
archive.
I do this. A current project is using Spectra's ds3 Python library.
The project itself has a directory for the add
On 9/10/19 4:34 PM, jf...@ms4.hinet.net wrote:
jf...@ms4.hinet.net於 2019年10月8日星期二 UTC+8上午10時45分36秒寫道:
For example:
from my-dir import test
I know it can be solved by renaming, but any alternative?
--Jach
Maybe another (better?) solution is:
import sys
sys.path.append(r'my-dir')
import test
jf...@ms4.hinet.net於 2019年10月8日星期二 UTC+8上午10時45分36秒寫道:
> For example:
> from my-dir import test
>
> I know it can be solved by renaming, but any alternative?
>
> --Jach
Maybe another (better?) solution is:
import sys
sys.path.append(r'my-dir')
import test
--Jach
--
https://mail.python.org/mail
On Wed, Oct 9, 2019 at 12:56 PM DL Neil via Python-list
wrote:
>
> On 9/10/19 2:46 PM, Chris Angelico wrote:
> > On Wed, Oct 9, 2019 at 12:36 PM DL Neil via Python-list
> > wrote:
> ...
>
> > (Or just using pip to install directly from GitHub, although not
> > everyone knows that that's possible.
On 9/10/19 2:46 PM, Chris Angelico wrote:
On Wed, Oct 9, 2019 at 12:36 PM DL Neil via Python-list
wrote:
...
(Or just using pip to install directly from GitHub, although not
everyone knows that that's possible.)
Come on, you just knew I was going to ask how...
--
Regards =dn
--
https://mai
On Wed, Oct 9, 2019 at 12:36 PM DL Neil via Python-list
wrote:
>
> On 9/10/19 2:12 PM, jf...@ms4.hinet.net wrote:
> > dieter於 2019年10月8日星期二 UTC+8下午1時33分20秒寫道:
> >> jf...@ms4.hinet.net writes:
> >>> ...
> >>> But most of the download from Github has a directory named '-master'
> >>> which caus
On 9/10/19 2:12 PM, jf...@ms4.hinet.net wrote:
dieter於 2019年10月8日星期二 UTC+8下午1時33分20秒寫道:
jf...@ms4.hinet.net writes:
...
But most of the download from Github has a directory named '-master' which
causes a trouble sometimes.
Those are likely not meant to be imported directly.
Typically, y
dieter於 2019年10月8日星期二 UTC+8下午1時33分20秒寫道:
> jf...@ms4.hinet.net writes:
> > ...
> > But most of the download from Github has a directory named '-master'
> > which causes a trouble sometimes.
>
> Those are likely not meant to be imported directly.
>
> Typically, you have a "setup" step which i
jf...@ms4.hinet.net writes:
> ...
> But most of the download from Github has a directory named '-master'
> which causes a trouble sometimes.
Those are likely not meant to be imported directly.
Typically, you have a "setup" step which installs (in some way)
a "distribution". This step usually
DL Neil於 2019年10月8日星期二 UTC+8上午11時02分20秒寫道:
> On 8/10/19 3:45 PM, jf...@ms4.hinet.net wrote:
> > For example:
> > from my-dir import test
> >
> > I know it can be solved by renaming, but any alternative?
>
>
> The manual is your friend:
> - import
> - importlib
>
> (the latter allows modules to
On 8/10/19 3:45 PM, jf...@ms4.hinet.net wrote:
For example:
from my-dir import test
I know it can be solved by renaming, but any alternative?
The manual is your friend:
- import
- importlib
(the latter allows modules to be identified by strings)
However, Pythons has naming rules. If you try
For example:
from my-dir import test
I know it can be solved by renaming, but any alternative?
--Jach
--
https://mail.python.org/mailman/listinfo/python-list
Level
I just cannot figure out why they using the ``from ./.. import'' to
import modules.
These are 'relative imports'. Read the doc for import statements.
--
Terry Jan Reedy
--
https://mail.python.org/mailman/listinfo/python-list
import Color
> from .level import Level
>
> I just cannot figure out why they using the ``from ./.. import'' to
> import modules.
Why wouldn't they be? That's how you import things from the
current/parent package.
--
https://mail.python.org/mailman/listinfo/python-list
using the ``from ./.. import'' to
import modules.
Any hints?
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, Jan 8, 2016 at 3:50 AM, Robert wrote:
> Hi,
>
> I see the following code. After searching around, I still don't know the
> meaning of '.'. Could you tell me that ? Thanks,
>
>
>
>
>
> from . import _hmmc
> from .utils import normalize
Hi,
I see the following code. After searching around, I still don't know the
meaning of '.'. Could you tell me that ? Thanks,
from . import _hmmc
from .utils import normalize
--
https://mail.python.org/mailman/listinfo/python-list
On 6/17/10 10:22 AM, Jack Diederich wrote:
> On Thu, Jun 17, 2010 at 12:58 PM, Stephen Hansen
>> It explicitly states later its entirely OK to import classes. It never
>> says anything else directly, except in the example given, it shows you
>> importing a constant. So, its giving implicit approval
Jack Diederich wrote:
You want to import a name that is itself a namespace; preferably a
module or package and sometimes a class. Importing constants can lead
to trouble. ex/
from settings import DEBUG
if DEBUG: log('debug is on!')
The value of the flag gets fetched at import time. If code i
#x27;
>>> on this, except that its okay to use "from ... import ..." to pull in
>>> classes and (implicitly) constants, and despite how the rules say 'one
>>> module per line' its OK to pull in more then one name -from- a module at
>>> once.
>
Stephen Hansen wrote:
On 6/17/10 10:01 AM, Ethan Furman wrote:
Stephen Hansen wrote:
On 6/17/10 9:12 AM, pyt...@bdurham.com wrote:
Now, this is all IMHO: the style guide does not define any 'guidelines'
on this, except that its okay to use "from ... import ..." to
On 6/17/10 10:01 AM, Ethan Furman wrote:
> Stephen Hansen wrote:
>> On 6/17/10 9:12 AM, pyt...@bdurham.com wrote:
>>
>> Now, this is all IMHO: the style guide does not define any 'guidelines'
>> on this, except that its okay to use "from ... import
Stephen Hansen wrote:
On 6/17/10 9:12 AM, pyt...@bdurham.com wrote:
Now, this is all IMHO: the style guide does not define any 'guidelines'
on this, except that its okay to use "from ... import ..." to pull in
classes and (implicitly) constants, and despite how the rules
On 6/17/10 9:12 AM, pyt...@bdurham.com wrote:
> Are there any efficiency or style guidelines regarding the choice
> of "import " vs. "from import , ..."?
There are no legitimate efficiency issues. In theory, module.blah is
slightly slower then blah, but that "sli
Are there any efficiency or style guidelines regarding the choice
of "import " vs. "from import , ..."?
If one only needs to import a few names from a module, are there
specific benefits to explictly importing these names?
My understanding is that both forms of the import
On Mon, Apr 26, 2010 at 12:08 PM, Wanderer wrote:
> Since the last Java update, I get the error, "undefined variable from
> import" in Pydev in the Eclipse editor. I can still run the program in
> Eclipse. If I add a blank line and save the program, the error goes
> away,
Since the last Java update, I get the error, "undefined variable from
import" in Pydev in the Eclipse editor. I can still run the program in
Eclipse. If I add a blank line and save the program, the error goes
away, but that screws up the revision with SVN. Has anyone else seen
this or
egbert wrote:
Yes, you are right. And I can reach everything with
modules['some_package']
or variants thereof.
Although note that the usual way to get it would be
to simply do
import some_package
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Mar 25, 2010 at 12:43:13PM -0400, Terry Reedy wrote:
> On 3/25/2010 6:16 AM, egbert wrote:
> >When I do 'from some_package import some_module'
> >the __init__.py of some_package will be run.
> >However, there will not be anything like a package-module,
> >and the effects of __init__.py see
On 3/25/2010 6:16 AM, egbert wrote:
When I do 'from some_package import some_module'
the __init__.py of some_package will be run.
However, there will not be anything like a package-module,
and the effects of __init__.py seem all to be lost. Is that true ?
No. If you do
from sys import modules
egbert wrote:
> When I do 'from some_package import some_module'
> the __init__.py of some_package will be run.
> However, there will not be anything like a package-module,
> and the effects of __init__.py seem all to be lost. Is that true ?
> Or can I still do something useful with __init__.py ?
When I do 'from some_package import some_module'
the __init__.py of some_package will be run.
However, there will not be anything like a package-module,
and the effects of __init__.py seem all to be lost. Is that true ?
Or can I still do something useful with __init__.py ?
e
--
Egbert Bouwman
What about using the reimport library?
http://code.google.com/p/reimport/
Cheers,
William
From: AlF
To: python-list@python.org
Sent: Monday, August 10, 2009 1:48:31 AM
Subject: Re: reloading the module imported as 'from ... import ...'
Steven D
>>>>> Steven D'Aprano (SD) wrote:
>SD> On Sun, 09 Aug 2009 22:48:31 -0700, AlF wrote:
>>> Steven D'Aprano wrote:
>>>> On Sun, 09 Aug 2009 20:43:41 -0700, AlF wrote:
>>>>
>>>>> Hi,
>>>&
On Sun, 09 Aug 2009 22:48:31 -0700, AlF wrote:
> Steven D'Aprano wrote:
>> On Sun, 09 Aug 2009 20:43:41 -0700, AlF wrote:
>>
>>> Hi,
>>>
>>> what is the best way to reload the module imported using 'from ...
>>> import ...'
>&
Steven D'Aprano wrote:
On Sun, 09 Aug 2009 20:43:41 -0700, AlF wrote:
Hi,
what is the best way to reload the module imported using 'from ...
import ...'
Have you tried "from ... import ..." again?
I have not because of an assumption that "import" imp
On Sun, 09 Aug 2009 20:43:41 -0700, AlF wrote:
> Hi,
>
> what is the best way to reload the module imported using 'from ...
> import ...'
Have you tried "from ... import ..." again?
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
what is the best way to reload the module imported using 'from ...
import ...'
Is following a way to do so?
>>> from email.charset import Charset
>>> reload(email.charset)
Traceback (most recent call last):
File "", line 1, in
NameError: name
On Aug 27, 3:35 pm, Peter Otten <[EMAIL PROTECTED]> wrote:
> nisp wrote:
> > Thanks first of all ! I read the interesting Diez's link but something
> > still remains to me unclear, on the other hand it's clear the my
> > problem is concentrated there and on symbols.
>
> Read it again. If you have t
On Aug 27, 5:42 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> alex23 schrieb:
>
>
>
> > nisp <[EMAIL PROTECTED]> wrote:
> >> I've always been convinced of the equivalence of the two ways of using
> >> the import statement but it's clear I'm wrong :-(
>
> > Python 2.5.2 (r252:60911, Jul 31 200
nisp wrote:
> Thanks first of all ! I read the interesting Diez's link but something
> still remains to me unclear, on the other hand it's clear the my
> problem is concentrated there and on symbols.
Read it again. If you have two modules
module1.py
from sys import stderr
module2.py
from module
;> > from sys import std err
>
> >> >
>
> >> > print >> stderr, "Some text"
>
> >> > While in my module I use
>
> >> > import sys
>
> >> > . sys.stderr ... sys.stdout
>
> >> > Well, as long as I do n
>> > While in my module I use
>>
>> > import sys
>>
>> > . sys.stderr ... sys.stdout
>>
>> > Well, as long as I do not change in the external module those from/
>> > import statements to just
>>
>> > import sys
>&
file object
> > method write.
> > The external module outputs to stderr this way:
>
> > from sys import std err
>
> >
>
> > print >> stderr, "Some text"
>
> > While in my module I use
>
> > import sys
>
> > ..
y:
>
> from sys import std err
>
>
>
> print >> stderr, "Some text"
>
> While in my module I use
>
> import sys
>
> . sys.stderr ... sys.stdout
>
> Well, as long as I do not change in the external module those from/
> import sta
alex23 schrieb:
nisp <[EMAIL PROTECTED]> wrote:
I've always been convinced of the equivalence of the two ways of using
the import statement but it's clear I'm wrong :-(
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "cre
nisp <[EMAIL PROTECTED]> wrote:
> I've always been convinced of the equivalence of the two ways of using
> the import statement but it's clear I'm wrong :-(
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "licens
print >> stderr, "Some text"
While in my module I use
import sys
. sys.stderr ... sys.stdout
Well, as long as I do not change in the external module those from/
import statements to just
import sys
print >> sys.stderr, "Some text"
t; stderr, "Some text"
While in my module I use
import sys
. sys.stderr ... sys.stdout
Well, as long as I do not change in the external module those from/
import statements to just
import sys
print >> sys.stderr, "Some text"
I'm not a
--
regards,
kwatch
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
> En Mon, 30 Apr 2007 20:19:54 -0300,kwatch<[EMAIL PROTECTED]> escribió:
>
> > Could you teach me the condition of module name which is available
> > in 'from ... import ...&
En Mon, 30 Apr 2007 20:19:54 -0300, kwatch <[EMAIL PROTECTED]> escribió:
> Could you teach me the condition of module name which is available
> in 'from ... import ...' statement?
>
> The goal what I want to do is to create a module by 'new' module
&
On Mon, 2007-04-30 at 16:19 -0700, kwatch wrote:
> [...]
> The goal what I want to do is to create a module by 'new' module
> and specify that module name in 'from ...' statement.
>
>
> # create a module
> import new
> foo = new.module('foo'
What is the condition of module name which is available in
'from .. import ..' statement ?
import os
print os.path #
from posixpath import sep # (no errors)
from os.path import sep# (no errors, wow!
[EMAIL PROTECTED] writes:
> what's the from ... import keyword use for?
> for example - from contenttype import getContentType
>
> import os
> import sys
> import getopt
> import types
> import re
> import pprint
> import logging
> from contenttype impo
On Feb 3, 4:12 am, [EMAIL PROTECTED] wrote:
> what's the from ... import keyword use for?
> for example - from contenttype import getContentType
>
> import os
> import sys
> import getopt
> import types
> import re
> import pprint
> import logging
> from co
[EMAIL PROTECTED] schrieb:
> what's the from ... import keyword use for?
> for example - from contenttype import getContentType
>
> import os
> import sys
> import getopt
> import types
> import re
> import pprint
> import logging
> from contenttype import ge
what's the from ... import keyword use for?
for example - from contenttype import getContentType
import os
import sys
import getopt
import types
import re
import pprint
import logging
from contenttype import getContentType
In Java what kind of statement is similar this?
thanks
--
ssage-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Nick Maclaren
Sent: 05 July 2006 11:32
To: python-list@python.org
Subject: Re: Illegal instruction or undefined symbol from import
In article <[EMAIL PROTECTED]>,
Mathias Waack <[EMAIL PROTECTED]> writes:
|>
In article <[EMAIL PROTECTED]>,
Mathias Waack <[EMAIL PROTECTED]> writes:
|>
|> > There's
|> > a lot of somewhat obscure mathematical stuff that got into the standard
|> > C lib. How often do you need Bessel functions?
|>
|> Maybe each day. What is a Bessel function?;)
Some people use them all
Richard Brodie wrote:
> "Mathias Waack" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
>> BTW, does anybody know why the c-lib offers both log and log1p?
>
> So you can get a sensible answer computing log(1 + 10 ^ -30).
Ok, that make sense to me.
> There's
> a lot of somewha
"Mathias Waack" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> BTW, does anybody know why the c-lib offers both log and log1p?
So you can get a sensible answer computing log(1 + 10 ^ -30). There's
a lot of somewhat obscure mathematical stuff that got into the standard
C lib. How
Continuing my monologe;)
Mathias Waack wrote:
> I've embedded python into a legacy application. It works - most of the
> time. In some special situations the app crashes executing the "import
> random". There are two different situations:
>
> 1. the sources compiled with gcc 4.1.2 crash with ille
Hi,
I've embedded python into a legacy application. It works - most of the time.
In some special situations the app crashes executing the "import random".
There are two different situations:
1. the sources compiled with gcc 4.1.2 crash with illegal instruction error:
(running my application)
63 matches
Mail list logo