Hi all,
I'm trying to use Pex (http://pex.readthedocs.org/en/latest/index.html) to
include requests in a little script to ping a server from a machine that
doesn't come with pip (or much of anything, really) installed. I'm running
into problems outputting a pex file that depends on a local script.
On Wed, Oct 22, 2014 at 3:36 AM, Sam Raker wrote:
>> That's because that isn't the mailing list's name. Sign up here:
>
>> https://mail.python.org/mailman/listinfo/python-list
>
>> ChrisA
>
> Thank you for your help.
No probs. Sorry I can't help with your main issue, as I'm not at all
familiar wi
On Tuesday, October 21, 2014 12:05:00 PM UTC-4, Chris Angelico wrote:
> On Wed, Oct 22, 2014 at 2:34 AM, Sam Raker wrote:
>
> > (Also: anyone who's planning on chewing me out about formatting: I TRIED
> > posting by email to comp.lang.pyt...@googlegroups.com, but it wouldn't let
> > me. Sorry f
On Wed, Oct 22, 2014 at 2:34 AM, Sam Raker wrote:
> (Also: anyone who's planning on chewing me out about formatting: I TRIED
> posting by email to comp.lang.pyt...@googlegroups.com, but it wouldn't let
> me. Sorry for the extra whitespace.)
That's because that isn't the mailing list's name. Sig
Hi all,
I'm trying to use Pex (http://pex.readthedocs.org/en/latest/index.html) to
include requests in a little script to ping a server from a machine that
doesn't come with pip (or much of anything, really) installed. I'm running into
problems outputting a pex file that depends on a local scrip
On 01/11/2012 03:45 PM, Antoon Pardon wrote:
On 01/11/2012 02:57 PM, Peter Otten wrote:
Antoon Pardon wrote:
I have an import problem I can't figure out.
I am using python 2.6.6 on a debian box
In one directory (pylib) I have a file misc.py and
the file testutil.py.
from misc import Rec
On 01/11/2012 02:57 PM, Peter Otten wrote:
Antoon Pardon wrote:
I have an import problem I can't figure out.
I am using python 2.6.6 on a debian box
In one directory (pylib) I have a file misc.py and
the file testutil.py.
from misc import Rec
ImportError: cannot import nam
Antoon Pardon wrote:
> I have an import problem I can't figure out.
> I am using python 2.6.6 on a debian box
>
> In one directory (pylib) I have a file misc.py and
> the file testutil.py.
> from misc import Rec
> ImportError: cannot import name Rec
>
> Why can I import Rec from misc in te
On 01/11/2012 08:21 AM, Antoon Pardon wrote:
I have an import problem I can't figure out.
I am using python 2.6.6 on a debian box
In one directory (pylib) I have a file misc.py and
the file testutil.py.
testutil.py --
print "in", __name__
from misc imp
I have an import problem I can't figure out.
I am using python 2.6.6 on a debian box
In one directory (pylib) I have a file misc.py and
the file testutil.py.
testutil.py --
print "in", __name__
from misc import Rec
-
greg wrote:
Dave
Angel wrote:
The point you should get from that link is
"Don't do circular imports. Ever."
No, I would say the lesson to be learned from this is
"don't use the same file as both a main script and an
imported module".
I would create another file called e.g. 'main.py' that
Dave Angel wrote:
The point you should get from that link is
"Don't do circular imports. Ever."
No, I would say the lesson to be learned from this is
"don't use the same file as both a main script and an
imported module".
I would create another file called e.g. 'main.py' that
simply contain
ryles wrote:
>> I always thought code in a module was only executed once,
>> but doesn't seem to be true.
>>
>> I'm using Python 2.5.
>>
>> And this is the example:
>>
>> == A.py ==
>> My_List = []
>>
>> == B.py ==
>> from A import *
>> My_List.append ( 3 )
>> print 'B', My_List
>> import C
>>
>>
(please don't top-post. Put your reply *after* the message you're quoting.)
Stef Mientki wrote:
thanks
very much Stephen,
This is the first time I become aware of the difference between script
and module !!
Starting with the wrong book "Learning Python" second edition, from
Lutz and Ascher,
thanks very much Stephen,
This is the first time I become aware of the difference between script
and module !!
Starting with the wrong book "Learning Python" second edition, from Lutz
and Ascher, based on Python 2.3"
in combination with using Python only from a high level IDE
(PyScripter), (ne
On Oct 10, 7:36 pm, Stef Mientki wrote:
> hello,
>
> I always thought code in a module was only executed once,
> but doesn't seem to be true.
>
> I'm using Python 2.5.
>
> And this is the example:
>
> == A.py ==
> My_List = []
>
> == B.py ==
> from A import *
> My_List.append ( 3 )
> print 'B', My
On Sunday, 11 October 2009 02:24:34 Stephen Hansen wrote:
> It's really better all around for "modules" to be considered like
> libraries, that live over There, and aren't normally executed. Then you
> have scripts over Here which may just be tiny and import a module and call
> that module's "main
On Sat, Oct 10, 2009 at 4:36 PM, Stef Mientki wrote:
> hello,
>
> I always thought code in a module was only executed once,
> but doesn't seem to be true.
>
This is one of the reasons why that whole big mess of a ton separate scripts
that all call each-other and are sometimes imported and sometim
Stef Mientki gmail.com> writes:
> Why is the B.py executed twice ?
Because it's executed once as a script and once as a module.
--
http://mail.python.org/mailman/listinfo/python-list
hello,
I always thought code in a module was only executed once,
but doesn't seem to be true.
I'm using Python 2.5.
And this is the example:
== A.py ==
My_List = []
== B.py ==
from A import *
My_List.append ( 3 )
print 'B', My_List
import C
== C.py ==
from A import *
from B import *
print 'C
Bill Jackson wrote:
> Once again, I am having issues with imports...
>
> Until now, I thought the general guidelines were to rarely use 'from x
> import y' syntax, except when you really want to copy names over.
No, the guideline is to not use "from x import *" except at the interactive
prompt
Bill Jackson wrote the following on 04/27/2007 12:49 PM:
> # importtest/test2/__init__.py
> from someclass import *
> from test2 import *
Sorry typo here:
# importtest/test2/__init__.py
from someclass import *
from mytest import *
--
http://mail.python.org/mailman/listinfo/python-list
Once again, I am having issues with imports...
Until now, I thought the general guidelines were to rarely use 'from x
import y' syntax, except when you really want to copy names over.
However, I have run into issues by following this guideline. So...
1) What is going wrong in the example below
Stéphane Ninin wrote:
> Also sprach Stéphane Ninin :
Sollte es denn möglich sein! Dieser alte Heilige hat in seinem Walde noch
Nichts davon gehört... that intra-package import takes precedence over
absolute import!
> Here is the basic structure of the code (I have reduced it first).
And nicely
Stéphane Ninin wrote:
> Traceback (most recent call last):
> File "main.py", line 8, in ?
> main()
> File "main.py", line 5, in main
> handler = HandlerFactory().makeHandler(command)
> File "c:\ROOT\Handlers\HandlerFactory.py", line 6, in HandlerFactory
> import Handlers.Default.H
Also sprach Stéphane Ninin :
>
>
> ... when I start main.py, I get:
>
> Traceback (most recent call last):
> File "main.py", line 8, in ?
> main()
> File "main.py", line 5, in main
> handler = HandlerFactory().makeHandler(command)
> File "c:\ROOT\Handlers\HandlerFactory.py", line
Hello all,
I have an ImportError problem, which is probably correct,
but I do not understand it. And how to fix it...
Here is the basic structure of the code (I have reduced it first).
ROOT:
/main.py
/Handlers/__init__.py (empty)
/Handlers/Handlers.py
/Handlers/HandlerFactory.py
running different versions of Python. I found that I solve my import
problems by adding one line to .bash_profile, which sets PYTHONPATH to
the parent directory of my custom directory tree. Or, on Windows, I add
an Environment variable, call it PYTHONPATH, and set it to the
necessary directory. The
versions of Python. I found that I solve my import
problems by adding one line to .bash_profile, which sets PYTHONPATH to
the parent directory of my custom directory tree. Or, on Windows, I add
an Environment variable, call it PYTHONPATH, and set it to the
necessary directory. The alternative would be
Thanks for your help Steve and F. Petitjean. Sorry for taking so long
to get back, I was away from my lab for a few days.
The path to my directory was not included in the sys.path list. Adding
a my.pth file to the site-packages directory fixed the import problem.
F. Petitjean, I originally edited
F. Petitjean wrote:
Le 13 Jan 2005 21:58:36 -0800, mike kreiner a écrit :
I am having trouble importing a module I created. I'm running PythonWin
on Windows XP if that helps. I saved my module in a folder called
my_scripts in the site-packages directory. I edited the python path to
include the my_s
Le 13 Jan 2005 21:58:36 -0800, mike kreiner a écrit :
> I am having trouble importing a module I created. I'm running PythonWin
> on Windows XP if that helps. I saved my module in a folder called
> my_scripts in the site-packages directory. I edited the python path to
> include the my_scripts folde
I am having trouble importing a module I created. I'm running PythonWin
on Windows XP if that helps. I saved my module in a folder called
my_scripts in the site-packages directory. I edited the python path to
include the my_scripts folder (it now reads
C:\Python23\Lib;C:\Python23\DLLs;C:\Python23\L
33 matches
Mail list logo