Of course, I am aware of this. But the file system can be emulated, and certain
networking can be mediated via the server, too. But for starts, I don't plan to
go beyond the basic file operations, if at all.
--
http://mail.python.org/mailman/listinfo/python-list
Thanks Carl, this looks like a good base to start from.
--
http://mail.python.org/mailman/listinfo/python-list
The logging cookbook gives an Filter example, explainning how to add
contextural info to log. I can't figure out how to filter log from it.
Suppose I have 3 file, a.py, b.py and main.py
#file: a.py
import logging
logger=logging.getLogger(__name__)
def print_log():
logger.debug("I'm module a")
On Wed, Nov 16, 2011 at 8:58 AM, sword wrote:
> I just scaned through the beginer's guide of logging module, but I
> can't get anything from console. The demo just like this:
>
> import logging
> logging.debug("This is a demo")
>
> Maybe I should do sth to put the log to stdout in basicConfig firs
I just scaned through the beginer's guide of logging module, but I
can't get anything from console. The demo just like this:
import logging
logging.debug("This is a demo")
Maybe I should do sth to put the log to stdout in basicConfig first?
Thanks in advance
--
http://mail.python.org/mailman/lis
Maybe you're looking for ipython? History, tab-complete, sort of
things in it.
goldtech wrote:
> Hi,
>
> Using Windows. Is there a python shell that has a history of typed in
> commands?
>
> I don't need output of commands just what I typed it. I need it to
> save between sessions - something that
On Wed, Nov 16, 2011 at 2:02 PM, Jason Swails wrote:
> Apparently I could not do what I was wanting to (state=DISABLED is not a
> valid option to Toplevel). What I wanted to do was something similar to
> what the dialogs were doing from tkMessageBox.
Yes, that would be what you'd want. I wonder,
Hi,
Using Windows. Is there a python shell that has a history of typed in
commands?
I don't need output of commands just what I typed it. I need it to
save between sessions - something that no shell seems to do. If I
reboot there will still be a command history somewhere.
Like bash history in Li
In article ,
Jabba Laci wrote:
> Hi,
>
> I'm reading the redis documentation and there is one thing that
> bothers me. For redis, you need to start a server on localhost. Is
> there an easy way that my Python script starts this server
> automatically? Before using my script, I don't want to sta
On Tuesday, November 15, 2011 12:37:03 PM UTC-8, Passiday wrote:
> Hello,
>
> I am looking for a way how to bring Python interpreter to JavaScript, in
> order to provide a web-based application with python scripting capabilities.
> The app would have basic IDE for writing and debugging the pytho
On Tue, Nov 15, 2011 at 12:32 AM, Chris Angelico wrote:
>
> As a general rule, if any parent is invisible, you won't see the
> child, and if any parent is disabled, you can't access the child.
Yea, I'm becoming more familiar and comfortable with the GUI hierarchy as I
play around. I do like ho
Hi,
I'm reading the redis documentation and there is one thing that
bothers me. For redis, you need to start a server on localhost. Is
there an easy way that my Python script starts this server
automatically? Before using my script, I don't want to start
redis-server each time. When my program ter
On Nov 15, 2011, at 5:59 PM, Alan Meyer wrote:
> On 11/15/2011 4:20 PM, David Riley wrote:
> ...
>> None was set to some other value. The other value might have a type
>> (such as a container) that could be false in a boolean context!
>>
>> Obviously, that last bit doesn't apply to m
On 11/15/2011 3:37 PM, Passiday wrote:
Hello,
I am looking for a way how to bring Python interpreter to JavaScript, in order
to provide a web-based application with python scripting capabilities. The app
would have basic IDE for writing and debugging the python code, but the
interpretation, o
On 11/15/2011 4:20 PM, David Riley wrote:
...
None was set to some other value. The other value might have a type
(such as a container) that could be false in a boolean context!
Obviously, that last bit doesn't apply to modules; they're not going to evaluate as False in
general.
On Wed, Nov 16, 2011 at 9:25 AM, Steven D'Aprano
wrote:
> Languages aren't refcounted. Or at least, *Python* isn't a refcounted
> language. CPython is a refcounted implementation. IronPython and Jython
> are not. del behaves exactly the same in IronPython and Jython as it does
> in CPython: it rem
On Tue, 15 Nov 2011 14:22:21 -0800, Chris Kaynor wrote:
> The tests (the code is shown later - its about 53 lines, with lots of
> copy+paste...):
Holy unnecessarily complicated code Batman!
This is much simpler:
[steve@ando ~]$ python -m timeit -s "x = None" "if x is None: pass"
1000 loops,
On Wed, 16 Nov 2011 06:53:26 +1100, Chris Angelico wrote:
> On Wed, Nov 16, 2011 at 5:17 AM, Dave Angel wrote:
>> a = someexpression...
>> b = a
>>
>> del a
>>
>> Does not (necessarily) delete the object that a refers to. It merely
>> deletes the symbol a.
>
> I'd have to classify that as
On Tue, 15 Nov 2011 17:01:23 +, Prasad, Ramit wrote:
> Can you expand on why 'del' is "tricky"/misleading?
People often imagine that the del statement sends a message to the object
"please delete yourself", which then calls the __del__ method. That is
incorrect.
"del x" is an unbinding ope
On Tue, Nov 15, 2011 at 1:34 PM, Chris Angelico wrote:
> On Wed, Nov 16, 2011 at 8:20 AM, David Riley wrote:
>> Comparisons to singletons like None should always be done with
>> 'is' or 'is not', never the equality operators.
>>
>> Also, beware of writing "if x" when you really mea
On 11/15/2011 3:52 PM, Ian Kelly wrote:
On Tue, Nov 15, 2011 at 1:37 PM, Passiday wrote:
Hello,
I am looking for a way how to bring Python interpreter to JavaScript, in order
to provide a web-based application with python scripting capabilities. The app
would have basic IDE for writing and d
On Tue, Nov 15, 2011 at 2:42 PM, Arnaud Delobelle wrote:
> It's idiomatic to write "x is None" when you want to know whether x is None.
It's also idiomatic to just write "if x:" when you want to know
whether x is something or nothing, and that's what I would probably do
here. Either is correct.
On 15 November 2011 21:34, Chris Angelico wrote:
> On Wed, Nov 16, 2011 at 8:20 AM, David Riley wrote:
>> Comparisons to singletons like None should always be done with
>> 'is' or 'is not', never the equality operators.
>>
>> Also, beware of writing "if x" when you really mean "if
On Wed, Nov 16, 2011 at 8:20 AM, David Riley wrote:
> Comparisons to singletons like None should always be done with
> 'is' or 'is not', never the equality operators.
>
> Also, beware of writing "if x" when you really mean "if x is not None"
> -- e.g. when testing whether a var
On Nov 15, 2011, at 3:01 PM, Chris Angelico wrote:
> On Wed, Nov 16, 2011 at 6:39 AM, David Riley wrote:
>> True, and that does avoid polluting namespace. However, you shouldn't be
>> testing for None as a bool; you should instead do an "if is None:"
>> (or, of course, "is not None").
>
> Wh
On 15-11-2011 21:37, Passiday wrote:
Hello,
I am looking for a way how to bring Python interpreter to JavaScript, in order
to provide a web-based application with python scripting capabilities. The app
would have basic IDE for writing and debugging the python code, but the
interpretation, of
On Tue, Nov 15, 2011 at 1:37 PM, Passiday wrote:
> Hello,
>
> I am looking for a way how to bring Python interpreter to JavaScript, in
> order to provide a web-based application with python scripting capabilities.
> The app would have basic IDE for writing and debugging the python code, but
> t
Hello,
I am looking for a way how to bring Python interpreter to JavaScript, in order
to provide a web-based application with python scripting capabilities. The app
would have basic IDE for writing and debugging the python code, but the
interpretation, of course, would be done in JavaScript. I'
On Wed, Nov 16, 2011 at 7:37 AM, Passiday wrote:
> The app would have basic IDE for writing and debugging the python code, but
> the interpretation, of course, would be done in JavaScript. I'd like to avoid
> any client-server transactions, so all the interpretation should take place
> on the c
On Wed, Nov 16, 2011 at 6:39 AM, David Riley wrote:
> True, and that does avoid polluting namespace. However, you shouldn't be
> testing for None as a bool; you should instead do an "if is None:"
> (or, of course, "is not None").
Why not? Is there some other way for the module object to evalu
On Wed, Nov 16, 2011 at 5:17 AM, Dave Angel wrote:
> a = someexpression...
> b = a
>
> del a
>
> Does not (necessarily) delete the object that a refers to. It merely
> deletes the symbol a.
I'd have to classify that as part of the change of thinking necessary
for a refcounted language, and
On Nov 15, 2011, at 1:58 PM, Jean-Michel Pichavant wrote:
> PS : @Dave there is a way to avoiding adding symbols to your global
> namespace, assign None to the module's name on import errors. Then before
> using it, just test the module bool value : if serial: serial.whateverMethod()
True, and
Hi,
Wingware has released version 4.1.1 of Wing IDE, an integrated development
environment designed specifically for the Python programming language.
Wing IDE is a cross-platform Python IDE that provides a professional code
editor with vi, emacs, and other key bindings, auto-completion, call tip
Hi All,
I am new to Python. I have to implement a overlay network of around
500 nodes which are arranged as a random graph. To generate theoverlay
network I will be using networkx.
My query is, is there a way to implement Gossip protocol in my overlay
network using Python. Like one node initiated
David Riley wrote:
On Nov 15, 2011, at 12:35 PM, Andreea Babiuc wrote:
On 15 November 2011 17:24, Chris Kaynor wrote:
As with any Python code, you can wrap the import into a try: except block.
try:
import badModule
except:
pass # Or otherwise handle the exception - possibly importing
On 15/11/2011 17:26, Prasad, Ramit wrote:
Perhaps you should call it "LaoZiDao".
I just prefer shorter name.
DAO as Data Access Objects is a common acronym in several languages (i.e. Java),
so you will continually have this naming conflict. Just be aware that this
conflict will happen frequent
On 11/15/2011 12:01 PM, Prasad, Ramit wrote:
(Peter's "del" solution is quite close, but I find the 'del' statement
tricky in python and will mislead many python newcomers)
Can you expand on why 'del' is "tricky"/misleading?
Ramit
a = someexpression...
b = a
del a
Does not (necessaril
On Nov 15, 2011, at 12:35 PM, Andreea Babiuc wrote:
>
>
> On 15 November 2011 17:24, Chris Kaynor wrote:
> As with any Python code, you can wrap the import into a try: except block.
>
> try:
> import badModule
> except:
>
>
> pass # Or otherwise handle the exception - possibly importing a
On 15 November 2011 17:24, Chris Kaynor wrote:
> As with any Python code, you can wrap the import into a try: except block.
>
> try:
> import badModule
> except:
>
> pass # Or otherwise handle the exception - possibly importing an
> alternative module.
>
>
Hmm, I know this might sound silly,
>> Perhaps you should call it "LaoZiDao".
>I just prefer shorter name.
DAO as Data Access Objects is a common acronym in several languages (i.e.
Java),
so you will continually have this naming conflict. Just be aware that this
conflict will happen frequently in the minds of many programmers.
Ra
As with any Python code, you can wrap the import into a try: except block.
try:
import badModule
except:
pass # Or otherwise handle the exception - possibly importing an
alternative module.
As with any except statement, specific exceptions may be caught
(rather than the blank, catch everything)
Hi,
Is there a way to suppress all the errors when importing a module in
python?
By that I mean.. If I have other imports in the module I'm trying to import
that fail, I still want my module to be imported that way..
Many thanks.
--
http://mail.python.org/mailman/listinfo/python-list
>>for x in a, b, c:
>>del x[0]
>for arr in [a,b,c]:
> arr.pop(0)
>(Peter's "del" solution is quite close, but I find the 'del' statement
>tricky in python and will mislead many python newcomers)
Can you expand on why 'del' is "tricky"/misleading?
Ramit
Ramit Prasad | JPMorgan Chase Inves
On Nov 7, 1:00 pm, "OKB (not okblacke)"
wrote:
> I noticed this (Python 2.6.5 on Windows XP):
> http://book-az.com
> >>> import random, timeit
> >>> def myAll(x):
>
> ... for a in x:
> ... if a not in (True, False):
> ... return False
> ... return True>>> x = [r
You could easily script this with popen calling secure shell to execute a
command and capture the output.
Sent from my iPhone
On Nov 15, 2011, at 7:04 AM, Roark wrote:
> Hi,
>
> I am first time trying my hands on python scripting and would need
> some guidance from the experts on my problem
On Tue, Nov 15, 2011 at 11:33 PM, Marc Christiansen
wrote:
>
> I'd try
> export PIP_INSTALL_OPTION=--prefix=$PWD/local
It works very well. Thank you.
--
regards,
makoto
>
> using a config file is also possible. See
> http://www.pip-installer.org/en/latest/configuration.html
>
> Ciao
> Marc
> -
On Nov 15, 1:04 pm, Roark wrote:
> Hi,
>
> I am first time trying my hands on python scripting and would need
> some guidance from the experts on my problem.
>
> I want to execute a windows command within python script from a client
> machine on a remote target server, and would want the output of
On 11/15/11 2:31 PM, Grant Edwards wrote:
On 2011-11-15, Barry W Brown wrote:
I thought that the point of the else clause is that it is reached
only if there is no exception in the try clause.
Not really. If that's all you wanted, then you just put the code at
the end of the try block.
No
Makoto Kuwata wrote:
> Is it possible to specify PREFIX directory for pip command by
> environment variable?
>
> I found that 'pip install --install-option=--prefix=PREFIX' works well,
> but I don't want to specify '--install-option=--prefix=PREFIX' every time.
> I prefer to specify it by environ
On 2011-11-15, Barry W Brown wrote:
> I thought that the point of the else clause is that it is reached
> only if there is no exception in the try clause.
Not really. If that's all you wanted, then you just put the code at
the end of the try block.
--
Grant Edwards grant.b.edwar
In article ,
Chris Angelico wrote:
> On Tue, Nov 15, 2011 at 11:04 PM, Roark wrote:
> > Hi,
> >
> > I want to execute a windows command within python script from a client
> > machine on a remote target server, and would want the output of the
> > command written in a file on client machine. Wha
It sounds like Fabric is what you're after. We use it at work and it's the
best thing since ssh. ;]
http://docs.fabfile.org/en/1.3.2/index.html
(Actually, it uses ssh internally and allows you to do remote shell-like
programming in a pythonic fashion.)
Cheers,
Xav
On 15 November 2011 22:04, R
On Tue, Nov 15, 2011 at 11:04 PM, Roark wrote:
> Hi,
>
> I want to execute a windows command within python script from a client
> machine on a remote target server, and would want the output of the
> command written in a file on client machine. What is the way it could
> be achieved.
This looks l
Martin P. Hellwig wrote:
On 11/15/11 12:04, Roark wrote:
Hi,
I am first time trying my hands on python scripting and would need
some guidance from the experts on my problem.
I want to execute a windows command within python script from a client
machine on a remote target server, and would want
Is it possible to specify PREFIX directory for pip command by
environment variable?
I found that 'pip install --install-option=--prefix=PREFIX' works well,
but I don't want to specify '--install-option=--prefix=PREFIX' every time.
I prefer to specify it by environment variable such as::
expor
On 11/15/11 12:04, Roark wrote:
Hi,
I am first time trying my hands on python scripting and would need
some guidance from the experts on my problem.
I want to execute a windows command within python script from a client
machine on a remote target server, and would want the output of the
command
Hi,
I am first time trying my hands on python scripting and would need
some guidance from the experts on my problem.
I want to execute a windows command within python script from a client
machine on a remote target server, and would want the output of the
command written in a file on client machi
On Thu, Oct 13, 2011 at 11:07 AM, Chris Angelico wrote:
> On Thu, Oct 13, 2011 at 8:45 PM, candide wrote:
> > Dart is the very new language created by Google to replace Javascript.
> > So Python was not able to do the job? Or may be they don't know about
> Python
> > at Google ;) ?
> >
>
> Also,
58 matches
Mail list logo