On Tue, Aug 30, 2011 at 1:19 PM, Ethan Furman wrote:
>
> I spoke a bit too soon with the "works flawlessly" post. In addition to
>> your issue, there is also the problem that supplying an empty environment
>> does not allow the user to call necessary functions (like scheme_eval).
>>
>
>
> So, ju
On Tue, Aug 30, 2011 at 2:37 AM, Rob Williscroft wrote:
> > That's brilliant and works flawlessly. Thank you very much!
>
> If an impementation (as you say up thread) can populate globals
> or locals with whatever they want, then how do you know that last
> item added was the function definitio
On Mon, Aug 29, 2011 at 5:50 PM, Arnaud Delobelle wrote:
>
> Hi Jack,
>
> Here is a possible solution for your problem (Python 3):
>
>
> >>> class CapturingDict(dict):
> ... def __setitem__(self, key, val):
> ... self.key, self.val = key, val
> ... dict.__setitem__(self, key,
On Mon, Aug 29, 2011 at 12:30 PM, Rob Williscroft wrote:
> Jack Trades wrote in
> > ... I wanted to allow the user to manually return the
> > function from the string, like this:
> >
> > a = exec("""
> > def double(x):
> > return x * 2
I'm writing a Scheme interpreter and I need to be able to create and return
a Python function from a string.
This is a port of another Scheme interpreter I wrote in Scheme. What I'm
trying to do looked like this:
(define (scheme-syntax expr)
(hash-table-set! global-syntax (car expr) (eval (cad
ce to the slot that value is stored in.
To update the numbers list you would want something like this:
numbers = [1, 2, 3, 4, 5]
for n in range(len(numbers)):
numbers[n] += 5
print numbers
Alternatively if you didn't need to update the numbers list you could make a
new list like this:
[n
save a data structure like an array (called a list in Python), you can
use the pickle module. Here's the documentation on pickle.
http://docs.python.org/library/pickle.html
http://www.developertutorials.com/tutorials/python/python-persistence-management-0504
On Fri, Mar 18, 2011 at 4:59 PM, Jack Trades wrote:
>
>
> On Fri, Mar 18, 2011 at 4:56 PM, Jon Herman wrote:
>
>> Jack,
>>
>> thanks.
>>
>> Alright, so what I did is create a file called hello.txt with a single
>> line of text in there. I then did
in to me why this happens?
>
>
You need to remove the quotes from f. f is a variable name, not a string,
so there should be no quotes around it.
--
Jack Trades
Pointless Programming Blog <http://pointlessprogramming.wordpress.com>
--
http://mail.python.org/mailman/listinfo/python-list
27;s an example I just ran...
>>> import os
>>> os.getcwd()
'/media/DATA/code/lispy/liSpy'
The folder that is returned from os.getcwd() is the folder that "open" will
use. You can specify another folder by giving the full path.
open("/full/path/to/file.txt
On May 19, 3:53 am, Lawrence D'Oliveiro wrote:
> In message
> d9e205be7...@s31g2000vbp.googlegroups.com>, Jack Trades wrote:
> > On May 19, 12:26 am, Lawrence D'Oliveiro > central.gen.new_zealand> wrote:
>
> >> In message
On May 19, 3:46 am, Duncan Booth wrote:
> Jack Trades wrote:
> > Originally I had the 'data' directory in the same directory as the cgi
> > scripts and was using os.system("svn commit"), however I kept running
> > into weird bugs with this method. So
On May 19, 12:26 am, Lawrence D'Oliveiro wrote:
> In message <2904e7de-0a8d-4697-9c44-
>
> c83bb5319...@s31g2000vbp.googlegroups.com>, Jack Trades wrote:
> > Originally I had the 'data' directory in the same directory as the cgi
> > scripts and was usi
I'm wondering if there's an easy way to do a 'svn commit' on a
directory from Python.
More Details:
I have a wiki-like program that stores its data in a directory that I
would like to put under version control to be able to roll back
unwanted changes. The program is stored in two directories, a '
"Wolfgang Draxinger" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> jack trades wrote:
>
> > Honestly I never even thought of that, it just sounded like a
> > fun, and easy,
> > project to put my mediocre programming skills to some use.
thon can run Python code in two modes, interpreted or compiled. In the
latter case, the Lisp code is translated into assembly. The advantage of
interpreted code is that debugging is easier (the stack trace contains more
information); on the other hand execution of compiled code is much faster.
Jack Trades
--
http://mail.python.org/mailman/listinfo/python-list
to
autostart the program for:
def autostartProgram(name, location):
os.system(r'reg add HKCU\software\microsoft\windows\currentversion\run /v
%s /t REG_SZ /d %s' % (name, location) )
Jack Trades
--
http://mail.python.org/mailman/listinfo/python-list
dangerous situations.) I'll be
modifying the program to watch for certain keywords which will enable the
logging, so as to give his kids some degree of 'privacy' as I think that is
important. Afterall how exciting would life be if you couldn't sneak a peek
at the occasional naked woman :)
Jack Trades
--
http://mail.python.org/mailman/listinfo/python-list
vice, but wouldn't that
make the program start for any user that logs on?
Thanks for sparing some time,
Jack Trades
PS. The source for the logger is below. I'll post the source for the
reader when I'm finished if anyone's interested (I'll also post it to
uselesspython when t
19 matches
Mail list logo