Christian Dieterich wrote:
On Dé Céadaoin, Feabh 2, 2005, at 17:48 America/Chicago,
[EMAIL PROTECTED] wrote:
Hi there
I started a very long and roundabout process of attempting to install
python 2.3.4 along side my apple-installed 2.3 system. To make a long
story short, I have completely confabul
Dave Cole wrote:
> for (i = 0; i < num_values; i++) {
> PyObject *obj;
>
> obj = PyInt_FromLong(value[i]);
> if (obj == NULL
> || PyTuple_SetItem(tuple, i, obj) != 0) {
> Py_DECREF(tuple);
> return NULL;
> }
> }
in theory, if PyInt_FromLong succeeds, and PyTuple_SetIte
-Original Message-
From: [EMAIL PROTECTED] on behalf of John Machin
Sent: Thu 2/3/2005 12:03 AM
To: python-list@python.org
Subject: Re: Crashing Python interpreter! (windows XP, python2.3.4,
2.3.5rc1,2.4.0)
> Leeuw van der, Tim TOP-POSTED:
> > Hi all,
> >
[...]
> >
> > Leeuw van der, T
John Machin wrote:
>> you should check the return value, though. PyList_SetItem may (in
>> theory) fail.
>
> :-)
> Only a bot could say that. We mere mortals have been known to do things
> like (a) pass a non-list as the first argument (b) pass an out-of-range
> value for the second argument.
ev
"
A cooperation between Sun Microsystems and IBM&Co. in conjunction with
liberal & high evolutive communities would result in an nearly
unbeatable programming platform.
My evaluation has shown: this is a non achievable goal, as stubborness
and egoism rules - instead of reason and cooperation.
Thus
David Douard a écrit :
Alan,
I did search Google for this problem (not enough, thou).
In fact, I found some kind of solution (by myself, not that much on Google),
but it is not really satisfactory.
I have used win32 pipes to do so (win32api.CreatePipe). I can redirect
stdout/stderr to it from my py
Marc Christiansen <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > Nick Coghlan <[EMAIL PROTECTED]> wrote:
> >> Hmm, when the second argument is omitted, the system call looks like:
> >>
> >> getservbyname("daytime", NULL);
> >>
> >> Based on "man getservbyname" on my Linux PC, that shou
Hello Lad,
> In a file there can be several dictionaries like this
> {Key11: Value11
> Key12: Value12
> Key13: Value13,
> ...
> ...
> Key1n:Value1n}
> {Key21: Value21
> Key22: Value22
> Key23: Value23,
> ...
> ...
> Key2n:Value2n}
> {Key31: Value31
> Key32: Value32
> Key33: Value33,
> ...
> ...
>
Gurpreet Sachdeva wrote:
The purpose is, I pass a list to a class in a module but I want to use
that list out of the scope of that class and that too not in any other
class or a function but in the main program...
The problem is that when I import that, the statements in the module
which are not in
O/S: Windows XP Home (with Service Pack 2)
Downloaded python-2.4.msi from python.org (10,632KB). When I double
click on the file from Windows Explorer, the installation process
presents the window in which I am prompted to either install for all
users (the default) or install for just me. I selec
Just submitted a recipe with this goal in mind:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/365606
Michele Simionato
--
http://mail.python.org/mailman/listinfo/python-list
fortepianissimo wrote:
We all know that using __getattr__() we can compute an instance
variable on demand, for example:
class Foo:
def __getattr__ (self, name):
if name == 'bar':
self.bar = 'apple'
return self.bar
else:
raise AttributeError()
Then we can
f = Foo()
s1 = f.bar
s2 = f.bar # this use
"Neil Benn" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
Neil Benn wrote:
Hello,
I'm running a test and having issues with logging, if I call
logging.shutdown() and then want to start the logging going again
then I get a problem as if I call shutdown, I can't get th
We all know that using __getattr__() we can compute an instance
variable on demand, for example:
class Foo:
def __getattr__ (self, name):
if name == 'bar':
self.bar = 'apple'
return self.bar
else:
raise AttributeError()
Then we can
f = Foo()
s1 = f.bar
s2 = f.bar # this uses the "cached" resul
The purpose is, I pass a list to a class in a module but I want to use
that list out of the scope of that class and that too not in any other
class or a function but in the main program...
The problem is that when I import that, the statements in the module
which are not in the class are executed f
Timothy Fitz wrote:
> I am interested in helping Python, however my knowledge of Abstract
> Syntax Trees is lacking. Where should I turn to educate myself? Any
> books or websites would be appreciated.
Follow the links and advice in this python-dev thread:
http://marc.free.net.ph/thread/20050104.0
keerist. I suspected as much. so much for my happy Mac feeling to date.
--
http://mail.python.org/mailman/listinfo/python-list
WingIDE looks nice though, and it seems that the interactive shell is
built in from the screenshots. Can you run a program to a certain point
break point and use the shell?
On Wed, 02 Feb 2005 23:40:40 -0500, Stephen Waterbury <[EMAIL PROTECTED]>
wrote:
Daniel Bickett wrote:
This is certai
Daniel Bickett wrote:
This is certainly a worthy topic. There are several IDEs for Python
(one I like very much being Komodo) that have plenty of fancy
debugging features and advanced operations, however I have yet to
encounter (elsewhere) the convenience that comes with being able to
press F5 and
Robert Kern wrote:
Justin Lemkul wrote:
Hello all,
I am hoping someone out there will be able to help me. I am trying to
install a program that utilizes NumPy. In installing NumPy, I
realized that I was lacking Atlas. I ran into the following problems
installing Atlas and NumPy, as I realized
John Machin wrote:
Dave Opstad wrote:
One of the functions in a C extension I'm writing needs to return a
tuple of integers, where the length of the tuple is only known at
runtime. I'm currently doing a loop calling PyInt_FromLong to make
the
integers,
What is the purpose of this first loop?
In wh
Erick wrote:
Hello,
I've been looking for a while for an answer, but so far I haven't been
able to turn anything up yet. Basically, what I'd like to do is to use
re.finditer to search a large file (or a file stream), but I haven't
figured out how to get finditer to work without loading the entire f
Erik Johnson wrote:
"Erick" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Ah, you're running into the "old-style classes vs. new style classes".
Try subclassing from "object".
For example:
class A(object):
That works! :) I guess I am fortunate to be running 2.2 - looks kinda ugly
prio
Tim Daneliuk wrote:
Steve Holden wrote:
Roland Heiber wrote:
Tim Daneliuk wrote:
Aha! Exactly ... and that makes perfect sense too. D'oh! I guess a
better
distribution strategy would be to have the installation program generate
the pyo
file at installation time...
Thanks -
Also, the *.py? fil
On Dé Céadaoin, Feabh 2, 2005, at 17:48 America/Chicago,
[EMAIL PROTECTED] wrote:
Hi there
I started a very long and roundabout process of attempting to install
python 2.3.4 along side my apple-installed 2.3 system. To make a long
story short, I have completely confabulated my environment ( i del
On Dé Céadaoin, Feabh 2, 2005, at 13:26 America/Chicago, Nemesis wrote:
Hi all, I'm trying to write a multiplatform function that tries to
return the actual user home directory. I saw that
Please, could you test it on your systems and tell me what you got?
I'd like to know what it returns on diffe
This is certainly a worthy topic. There are several IDEs for Python
(one I like very much being Komodo) that have plenty of fancy
debugging features and advanced operations, however I have yet to
encounter (elsewhere) the convenience that comes with being able to
press F5 and have an interactive in
Erick wrote:
> True, but it doesn't work with multiline regular expressions :(
If your intent is for the expression to traverse multiple lines (and
possibly match *across* multiple lines,) then, as far as I know, you
have no choice but to load the whole file into memory.
--
Daniel Bickett
dbicke
Is it not possible to wrap your loop below within a loop doing
file.read([size]) (or readline() or readlines([size]),
reading the file a chunk at a time then running your re on a per-chunk
basis?
-ej
"Erick" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Ack, typo. What I mea
The original message was received at Thu, 3 Feb 2005 08:03:02 +0500
from [182.255.28.192]
- The following addresses had permanent fatal errors -
python-list@python.org
- Transcript of session follows -
... while talking to 72.27.31.20:
550 5.1.2 ... Host unknown (Name server: host
"Erick" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Ah, you're running into the "old-style classes vs. new style classes".
> Try subclassing from "object".
>
> For example:
>
> >>> class A(object):
That works! :) I guess I am fortunate to be running 2.2 - looks kinda ugly
prior
Nemesis said the following on 2/2/2005 2:26 PM:
Hi all, I'm trying to write a multiplatform function that tries to
def getHomeDir():
''' Try to find user's home directory, otherwise return current
directory.'''
Please, could you test it on your systems and tell me what you got?
I'd like to kno
[EMAIL PROTECTED] wrote:
Hi there
I started a very long and roundabout process of attempting to install
python 2.3.4 along side my apple-installed 2.3 system. To make a long
story short, I have completely confabulated my environment ( i deleted
the 2.3 binaries and so forth from the system in an at
This is sort of both Python and Vim related (which is why I've posted to
both newsgroups).
Python related:
--
I have been frustrated for quite some time with a lack of a history
command in IDLE (in fact with IDLE in general). Often I'll develop new
code at the command li
I am interested in helping Python, however my knowledge of Abstract
Syntax Trees is lacking. Where should I turn to educate myself? Any
books or websites would be appreciated.
--
http://mail.python.org/mailman/listinfo/python-list
Cappy2112 wrote:
> > dictionaries can NOT contain dictionaries.
>
> Who told you this?
> In my python, they can.
> [snip]
You took his reply out of context. Fuzzyman asked him if *his*
dictionaries were to contain dictionaries, and the reply was no, they
will not.
--
Daniel Bickett
dbickett at
True, but it doesn't work with multiline regular expressions :(
-e
--
http://mail.python.org/mailman/listinfo/python-list
Ah, you're running into the "old-style classes vs. new style classes".
Try subclassing from "object".
For example:
>>> class A(object):
... pass
...
>>> a=A()
>>> type(a)
>>> type(a) == A
True
>>> type(a) is A
True
>>> b=A()
>>> type(a) == type(b)
True
>>> type(a) is type(b)
True
Check out t
Ack, typo. What I meant was this:
cat a b c > blah
>>> import re
>>> for m in re.finditer('\w+', file('blah')):
... print m.group()
...
Traceback (most recent call last):
File "", line 1, in ?
TypeError: buffer object expected
Of course, this works fine, but it loads the file completely into
m
The following example loads the file into memory only one line at a
time, so it should suit your purposes:
>>> data = file( "important.dat" , "w" )
>>> data.write("this\nis\nimportant\ndata")
>>> data.close()
now read it
>>> import re
>>> data = file( "important.dat" , "r" )
>>> line = data.
Ah, you're running into the "old-style classes vs. new style classes".
Try subclassing from "object".
For example:
>>> class A(object):
... pass
...
>>> a=A()
>>> type(a)
>>> type(a) == A
True
>>> type(a) is A
True
>>> b=A()
>>> type(a) == type(b)
True
>>> type(a) is type(b)
True
Check out t
On 2005-02-01, alexrait1 <[EMAIL PROTECTED]> wrote:
> I tried to delete this message, but I guess it was too late... or it
> didn't work for me... sorry anyway.
No worries. Since the article didn't have a refereces or
in-reply-to header, it showed up as the first post in it's own
thread. I late
On Erik Johnson wrote:
> # The following "works", but I don't want to keep a set of instances to
> compare against
> >>> obj2 = A()
> >>> type(obj) == type(obj2)
> 1
How about:
>>> class A:
pass
>>> class B:
pass
>>> objA = A()
>>> type( objA ) == type( A() )
True
then again
On 2005-02-01, Jeremy Bowers <[EMAIL PROTECTED]> wrote:
> On Tue, 01 Feb 2005 21:57:45 +, Grant Edwards wrote:
>
>> On 2005-02-01, alexrait1 <[EMAIL PROTECTED]> wrote:
>>
>>> Do something useful... (at least for me) For instance I need a gtk
>>> frontend for pgp. So here you can have an opport
Hello,
I've been looking for a while for an answer, but so far I haven't been
able to turn anything up yet. Basically, what I'd like to do is to use
re.finditer to search a large file (or a file stream), but I haven't
figured out how to get finditer to work without loading the entire file
into mem
I quickly browsed through section 9 of the Tutorial, tried some simple
Google searches: I'm not readily seeing how to test class type. Given some
object (might be an instance of a user-created class, might be None, might
be list, might be some other "standard" type object instance), how do yo
> dictionaries can NOT contain dictionaries.
Who told you this?
In my python, they can.
d1={1:"one"}
>>> d2={2:"two"}
>>> d1
{1: 'one'}
>>> d2
{2: 'two'}
>>> d3={3:d2}
>>> d3
{3: {2: 'two'}}
[EMAIL PROTECTED] wrote:
> Fuzzyman wrote:
> > Can your dictionaries contain dictionaries ?
> Hi Fuzzy,
Kartic schreef:
> Or if you are the networking types, come up with a peer-to-peer chat
> application with whitetboard capability, which I am sure will be fairly
> novel.
Hm, a Python version of The Coccinella? :-)
--
JanC
"Be strict when sending and tolerant when receiving."
RFC 1958 - Arch
Paul Rubin schreef:
> My IANAL amateur reading is that the GPL does in fact apply, at least
> in the US. Running the program is not restricted, but loading the
> program from disk to memory before you can run it counts as copying
> it, which invokes the license, Computer Associates v. Altai, 982
In article news.t-online.com>,
"Diez B. Roggisch" web.de> wrote:
you confuse unicode with utf8. Expat can parse the latter - the former is
internal to python. And passing it to something that needs a string will
result in a conversion - which fails because of the ascii encoding.
Ahh... that make
Valone, Toren W. wrote:
Traceback (most recent call last):
File "C:/Python24/dialog1.py", line 29, in -toplevel-
d = MyDialog(root)
NameError: name 'MyDialog' is not defined
Suggestion: Read the place in your code where MyDialog is defined and compare it
with where it is used. Check case. Yo
Ok it has been a long day,
In my reply to Steven Bethard , Steve should read Steven ;)
M.E.Farmer
--
http://mail.python.org/mailman/listinfo/python-list
Hi guys,
I realise this question has been answered in one form or another many
times before but I can't quite find the solution I need. I am trying to
run multiple subprocesses from a python script and then wait until all
subprocesses have completed before continuing. The subprocesses run on
other
Steve,
Yes I agree ;) Never use builtin names.
I know better but missed it somehow.
I apologize for any confusion I may have caused.
Thank you Steve for the correction.
M.E.Farmer
Steven Bethard wrote:
> M.E.Farmer wrote:
> > alex wrote:
> >> is it possible to create 'global' variables that can be
Python 2.4 (#1, Jan 1 2005, 21:33:55)
[GCC 3.3.4] on linux2
Slackware 10 Current
Works! Nice.
--
http://mail.python.org/mailman/listinfo/python-list
> print d.encode('cp437')
So I would have to specify the encoding on every call to print? I am
sure to
forget and I don't like the program dying, in my case garbled output
would be
much more acceptable.
Marian I'm with you. You never known you have put enough encode in all the
right places a
One way to to this is by using keyword args:
class a:
def __init__(self, arg1, arg2, **kwargs):
#
# Dictionary kwargs will have keyword, value pairs
# that can be used as global space.
#
self.arg1=arg1
self.arg2=arg2
self.__dict__.update(k
M.E.Farmer wrote:
alex wrote:
is it possible to create 'global' variables that can be seen in all
other classes?
What about using a class?
Py> class globalVar:
...pass
Py> globals = globalVar()
Probably naming it something other than 'globals' would be a good idea
-- otherwise you'll hide the
Hi guys,
I realise this question has been answered in one form or another many
times before but I can't quite find the solution I need. I am trying to
run multiple subprocesses from a python script and then wait until all
subprocesses have completed before continuing. The subprocesses run on
other
"Fuzzyman" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Equally possible (or more likely !) is that I misunderstand it :
Or that you did not sufficiently test the indicated difference ;-)
> The docs for compile say that if you are creating a code object from a
> sequence of sta
alex wrote:
> Hi,
>
> is it possible to create 'global' variables that can be seen in all
> other classes?
>
> Alex
Hello,
What about using a class?
Py> class globalVar:
...pass
Py> globals = globalVar()
Now you can assign 'variables' to it.
And use it anywhere you need it.
Py> globals.imag
Hi there
I started a very long and roundabout process of attempting to install
python 2.3.4 along side my apple-installed 2.3 system. To make a long
story short, I have completely confabulated my environment ( i deleted
the 2.3 binaries and so forth from the system in an attempt to start
things fr
Valone, Toren W. wrote:
Ok, new to Python and Tkinter.. Following along examples in book, got to
dialog windows example coded this
# dialog1.py
from Tkinter import *
class Mydialog:
[...]
d = MyDialog(root)
root.wait_window(d.top)
When I run it IDLE
Tim Daneliuk wrote:
Steve Holden wrote:
Roland Heiber wrote:
Tim Daneliuk wrote:
It does - thanks. One more question: Are pyc and pyo file portable
across operating systems? I suspect not since I generated a pyo
on a FreeBSD machine that will not run on a Win32 machine. I was
under the impressi
Steve Holden wrote:
Roland Heiber wrote:
Tim Daneliuk wrote:
It does - thanks. One more question: Are pyc and pyo file portable
across operating systems? I suspect not since I generated a pyo
on a FreeBSD machine that will not run on a Win32 machine. I was
under the impression that "compiled" m
Ok, new to Python and Tkinter.. Following along examples in book, got to
dialog windows example coded this
# dialog1.py
from Tkinter import *
class Mydialog:
def _int_(self,parent):
top = self.top = Toplevel(parent)
Label(top, text="Value").pack()
self.e = Entry(top
David Douard wrote:
> Marcel van den Dungen wrote:
>
>> alex wrote:
>>> Hi,
>>>
>>> I am a beginner with python and here is my first question:
>>> How can I read the contents of a file using a loop or something? I open
>>> the file with file=open(filename, 'r') and what to do then? Can I use
>>>
alex wrote:
Hi,
is it possible to create 'global' variables that can be seen in all
other classes?
Alex
Not sensibly, though you can mess around with the __builtin__ namespace
to make values accessible without qualification.
The usual solution is to maintain a config module that establishes
defa
Marcel van den Dungen wrote:
> alex wrote:
>> Hi,
>>
>> I am a beginner with python and here is my first question:
>> How can I read the contents of a file using a loop or something? I open
>> the file with file=open(filename, 'r') and what to do then? Can I use
>> something like
>>
>> for xxx i
Roland Heiber wrote:
Tim Daneliuk wrote:
It does - thanks. One more question: Are pyc and pyo file portable
across operating systems? I suspect not since I generated a pyo
on a FreeBSD machine that will not run on a Win32 machine. I was
under the impression that "compiled" meant optimized byte
Martin Blume wrote:
> I have a number-crunching application that spits out
> a lot of numbers. Now I'd like to pipe this into a python
> app and plot them using Tkinter, such as:
> $ number_cruncher | myplot.py
> But with Tkinter once I call Tkinter's mainloop() I
> give up my control of the app
Steve Holden wrote:
But I also want the bytecode of modules that don't have a .pyc file,
possibly because they have already been 'dynamically' loaded from
another bytecode string ;-)
Aah, right, I suspect in these cases (which *are* pretty far from the
ordinary run of things) you'd sometimes be up
Tim Daneliuk wrote:
It does - thanks. One more question: Are pyc and pyo file portable
across operating systems? I suspect not since I generated a pyo
on a FreeBSD machine that will not run on a Win32 machine. I was
under the impression that "compiled" meant optimized byte code that
was portabl
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi,
Please excuse the intrusion from an admirer, but not a user, of Python.
I've got an idea that I think could improve the language and might be
relatively simple to implement. I've developed a prototype with a toy
language here:
Roland Heiber wrote:
Tim Daneliuk wrote:
I use a makefile to create distribution tarballs of freestanding Python
programs and their documentation. I cannot seem to find the right
command line option to just generate a pyc/pyo file from the program
and then exit. If I use 'python - -c"import m
Fredrik Lundh wrote:
>
> >PyList_SetItem(List,i,Str);
>
> you should check the return value, though. PyList_SetItem may (in
> theory) fail.
>
:-)
Only a bot could say that. We mere mortals have been known to do things
like (a) pass a non-list as the first argument (b) pass an out-of-range
va
I am trying to use pyfmod in python to manipulate sound.
i have installed pyfmod, ctype, numarray (if they are necessary), i
also copied fmod.dll to python/DLLs as well as windows/system32, but
when i tried
import pyFMOD
I got:
Traceback (most recent call last):
File "", line 1, in -topleve
Irmen de Jong wrote:
Steve Holden wrote:
Having said which, if the module was loaded from a .pyc file then the
bytecode is available from that - take everything but the first eight
bytes and use marshal.loads() to turn it back into a code object:
Yup. As I explained in the other message, this is
Hi,
is it possible to create 'global' variables that can be seen in all
other classes?
Alex
--
http://mail.python.org/mailman/listinfo/python-list
I am trying to use pyFMOD, I have installed all other supporting
libraries (hopefully), such as ctypes, numarray, I also installed FMOD
itself and copied its DLL files to python/DLLs. When I try to import
pyFMOD in python, i got this message:
>>> import pyFMOD
Traceback (most recent call last):
Leeuw van der, Tim TOP-POSTED:
> Hi all,
>
> I can use this version of gtk and PyGtk to run simple programs. There
seems to be no problem with the code-completion in PythonWin.
> I can do: dir(gtk) without problems after importing the gtk module of
PyGtk, when I use idle or console. (Python versio
Tim Daneliuk wrote:
I use a makefile to create distribution tarballs of freestanding Python
programs and their documentation. I cannot seem to find the right
command line option to just generate a pyc/pyo file from the program
and then exit. If I use 'python - -c"import myprog"' it creates
th
On Wed, 02 Feb 2005 14:45:35 -0800 (PST), Simo Melenius
<[EMAIL PROTECTED]> wrote:
> Philippe Fremy <[EMAIL PROTECTED]> writes:
>
> > You can not reproduce the C++ overload idiom but you can get something
> > close with manual type testing.
> >
> > > To in a
> > > function do an if statement wit
Steve Holden wrote:
I'm not sure why you think the module's code would be needed once it's
been executed. That assigns all necessary code blocks to the functions
defined therein, so the code, once the import has been executed, is
garbage (from the interpreter's rather process-centric view of thi
Steve Holden wrote:
Having said which, if the module was loaded from a .pyc file then the
bytecode is available from that - take everything but the first eight
bytes and use marshal.loads() to turn it back into a code object:
Yup. As I explained in the other message, this is basically
what I'm do
Philippe Fremy <[EMAIL PROTECTED]> writes:
> You can not reproduce the C++ overload idiom but you can get something
> close with manual type testing.
>
> > To in a
> > function do an if statement with the type() function?
>
> I am not aware of any other method.
>
> def a( arg1 ):
> if t
Irmen de Jong wrote:
Mark Nenadov wrote:
On Wed, 02 Feb 2005 23:03:17 +0100, Irmen de Jong wrote:
What would be the best way, if any, to obtain
the bytecode for a given loaded module?
I can get the source:
import inspect
import os
src = inspect.getsource(os)
but there is no ispect.getbytecode() ;
Mark Nenadov wrote:
On Wed, 02 Feb 2005 23:03:17 +0100, Irmen de Jong wrote:
What would be the best way, if any, to obtain
the bytecode for a given loaded module?
I can get the source:
import inspect
import os
src = inspect.getsource(os)
but there is no ispect.getbytecode() ;-)
--Irmen
The inspe
Mark Nenadov wrote:
On Wed, 02 Feb 2005 23:03:17 +0100, Irmen de Jong wrote:
What would be the best way, if any, to obtain
the bytecode for a given loaded module?
I can get the source:
import inspect
import os
src = inspect.getsource(os)
but there is no ispect.getbytecode() ;-)
--Irmen
The inspe
"Giovanni Bajo" <[EMAIL PROTECTED]> writes:
> Just today I was writing some code where I wanted to use sets for
> the abstraction (intersection, etc.), but also carry some values
> with them to process. So, yes, I believe that having set-like
> abstraction for dictionaries would be great. In fact,
I use a makefile to create distribution tarballs of freestanding Python
programs and their documentation. I cannot seem to find the right
command line option to just generate a pyc/pyo file from the program
and then exit. If I use 'python - -c"import myprog"' it creates
the pyo file, but mypr
On Wed, 02 Feb 2005 23:03:17 +0100, Irmen de Jong wrote:
> What would be the best way, if any, to obtain
> the bytecode for a given loaded module?
>
> I can get the source:
> import inspect
> import os
> src = inspect.getsource(os)
>
> but there is no ispect.getbytecode() ;-)
>
> --Irmen
The
alex wrote:
Hi,
I am a beginner with python and here is my first question:
How can I read the contents of a file using a loop or something? I open
the file with file=open(filename, 'r') and what to do then? Can I use
something like
for xxx in file:
Yes, indeed you can. That's by no means *a
What would be the best way, if any, to obtain
the bytecode for a given loaded module?
I can get the source:
import inspect
import os
src = inspect.getsource(os)
but there is no ispect.getbytecode() ;-)
--Irmen
--
http://mail.python.org/mailman/listinfo/python-list
"jelle" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> >You could probably write your own FixedPoint function without too much
>>difficulty, with the only tricky part being for it to know when to
> stop!
>
> It would be quite interesting to have this kind of function. But
> likely
alex wrote:
Hi,
I am a beginner with python and here is my first question:
How can I read the contents of a file using a loop or something? I open
the file with file=open(filename, 'r') and what to do then? Can I use
something like
for xxx in file:
Thanks for help
Alex
take a look at this:
Can someone help me on this, I don' know where the "testmptest" came from
but the mptest.py is at the /usr/local/apache2/htdocs/test directory and
this error came from apache's error_log
PythonHandler mod_python.publisher: ImportError: No module named testmptest
Thanks,
Joel
--
http://mail.py
Hi Alex
Assuming you have a file called "data.txt":
***
f = open('data.txt','r')
lines = f.readlines()
f.close()
for line in lines:
print line
***
Will print each line of the file.
You can make a huge investment by setting 2 or 3 hours aside to go through
the Python tutorial, which gets insta
Steven, thanks for your help once again :)
so you could write the code like:
test = 'first'
class aclass:
def __init__(self, value):
mod = __import__(__name__)
mod.test = value
This is sweet. I really like this technique for manipulating module-scope
identifiers (from with
On Wed, 02 Feb 2005 16:20:41 -0500, Jeremy Bowers wrote:
> That said, "__main__" indicates you ran it in the interactive shell.
Or ran it directly on the command line. Duh. I thought that clause really
loudly, but I guess I never actually typed it.
--
http://mail.python.org/mailman/listinfo/pytho
1 - 100 of 250 matches
Mail list logo