Hi,
I'm trying to update the fuse python bindings to my app and I was
curious if there were any C utility functions that would turn a
sys.argv into a C style argv array, or am I going to have to write
those myself?
Thanks.
--
burton samograd kruhft .at.
Burton Samograd <[EMAIL PROTECTED]> writes:
> I'm trying to update the fuse python bindings to my app and I was
> curious if there were any C utility functions that would turn a
> sys.argv into a C style argv array, or am I going to have to write
> those myself?
Follo
ny jobs for philosophers, and their works are
generally very underappreciated during thier lives, but it's quite
difficult to say that it's useless, just often misunderstood by the
less forward thinking people of their time.
--
burton samograd kruhft .at. gma
elect into a variable?
popen doesn't work that way. you can only open them read or write.
you'll have to create a couple of pipes (one for reading, one for
writing), do a fork, execve, etc with the posix api. at least that's
how one does it in C...i'm a bit new to pyth
nd assuming your language has no bugs. Imperative programming is
mathematics with state; functional programming *is* mathematics.
--
burton samograd kruhft .at. gmail
kruhft.blogspot.com www.myspace.com/kruhft metashell.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
the maximum allowed address space mapping.
You should partition your data into hierarchial modules and let python
do the swapping for you...although you have 16 gigs (I have to put a
holy crap after that!) you will always run into process limits, at
least until true 64 bit os's a
.program")
import config
So I guess the real question is:
Is there a way to create a module namespace and populate it
before sourcing the file?
--
burton samograd kruhft .at. gmail
kruhft.blogspot.com www.myspace.com/kruhft metashell.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
Burton Samograd <[EMAIL PROTECTED]> writes:
> Is there a way to create a module namespace and populate it
> before sourcing the file?
A reply to my own question, but I thought I would share the answer. I
got it to work with the following code:
import config
import sy
pass # ignore missing config file, but not syntax errors
>
> # end of file
>
> with this in place, you just have to do
>
> import config
>
> in any application module than needs to access the configuration
> data.
nice, that looks to be just what I was look
Hi,
Is there any way to 'prototype' functions in python, as you would in
C? Would that be what the 'global' keyword is for, or is there a more
elegant or 'pythonic' way of doing forward references?
--
burton samograd kruhft
Duncan Booth <[EMAIL PROTECTED]> writes:
> Burton Samograd wrote:
> > Is there any way to 'prototype' functions in python, as you would in
> > C? Would that be what the 'global' keyword is for, or is there a more
> > elegant or 'pythonic&
e
the functions defined somewhere else and then let the linker work it
all out for me. I was hoping that python had some sort of lazy
evaluation scheme for this type of behaviour so that you could defer
linkage (or variable evalutation) until runtime, or at least variable
reference (through the
bruno at modulix <[EMAIL PROTECTED]> writes:
> Burton Samograd wrote:
> > Duncan Booth <[EMAIL PROTECTED]> writes:
>
> dont use 'dict' as an identifier, it shadows the builtin dict type.
just an example i jotted down, not real
bruno at modulix <[EMAIL PROTECTED]> writes:
> Burton Samograd wrote:
> > "infidel" <[EMAIL PROTECTED]> writes:
> > I'm a C programmer, so I'm doing it in a bit of a C like way;
> > prototype the function, initalize the array using the prototyp
Hello,
I was wondering if there is any way in python to 'collect output to
string' as in some lisps/schemes. Output being, printed output to the
console using print.
Thanks.
--
Burton Samograd
--
http://mail.python.org/mailman/listinfo/python-list
Chris Rebert writes:
> On Tue, Nov 23, 2010 at 11:53 AM, Burton Samograd wrote:
>> Hello,
>>
>> I was wondering if there is any way in python to 'collect output to
>> string' as in some lisps/schemes. Output being, printed output to the
>> cons
occasionally want to capture test reports.
Thanks for the info, but I was looking for a way to collect output
without modifying the original function, similar to
with-output-to-string in some schemes.
--
Burton Samograd
--
http://mail.python.org/mailman/listinfo/python-list
pattern for this problem? Is there a better way of approaching
> it other than making a set of dictionaries which "mirror" the
> originals? FWIW, I have approximately 50 tables ranging from 2
> entries to over 100.
Looks like there might be some solutions here:
http://stackov
;{ 'x': 1, 'y': 2 }" # close but not quite a JSON string
>>> `x`.replace("'", '"')
'{ "x": 1, "y": 2 }' # JSON and python compatible
So the question is, is there an automatic way to tell python to use "
instead of ' when doing a repr of lists?
Thanks.
--
Burton Samograd
--
http://mail.python.org/mailman/listinfo/python-list
setting the mod.__file__ variable and as my
own idea I set __file__ in mod.__dict__. Niether of these steps seem to
set the file properly in the backtrace.
So the question here is, where does the backtrace printing module get
it's __file__ parameters from, or what am I missing to set it prope
Peter Otten <__pete...@web.de> writes:
> If you make the compilation step explicit you can pass a filename:
>
>>>> exec compile("def f(x): return f(x-1) if x else 1/0", "yadda.py",
> "exec")
The works great. Problem solved. Thanks
ial utilities to do this??
>
> Not if the OS and VFS are competently designed. In Linux all you need
> to do is this:
>
> mount -o loop /path/to/file.iso /mount/point
>
> Apparently you've got to jump through all sorts of hoops using 3rd
> party software to do something an
resulting compiled code. If the compilation is
successful, it will then run the code, where you might have run-time
errors, which are code with a proper syntax but errors during execution.
--
Burton Samograd
--
http://mail.python.org/mailman/listinfo/python-list
Mahmood Naderan writes:
> So is it a compiler or interpreter?
There's a compiler that compiles python to bytecode which is then
interpreted. This saves the interpreter from having to re-parse the
code at run time.
So, it's an interpreter that compiles the code first.
--
Bu
l:
>>> def mud():
global dept
dept+=1
print dept
--
Burton Samograd
--
http://mail.python.org/mailman/listinfo/python-list
kimjeng writes:
> On Aug 22, 7:38 am, Anssi Saari wrote:
>> kimjeng writes:
>> > the thing is i have installed gtkglextmm both from source and via a
>> > slackbuilds package script and i still get the same error,
>> > help would be a appreciated
>>
>> You'll just have to check what it is config
ing messages output them rather than the above
> default values?
Use this rather than execfile:
exec compile(code, filename, "exec")
You'll have to read the contents of the file into the string 'code'
first (unless compile will take a file object, which I'm not sure
about).
--
Burton Samograd
--
http://mail.python.org/mailman/listinfo/python-list
a file and say "Play the section of this file from 10.25 seconds
> to 11.73 seconds." Is there a library that makes this easy in Python?
You might want to check out this question on StackOverflow:
http://stackoverflow.com/questions/108848/python-music-library
--
Burton Samograd
flebber writes:
> But where is this saving the imported file and under what name?
Looks like samples.csv:
> f = open('samples.csv', 'w')
--
Burton Samograd
--
http://mail.python.org/mailman/listinfo/python-list
29 matches
Mail list logo