On Apr 25, 8:11 am, "Ciprian Dorin, Craciun"
wrote:
> Well in fact I would have written it like:
>
> def validate_commandline(rexes, line) :
> if not compare (rexes, line, re.match) :
> if len (rexes) != len (line) :
> raise ValueError ("mismatch len")
> mismatc
On Jun 18, 2:48 pm, "filox" <[EMAIL PROTECTED]> wrote:
> is there a long answer? what i want is to find out the number of bytes the
> object takes up in memory (during runtime). since python has a lot of
> introspection mechanisms i thought that should be no problem...
There isn't an automatic way
On Jun 18, 11:07 am, "filox" <[EMAIL PROTECTED]> wrote:
> is there a way to find out the size of an object in Python? e.g., how could
> i get the size of a list or a tuple?
"Size" can mean a lot of things,
len(my_list)
len(my_tuple)
Although I have the feeling you mean "how many bytes does this
Brett Hoerner wrote:
> Also, in order to call a function without arguments you still need to
> use (), so you probably wanted to use pid.original() in your pid.add
> call.
Sorry, never mind this bit, I misread the line. But you do probably
want to change the class test into a func
nted to use pid.original() in your pid.add
call.
Brett Hoerner
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
> Are there any string formatting codes that will place a space between the
> sign and the number?
Not that I know of, why not use the absolute value (after checking if
it is negative),
In [1]: abs(-1)
Out[1]: 1
--
http://mail.python.org/mailman/listinfo/python-list
an't use anything but
CPython software...?
Brett Hoerner
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> A couple of times recently I've come across this problem: I have a
> large list to sort and I need to the the "key=function" argument to
> sort appropriately. But I actually have the key mapping in a big
> dictionary.
Is this what you mean? I suppose the lambda is an
spawn wrote:
> Actually, they do end. If I
> move my "guess" variable outside the outermost loop, then it becomes
> infinte. I know, I tried it.
Huh? When does "running" ever evaluate to false (therefore breaking
either of the loops)?
--
http://mail.python.org/mailman/listinfo/python-list
tal = guess + subtotal
You keep adding the original input (subtotal) to the most recent guess,
and printing "running_total". You never re-assign subtotal or make use
of running_total in your deepest loop.
Also, you never break out of your deepest loop, why are you using two
nested inf
t;> f = a.read()
>>> f
'bin\nboot\ndev\netc\nhome\nlib\nlost+found\nmedia\nmisc\nmnt\nnet\nopt\nproc\nroot\nsbin\nselinux\nsrv\nsys\ntmp\nusr\nvar\n'
>>>
See the difference? :)
Brett Hoerner
--
http://mail.python.org/mailman/listinfo/python-list
Chris wrote:
> Is there a way to stop this behavior? I want to process this dictionary
> in the order it's in, element by element. I'm running Python 2.3, if
> that helps.
As said previously, you either want a list (which are ordered), or an
ordered-dictionary (not a Python native type, see
http:/
[EMAIL PROTECTED] wrote:
> hey fredrik,
>
> i don't understand what you are saying
Do what he showed in the Python interactive shell,
> Fredrik Lundh wrote:
> > 'food' or 'drink' doesn't do what you think it does:
> >
> > >>> 'food' or 'drink'
> > 'food'
> >
> > >>> {'class': 'food' o
Efrain Marrero wrote:
> i want to now how to do this in python
> this is java
>
>
> for(int i=1 ; i<=lim ; i++){
>
> for(int j=i+1; j<=lim+1; j++){
>
> for(int k =j+1; k<=lim+2;k++){
>
> for(int l=k+1 ; l<=lim+3;l++){
>
>
I have to add another vote for Gentoo. I agree that you just "have
less problems" on Gentoo. Updates are from source, but you don't have
to update mid-day while working on a project... if you really want the
new version of KDE (etc) then start an update and go to sleep, not a
big deal. Portage (
Manuel11g wrote:
> Hello,
> I am a new programmer in Python and a need some help. Where can i get a
> basic tutorial about Class. I don't know nothing about Object Oriented
> Programming. Can you help me?
http://diveintopython.org/object_oriented_framework/index.html
--
http://mail.python.org/ma
> I have written some functions in a file called btools.py. I would like
> to import them automatically when I start up Python shell. Today I must
> do it by hand like this
>
> >>> from btools import *
> >>> dir()
> ['__builtins__', '__doc__', '__name__', 'func1', 'func2', 'func3']
> >>>
>
> Is the
Would PythonEggs be close?
It's basically a zip format with all the Python files inside, it would
maintain the structure and not be a single script file, but would be a
single .egg file... the end user would just run the script and all
would be installed, essentially.
http://peak.telecommunity.co
> I've been asked by my boss to put an Icon in WinXP's "My Computer" for
> a utility we use around the shop. My tool of choice is of course
> Python and therefore what I am using to attempt my given task. I have
> no trouble putting Icons in the WinXP Toolbar using Python, but have
> totally fail
hrh1818 wrote:
> For more information on Iron Python see http://www.ironpython.com/
> My take on Iron Python is the new job the develolper of Iron Python
> started last year takes up just about all of his time and the developer
> is currently spending very little time actively developing Iron Pyth
I don't think this is possible, unless I am grossly misunderstanding.
For the web, pretty much every "UI" is build with some variation of
HTML (XHTML is the new standard) with JavaScript thrown in for fancy
GUI-like interfaces.
You can't use OS-native widgets in the web browser, no.
--
http://m
Trent Mick wrote:
> Yes. The MS Platform SDK is free and includes a compiler that can target
> x86, ia64 and x64 (the latter is what MS -- and Sun -- are calling
> AMD64).
Thanks, looking at their site I can't find a Platform SDK for XP... am
I looking for the Windows 2003 Server SDK...? Seems co
As an aside to this, are there any freely available C compilers for
Windows that can compile 64-bit binaries? I find nothing for Cygwin or
MinGW...
--
http://mail.python.org/mailman/listinfo/python-list
> Alternatively, does anyone have experience
> of using the visual studio files in the PCBuild
> directory under amd64?
I don't have an answer for you, but just to clarity for future
readers... based on the quote above, I assume you mean a native 64-bit
build for Windows, right? You never stated
That's because the Python docs come zipped up within a folder, for
example:
python_docs.tar.bz2 has a folder inside it called Python-Docs-2.4.2.
You need to have C:\Python24\Python-Docs-2.4.2\ as the value if thats
where that folder is, or wherever you unzipped it. I, personally, just
took all t
You can use Python regardless of the docs... of course. Not sure what
you mean there.
As far as setting an Environment Variable, though:
(1) Right-Click My Computer, go to Properties
(2) Go to the Advanced tab
(3) Click Environment Variables (bottom middle-ish)
(4) Under "User Variables" clic
(sorted is a built-in function in 2.4)
def myFunction( data ):
""" Take one of your set of 3, grab [2] (the 3rd) and do calcs,
return value """
"do some math calculations to data[2]"
return "result of calculations"
sorted_list = sorted(myList, key=myFunction)
List is sorted in the or
I'm not sure what you mean, really, do you need an official Python
"Null" value? Try None?
In [6]: myCells = ['Mary', 'Bob', None, 'Joe']
In [7]: for cell in myCells:
...: if cell:
...: print cell
...: else:
...: print "NULL VALUE"
...:
Mary
Bob
NULL VALUE
J
I guess it is referring to the closely related (maybe even same dev
group? I don't know why the wxWindows docs would mention Python unless
they specifically support the wxPython project, too.)
"wxWindows + Python = wxPython
wxPython is a Python extension module that provides a set of bindings
fro
I don't have experience with scipting this... but I know that
resolution for example is stored in registry, and _that_ is what is
loaded when you boot.
I think most, if not all, of your changes will be found in the registry
(for permenance).
Also, have you checked out PyWin32? It's just a big pr
You get to spend all day in ipython?
Can I have your job?
--
http://mail.python.org/mailman/listinfo/python-list
RHEL isn't really "big" on Distrowatch because Distrowatch is geared
more towards users.
RHEL 4.1 is using Python 2.3.4 now, btw.
--
http://mail.python.org/mailman/listinfo/python-list
David Wilson wrote:
> http://www.ironpython.com/
It should be noted that they (?) don't seem to update that site
anymore, you can find 0.9.1 here:
http://workspaces.gotdotnet.com/ironpython
There is also Boo, which is Python-like (with some differences) but is
a .NET Language itself. I never und
Wouldn't the standard idiom be to actually put the code under the
if-name, and not make a whole new main() function?
I'm not sure I see the reason behind main(), couldn't that also
interfere with other modules since main() seems like it might be
common, not sure how it would work as I'm pretty new
Philippe C. Martin wrote:
> You might want to check out ipyhton.
I use it. :) I love it. When I meant console I meant the shell app
that runs any text-based programs. The windows console was giving me
loud beeps, etc, which I've now fixed.
Thanks for your reply though,
Brett
--
http://mail
Benji York wrote:
> To make the console full screen hit Alt-Enter. The same thing makes it
> windowed again. To accommodate very long lines click the "C:\" icon in
> the upper left corner of the window, choose "Properties" and then change
> the "Screen Buffer Size" Width and Height to something m
Rune Strand wrote:
> I know that problem... it's extremely annoying!
> Here's one way to solve it;
>
> 1. Start 'Device manager'.
> 2. On the menu, click 'View' and check off "Show hidden devices"
> 3. Locate 'Beep' 'under Non-Plug and Play Drivers'
> 4. Right-click 'Beep', select 'Disable'
Christ
This is a pretty basic, mostly un-python-related question, although I'm
asking because of Python.
Is there a different shell I can use (other than cmd.com) to run Python
in, where I can full-screen the window (if I pleased), etc? As it is,
things that would run far off the right have to be word w
38 matches
Mail list logo