Yu-Xi Lim <[EMAIL PROTECTED]> writes:
> Bill Mill wrote:
>> Your only solution, then, is to write unpopular code. Because, as Alex
>> said, it will otherwise be broken into. Let's look at two very popular
>> pieces of code: Half-Life 2 and Windows XP. How are they secured?
>> Previous version of th
Peter A. Schott <[EMAIL PROTECTED]> writes:
> Per subject - I realize I can copy/paste a line at a time into an interactive
> session when I'm trying to debug, but was wondering if there is any tool out
> there that allows me to copy sections of working Python scripts to paste into
> my
> interact
Leif K-Brooks wrote:
> [EMAIL PROTECTED] wrote:
>
>>Is it possible to recompile the AST generated by compiler.parse, back
>>into code or an executable code object?
>
>
> Into a bytecode object:
>
> >>> from compiler.pycodegen import ModuleCodeGenerator
> >>> from compiler.misc import set_file
Joseph Garvin wrote:
> Steve wrote:
>
>>Hello,
>>
>>Hopefully this is not to of topic. I just installed SuSe
>>10.0
>> and although python installed but no Idle. I can't seem to find it
>> in
>>the list of available packages either. I was wondering if someone
>>might steer me in t
Hi, guys,
This should be a simple problem, but I just can not resolve it. I just
want to use a python script to change my working directory. see my
following code:
# mycd.py
1) destdir = ""
2) command = "cd "+ destdir
3) os.system(command)
4) os.chdir(destdir)
But neither 3) nor 4) is us
Bengt Richter wrote:
> If you want to terminate a generator expression after the first sequence of
> elements
> satisfying a condition, and you don't want to use takewhile, I don't know of
> a gotcha
> to prevent you from just raising StopIteration, using an expression that will
> do that, e.g.
Steve Juranich wrote:
> This should prove most enlightening:
>
> import Tkinter
> dir(Tkinter.Canvas)
>
>
Huh?
Chris Marshall
--
http://mail.python.org/mailman/listinfo/python-list
Now that I have gotoxy() down for moving the cursor around, I want that
to be a result of keypresses (namely from the numpad -- 7 = NorthWest,
8 = North, 9 = NE, etc...). I have little clue how to do this. After
searching google, I've come upon this; include:
import curses
in the header. Howev
zolaris> self.log.write(time.ctime(time.time()))
zolaris> But that prints nothing in the file assigned to log. Is there
zolaris> something I should be doing extra?
There's no newline in there. You probably need to flush the file:
self.log.write(time.ctime(time.time()))
self
Fredrik Lundh wrote:
> [EMAIL PROTECTED] wrote:
>
> > Now, 'i' might have already been defined by A or by the call to
> > A.__init__() so if you define it without knowing that, you could be
> > changing the behavior of A's methods in unknown ways, which is
> > obviously a bad thing.
>
> http://doc
gt;
>given that Swaroop has written a nice book about Python, I somehow
>suspect that he knows how sys.argv works:
>
> http://tinyurl.com/9s7bz
>
Sorry, I wasn't familiar with that (or Swaroop ;-)
>or are you saying that "ps" looks inside sys.argv on your mac
[EMAIL PROTECTED] wrote:
> A simple question - Is it common/good practice to test C code using
> Python? For example one could wrap individual C functions, and test
> each of them using python, maybe not for low-level things but at least
> for algorithmic correctness. Anyone effectively doing this
[EMAIL PROTECTED] wrote:
> I am trying to print the current system time to a file. I know only a
> little bit about Python. I have gotten the very simple:
>
> Print time.time()
>
> to work properly. From what I gather the line to print it to a file
> should look like:
>
> self.log.write(time.
[EMAIL PROTECTED] wrote:
> Suppose you want to write a subclass of some existing class you are
> importing from a module you didn't write and that you don't want to
> study the internals of
No need to study its internals. Fire up a Python interpreter and
inspect its outside:
>>> import foomod
Howdy all,
Okay, so Guido doesn't like Abstract Base Classes[0], and interfaces
are the way of the future[1]. But they're not here now, and I
understand ABCs better.
I want my modules to (sometimes) define an abstract base exception
class, that all other exceptions in that module inherit from.
Samuel Yin <[EMAIL PROTECTED]> writes:
> Hi, guys,
>
> This should be a simple problem, but I just can not resolve it. I just
> want to use a python script to change my working directory. see my
> following code:
>
> # mycd.py
> 1) destdir = ""
> 2) command = "cd "+ destdir
> 3) os.system(c
> sumi <[EMAIL PROTECTED]> writes:
> Hi, i am very new to python , it is just 2 days i started reading abt
> it. I did not understand the above statement.
Just read the document at the URL given to you.
> what i want to do is , i want to login as a super user eg : $su xyz , and
> then i n
Ben Finney <[EMAIL PROTECTED]> writes:
> I've tried doing this in the __init__():
>
> class FooException(Exception):
> """ Base class for all FooModule exceptions """
> def __init__(self):
> raise NotImplementedError, \
> "%s is an abstract class for
Mike Meyer <[EMAIL PROTECTED]> wrote:
> class FooException(Exception):
> def __init__(self):
> if self.__class__ == FooException:
> raise NotImplementedError,
>"FooException is an abstract class for exceptions"
Shall try this when I get the chance.
Peter A.Schott wrote:
> Per subject - I realize I can copy/paste a line at a time into an interactive
> session when I'm trying to debug, but was wondering if there is any tool out
> there that allows me to copy sections of working Python scripts to paste into
> my interactive console and let thos
ej wrote:
> I have often wondered how to get at other internals, such as the name of
> the current function, file, line number I am in? The arguments to the
> current function, etc. I browsed through the table of contents of both the
> Library Reference & Language Reference. I see section 18
Hi Dennis,
Thanks for your help, what is happening is clear now. Just found that
calling curses.raw() lets you get all scan codes.
Cheers
Mack
--
http://mail.python.org/mailman/listinfo/python-list
This is not directly what the OP wanted in regards to Perl, but to see
what one could do if one needed to change the name of the running
program, I wrote this:
## START PROGRAM
import sys
import os.path
import shutil
import os
def testChangingName(appname):
hopedfornameis = appname
mylongn
PL wrote:
> I looked at Stefan's post - but he remarks that "Unfortunately, Blitz
> jealously guards its data (restricted pointers), so that it is not so
> easy to do the conversion in the other direction. If anyone knows an
> answer to this problem, I'd be glad to hear it"
>
> I've previously l
petantik <[EMAIL PROTECTED]> wrote:
...
> I think that is not workable because it is easy to say the the internet
> is available everywhere.
This implies that, if it were difficult to say it, then the scheme WOULD
be workable... which I doubt is what you mean, of course;-)
> It is not availab
Yu-Xi Lim <[EMAIL PROTECTED]> wrote:
...
> My brother is bugged by Civilization IV's copy protection. A couple of
> days ago, after consulting me on what other options he could try, he
> finally said in frustration, "Maybe I should go buy the game."
It's interesting, in this context, that Civi
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > >>> list (x for x in xrange(20) if x<5 or iter([]).next())
> > [0, 1, 2, 3, 4]
> >
> > Or a bit more readably:
> > >>> def stop(): raise StopIteration
> > ...
> > >>> list (x for x in xrange(20) if x<5 or stop())
> > [0, 1, 2, 3, 4]
> >
> > IO
I've been thinking about writing a program to generate the world's
largest prime numbers, just for the fun of it. This would require being
able to hold an 800 digit number into memory (25 megabits, or a
little over 3 megs of memory for just one variable...) I would also
need several smaller var
Thanks for your answer. I know why the why os.system or os.chdir failed
change my directory.
But Sorry for my un-clear description of my problem. Currently I work
in window platform, use cmd.exe instead of bash.
I mentioned bash just as a example to illustrate my problem.
Thanks and Reg
I've created Windows binaries for Python 2.3 and 2.4. It should be
compatible with PentiumPro or later processors.
They can be found at http://home.comcast.net/~casevh/
Case
--
http://mail.python.org/mailman/listinfo/python-list
oops, stand corrected. I was under the impression that an exception
would break out of the current expression and forgot that the "for"
would contain it(that StopIteration is a condition to it expects to
stop it).
thanks, this is the functionality I am looking for.
Alex Martelli wrote:
> Can you
For more information on how the largest prime number was found, see
www.mersenne.org.
Python does support large numbers, but it's not very fast for such
large numbers. There is a Python module called GMPY that uses the GMP
(Gnu Multiple Precision) library for faster operations on large
numbers.
B
Hi, Can I get a system date time?
I want to get current time, like
the target string should looks like:
the output of : `date +"%Y%m%d %H:%M:%S"`
how can i do this?
thanks.
--
http://mail.python.org/mailman/listinfo/python-list
Bengt Richter wrote:
> IOW, your "when condition(x)" (IIUIC) can be spelled "if condition(x) or
> stop()"
neat trick.
--
http://mail.python.org/mailman/listinfo/python-list
Hello! I'm new to the group and am looking for a decent reference for
information about the history / evolution of the Python language and
its features. Typing, scoping, etc... I'd appreciate any good links.
Thanks!
- Derek
--
http://mail.python.org/mailman/listinfo/python-list
>it looks like LB has configured his browser to pass all gz files to some
>ancient VRML plugin; see e.g.
You are right! And now it's fixed.
But till yesterday I did download of .gz file with no problems at
all...
Thanks,
LB
--
http://mail.python.org/mailman/listinfo/python-list
>it looks like LB has configured his browser to pass all gz files to some
>ancient VRML plugin; see e.g.
You are right! And now it's fixed.
But till yesterday I did download of .gz file with no problems at
all...
Thanks,
LB
--
http://mail.python.org/mailman/listinfo/python-list
PYTHON Engineers, BitTorrent, Inc. lace w:st="on">San Francisco, CAlace >Interested candidates should forward their resumes to [EMAIL PROTECTED]>>for immediate consideration. No resume? No problem
..Tell us about your Python skills and how you may have contributed to the Open Source community
PYTHON Engineers, BitTorrent, Inc., San Francisco, CA
Interested candidates should forward their resumes to
[EMAIL PROTECTED] for immediate consideration. No resume? No
problem
..Tell us about your Python skills and how you may have
contributed to the Open Source community.
WHO WE ARE:
BitT
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] says...
> Why does there need to be OO "in the core"? That is one thing I have
> never understood. If you want OO, get a package that fits your style of
> OO and "package require" you are off and running. That probably isn't
> what you would be loo
On 10 Nov 2005 16:07:56 -0800, "Paul Boddie" <[EMAIL PROTECTED]> wrote:
>Bengt Richter wrote:
>> I've also posted sporadic musings about the possibilities for
>> AST-transforming
>> custom import functions to do optimizations and macros and special forms
>> etc.,
>> but no one seemed much intere
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> Hi, Can I get a system date time?
time.time()
> I want to get current time, like
> the target string should looks like:
> the output of : `date +"%Y%m%d %H:%M:%S"`
>
> how can i do this?
>>> time.strftime("%Y%m%d %H:%M:%S")
'2005 02:44
hi
I wish to pop/del some items out of dictionary while iterating over it.
a = { 'a':1, 'b':2 }
for k, v in a.iteritems():
if v==2:
del a[k]
the output say RuntimeError: dictionary changed size during iteration
how can i suppress this message in an actual script and still get the
final
201 - 243 of 243 matches
Mail list logo