Re: import question

2021-11-19 Thread dn via Python-list
On 20/11/2021 03.38, lucas wrote: > ok. all good advice. thank you for that. and with all that I've decided > what to do. > > I'm going to close off any server-side python access so that I don't expose > my server or the file system to vulnerabilities and/or wonton attacks. I am > building

Re: import question

2021-11-19 Thread lucas
ok. all good advice. thank you for that. and with all that I've decided what to do. I'm going to close off any server-side python access so that I don't expose my server or the file system to vulnerabilities and/or wonton attacks. I am building a site for education and what I will configure

Re: import question

2021-11-19 Thread Mats Wichmann
On 11/18/21 21:00, Dan Stromberg wrote: On Thu, Nov 18, 2021 at 6:19 PM Chris Angelico wrote: On Fri, Nov 19, 2021 at 11:24 AM Dan Stromberg wrote: On Thu, Nov 18, 2021 at 12:21 PM Chris Angelico wrote: If you're trying to make a Python-in-Python sandbox, I recommend not. Instead, use

Re: import question

2021-11-18 Thread Chris Angelico
On Fri, Nov 19, 2021 at 3:00 PM Dan Stromberg wrote: > > > On Thu, Nov 18, 2021 at 6:19 PM Chris Angelico wrote: >> >> On Fri, Nov 19, 2021 at 11:24 AM Dan Stromberg wrote: >> > >> > >> > On Thu, Nov 18, 2021 at 12:21 PM Chris Angelico wrote: >> >> >> >> If you're trying to make a Python-in-Pyt

Re: import question

2021-11-18 Thread Dan Stromberg
On Thu, Nov 18, 2021 at 6:19 PM Chris Angelico wrote: > On Fri, Nov 19, 2021 at 11:24 AM Dan Stromberg > wrote: > > > > > > On Thu, Nov 18, 2021 at 12:21 PM Chris Angelico > wrote: > >> > >> If you're trying to make a Python-in-Python sandbox, I recommend not. > >> Instead, use an OS-level sand

Re: import question

2021-11-18 Thread Chris Angelico
On Fri, Nov 19, 2021 at 11:24 AM Dan Stromberg wrote: > > > On Thu, Nov 18, 2021 at 12:21 PM Chris Angelico wrote: >> >> If you're trying to make a Python-in-Python sandbox, I recommend not. >> Instead, use an OS-level sandbox (a chroot, probably some sort of CPU >> usage limiting, etc), and use

Re: import question

2021-11-18 Thread Grant Edwards
On 2021-11-17, lucas wrote: > are there any other ways to import a module or package other then > the "import" or "from...import..." statements? i ask because i'm > allowing programming on my web2py website and i don't want any > accessing packages like os or sys. Safely allowing people to ente

Re: import question

2021-11-18 Thread Dan Stromberg
On Thu, Nov 18, 2021 at 12:21 PM Chris Angelico wrote: > If you're trying to make a Python-in-Python sandbox, I recommend not. > Instead, use an OS-level sandbox (a chroot, probably some sort of CPU > usage limiting, etc), and use that to guard the entire Python process. > Python-in-Python will b

Re: import question

2021-11-18 Thread Chris Angelico
On Fri, Nov 19, 2021 at 7:09 AM lucas wrote: > > hello one and all, > > are there any other ways to import a module or package other then the > "import" or "from...import..." statements? i ask because i'm allowing > programming on my web2py website and i don't want any accessing packages like

Re: Import Question

2013-02-20 Thread Dave Angel
On 02/20/2013 03:53 PM, eli m wrote: How long does it take for the program to import something? I am asking this because i have like 7 imports at the beginning of my program and i am thinking thats the reason why it is slow to start up. Thanks in advance. That would be easy to measure. If y

Re: Import Question

2013-02-20 Thread Michael Herman
you can check each import as it varies in loading time: time python -c "import [name of module]" example: time python -c "import flask" On Wed, Feb 20, 2013 at 12:53 PM, eli m wrote: > How long does it take for the program to import something? I am asking > this because i have like 7 imports at

Re: Import Question

2013-02-20 Thread Matteo Boscolo
Il 20/02/2013 21:53, eli m ha scritto: How long does it take for the program to import something? I am asking this because i have like 7 imports at the beginning of my program and i am thinking thats the reason why it is slow to start up. Thanks in advance. It depend of your code module code..

Re: Import question

2010-02-08 Thread Andrew Degtiariov
Those are called namespace packages. Zope and Plone (ab)use them > extensively. The intended usage is to break up a big, monolithic package > [0] in parts that can be distributed independently. To implement a > namespace package, you need an empty __init__.py file with only these > lines [1]: > >

Re: Import question

2010-02-08 Thread Gabriel Genellina
En Mon, 08 Feb 2010 06:37:53 -0300, Andrew Degtiariov escribió: 2010/2/6 Gabriel Genellina En Fri, 05 Feb 2010 13:21:47 -0300, Andrew Degtiariov escribió: Code of our project has split into several packages and we deploy the project using buildout. All worked fine until I need to dynamical

Re: Import question

2010-02-08 Thread Andrew Degtiariov
2010/2/6 Gabriel Genellina > En Fri, 05 Feb 2010 13:21:47 -0300, Andrew Degtiariov > escribió: > > > Code of our project has split into several packages and we deploy the >> project using buildout. >> All worked fine until I need to dynamically inspect python modules. >> > > Entirely by luck, I

Re: Import question

2010-02-05 Thread Gabriel Genellina
En Fri, 05 Feb 2010 13:21:47 -0300, Andrew Degtiariov escribió: Code of our project has split into several packages and we deploy the project using buildout. All worked fine until I need to dynamically inspect python modules. Entirely by luck, I'd say :) ├───project.api.config │ ├───proje

Re: Import question

2007-08-22 Thread Wildemar Wildenburger
Lamonte Harris wrote: > On 8/22/07, *Wildemar Wildenburger* <[EMAIL PROTECTED] > > wrote: > > So your'e basically saying that you haven't tried it? > > No I haven't. Thats why I asked? Common sense? Sorry. Excuse my sarcasm. The common way for answering easy questi

Re: Import question

2007-08-22 Thread Wildemar Wildenburger
Lamonte Harris wrote: > can I import more then one modules like this: > > import module,module2 So your'e basically saying that you haven't tried it? /W -- http://mail.python.org/mailman/listinfo/python-list

Re: import question on wx ?

2006-07-27 Thread Rob Williscroft
wrote in news:[EMAIL PROTECTED] in comp.lang.python: > > I think what you say makes perfect sense > > I am using 2.4.2 python (I typed pthon -V on console to get) > > How can I find what my SPE editor is using ? > Wherever you can run python you can find the version by running the following

Re: import question on wx ?

2006-07-27 Thread diffuser78
That right..on my console it shows python 2.4.2 and on SPE it shows 2.4.3. The wxPython is working fine in SPE i.e with Python 2.4.3. How can I make sure that when I type python on console I get the 2.4.3 ? Every help is greatly appreciated. Thanks John Salerno wrote: > [EMAIL PROTECTED] wrote

Re: import question on wx ?

2006-07-27 Thread SPE - Stani's Python Editor
John Salerno wrote: > [EMAIL PROTECTED] wrote: > > I have installed wx and everything looks fine. I have written a small > > app that uses wx. > > > > When I run my program from the console like > > ubuntu $ python PROGRAM_NAME.py > > > > it gives error > > Traceback (most recent call last): > >

Re: import question on wx ?

2006-07-27 Thread diffuser78
I think what you say makes perfect sense I am using 2.4.2 python (I typed pthon -V on console to get) How can I find what my SPE editor is using ? John Salerno wrote: > [EMAIL PROTECTED] wrote: > > I have installed wx and everything looks fine. I have written a small > > app that uses wx. > >

Re: import question on wx ?

2006-07-27 Thread John Salerno
[EMAIL PROTECTED] wrote: > I have installed wx and everything looks fine. I have written a small > app that uses wx. > > When I run my program from the console like > ubuntu $ python PROGRAM_NAME.py > > it gives error > Traceback (most recent call last): > File "Project.py", line 6, in ? >

Re: Import question

2005-08-09 Thread ncf
Crap. Forgot to mention that in some instances, I do want the class definitions to create new instances and such. Sorry :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Import question

2005-08-09 Thread ncf
I've got multiple instances I want globally available in the secondary modules, which can't easily be passed around with every function call without driving me nuts, so I wish to have all variables from the Main module passed to each of the other modules it creates. One such example would be in Ma

Re: Import question

2005-08-09 Thread Christopher Subich
ncf wrote: > Hmm...thanks for the replies. Judging by this, it looks like I might > still be in a slight perdiciment with doing it all, but time will tell. > I wish there were a way I could reference across multiple modules. > > Well, thanks for your help. Hopefully I'll be able to work out some >

Re: Import question

2005-08-09 Thread ncf
Hmm...thanks for the replies. Judging by this, it looks like I might still be in a slight perdiciment with doing it all, but time will tell. I wish there were a way I could reference across multiple modules. Well, thanks for your help. Hopefully I'll be able to work out some *simple* solution for

Re: Import question

2005-08-09 Thread Paul McNett
ncf wrote: > In file A, I have an instance of a class and then I import file B > (import fileB as fb). In file B, I need to access file A's class > instance. Is there anyway I can do this? (I hope that was descriptive > enough :\) Let's see... # -- fileA.py class Test(object): pass myInstance =

Re: Import question

2005-08-09 Thread Lonnie Princehouse
Circular import issues can usually be resolved by moving import statements into the bodies of functions which aren't executed when the module itself is imported. Simple example: fileA.py -- import fileB as fb foo = 10# we're going to access foo from fileB fb.do_something_with_foo()