On Thu, Jul 4, 2024 at 5:22 AM inhahe wrote:
>
>
> On Thu, Jul 4, 2024 at 5:14 AM Daniel via Python-list <
> python-list@python.org> wrote:
>
>>
>> In your wisdom, would python be a good environment to accomplish this?
>
>
> I think Python would be
On Thu, Jul 4, 2024 at 5:14 AM Daniel via Python-list <
python-list@python.org> wrote:
> Hi guys -
>
> I have historical experience developing sofwtare for my own use. It has
> been
> quite a while since doing so and the advent of new languages has brought me
> here. Python has built quite a reput
On Mon, Apr 1, 2024 at 1:26 PM HenHanna via Python-list <
python-list@python.org> wrote:
> Johanne Fairchild wrote:
>
> > HenHanna writes:
>
> >> https://xkcd.com/1306/
> >> what does SIGIL mean?
>
> > A glyph used in magic. Or, for Perl, the symbol in front of a var
On Mon, Feb 27, 2023 at 3:56 AM inhahe wrote:
>
>
> On Mon, Feb 27, 2023 at 3:52 AM Roel Schroeven
> wrote:
>
>> Op 26/02/2023 om 6:53 schreef Hen Hanna:
>> > > There are some similarities between Python and Lisp-family
>> > >
On Mon, Feb 27, 2023 at 3:52 AM Roel Schroeven
wrote:
> Op 26/02/2023 om 6:53 schreef Hen Hanna:
> > > There are some similarities between Python and Lisp-family
> > > languages, but really Python is its own thing.
> >
> >
> > Scope (and extent ?) of variables is one reminder that Python i
sorry, I may have misused the term "namespace." I'm not sure what the
proper word is for the names currently loaded into the global scope.
On Fri, Jun 17, 2022 at 8:26 AM inhahe wrote:
> sys is a built-in module, but it's not in the namespace unless you import
> it
sys is a built-in module, but it's not in the namespace unless you import
it first.
before your print statement, enter "import sys"
On Fri, Jun 17, 2022 at 8:23 AM wrote:
> Thank you for your email.
>
> C:\Users\zszen>python.exe
> Python 3.10.5 (tags/v3.10.5:f377153, Jun 6 2022, 16:14:13) [MSC
Maybe your file explorer is set to ignore system and/or hidden files, and
Python isn't? You can check that in folder settings..
On Wed, Dec 1, 2021 at 10:31 AM Ragavendar wrote:
>When the python runs in file explorer when I open a folder it shows NO
>ITEAMS FOUND and if I open same folde
On Sun, May 30, 2021 at 1:43 PM wrote:
> I tried winpdb-reborn some time last year on my Win10 system (python 3.8.3
> at that time), but could not figure out how to use it to debug a python
> script that uses the curses module.
>
> Does anyone here know if winpdb-reborn or any other debugger can
I don't think attaching images works on this kind of list. Maybe send a
link to it..
On Mon, May 3, 2021 at 1:51 PM Osmany Guerra
wrote:
> Hi, I have problem with the python interpreter in the Visual Studio Code.
> It was running ok, but now isn't working. I have downloaded, installed and
> unis
I'm not sure if it's okay to ask about Twisted in this mailing list, but
Twisted's mailing list seems to have ignored my submission for some reason.
And their mailing list seems mostly dead anyway. So here goes:
I'm making an IRC client using Twisted, and I want to connect to a
different server w
My editor of choice is Komodo IDE, which used to be commercialware but is
free now. I'm pretty sure it has dark modes, but I haven't used them. I
just thought I'd mention it because it's a good, solid IDE but I never see
anybody mention it, e.g. in lists of Python editors and such..
On Fri, Feb 26
Besides what others have said (especially re using a dict instead), I think
it's unpythonic/can result in unexpected behavior to change a list as it's
being iterated over. Your modified word_list should be a separate list, I
think.
Also, if you use enumerate(), you won't have to use .index and it w
if 100 > grade >= 90:
On Mon, Nov 9, 2020 at 6:01 PM Quentin Bock wrote:
> grade = input("Enter your grade: ")
> if grade >= 90:
> print("You got an A ")
> if grade >= 80:
> print("You got a B ")
> if grade >= 70:
> print("You got a C")
> if grade >= 60:
> print("You got a D ")
On Sun, Nov 8, 2020 at 1:51 PM Quentin Bock wrote:
> Errors say that add takes 1 positional argument but 3 were given? Does this
> limit how many numbers I can have or do I need other variables?
> Here is what I have:
> def add(numbers):
>total = 1
>for x in numbers:
> total +=
>
>
> On Sat, Nov 7, 2020 at 8:51 AM Bischoop wrote:
>
>>
>>
>> So I was training with slicing.
>> Came to idea to remove text after second occurence of character, below
>> is how I've figured it out, I know if it works it good but how you
>> guys would made it in more pythonic way?
>>
>> text
I know of a URL that explains asyncio:
https://hackernoon.com/a-simple-introduction-to-pythons-asyncio-595d9c9ecf8c.
As to your specific problem, I can't help and don't know if the URL helps.
I haven't studied asyncio much.
On Tue, Jun 23, 2020 at 3:53 PM Jonathan Gossage wrote:
> --
> I am atte
On Sun, Apr 5, 2020 at 8:26 AM Sathvik Babu Veligatla <
sathvikveliga...@gmail.com> wrote:
> hi,
> I am new to python, and i am trying to output the prime numbers beginning
> from 3 and i cannot get the required output.
> It stops after giving the output "7" and that's it.
>
> CODE:
> a = 3
> l =
> I have written a simple parser/evaluator that is sufficient for my
> simple requirements, and I thought I was safe.
>
> Then I saw this comment in a recent post by Robin Becker of ReportLab -
>
> "avoiding simple things like ' '*(10**200) seems quite difficult"
>
> I realised that my method
gt; > Can someone help me with this
> > I can't find a solution to link the word high to 1.21.
> >
> > 11 print(add_vat(101, 'high'))
> > 12 print(add_vat(101, 'low'))
> >
> > Outcome:
> >
> > 122.21
> > 110.09
>
On Tue, Sep 10, 2019 at 8:41 AM Pankaj Jangid
wrote:
> tim.g...@quicknet.nl writes:
>
> > For school i need to write the right code to get the following outcome.
> > Can someone help me with this
> > I can't find a solution to link the word high to 1.21.
> >
> > 11 print(add_vat(101, 'high'))
On Tue, Sep 10, 2019 at 8:31 AM inhahe wrote:
>
>
> On Tue, Sep 10, 2019 at 8:10 AM tim.gast--- via Python-list <
> python-list@python.org> wrote:
>
>> Op dinsdag 10 september 2019 13:03:46 UTC+2 schreef tim...@quicknet.nl:
>> > Hi everybody,
>> >
&
On Tue, Sep 10, 2019 at 8:10 AM tim.gast--- via Python-list <
python-list@python.org> wrote:
> Op dinsdag 10 september 2019 13:03:46 UTC+2 schreef tim...@quicknet.nl:
> > Hi everybody,
> >
> > For school i need to write the right code to get the following outcome.
> > Can someone help me with this
:
>
> On 6/28/19 1:33 PM, Chris Angelico wrote:> On Sat, Jun 29, 2019 at 6:31 AM
> Tobiah wrote:
>
> >> Also, what do people do when searching for a record.
> >> Is there some way to get 'Ronngren' to match the other
> >> possible foreign spellings?
> >
>
> I think I've heard of algorithms that
Re cgitb, not sure if this is what you want, but I just came across this
this week: https://github.com/cknd/stackprinter
On Wed, May 22, 2019 at 3:52 AM Robin Becker wrote:
> In PEP 594 t has been proposed that cgi & cgitb should be removed. I
> suspect I am not the only person in the world tha
Short answer: (some generator expression) is for iterating over, as others
have said. try this:
print([fruit for fruit in favorite_fruits])
a loop would work too, as someone mentioned, but the result would be
different. you'd get your fruits separated by line breaks (or something
else if you speci
On Thu, May 2, 2019 at 5:26 AM wrote:
> Hey guys, can someone quickly explain why this piece of code doesn't work?
> (I'm really new to Python)
>
> birth_year = input("What year are you born? ")
> current_year = 2019
> age = current_year - birth_year
> print(age)
> --
> https://mail.python.org/ma
I can display UTF-8 when I use wxPython:
--
import wx
app = wx.App()
s = 'testing\xf0\x9f\x98\x80'
frame = wx.Frame(None, wx.ID_ANY)
font = wx.Font("Arial")
textbox = wx.TextCtrl(frame, id=wx.ID_ANY)
textbox.SetFont(font)
textbox.WriteText(s)
frame.Show()
app.MainLoop()
--
But when I try th
I need to make a list of instances of a Structure, then I need to make an
instance of another Structure, one of the fields of which needs to be an
arbitrary-length array of pointers to the instances in the list. How do I
do that?
Just in case it helps, I'll include what I tried that didn't work:
-
I hope this is an appropriate mailing list for BeautifulSoup questions,
it's been a long time since I've used python-list and I don't remember if
third-party modules are on topic. I did try posting to the BeautifulSoup
mailing list on Google groups, but I've waited a day or two and my message
hasn'
i'm new to ctypes. can someone help me use sdl_pango with python?
here's the documentation: http://sdlpango.sourceforge.net/
here's my code:
-
import pygame
from ctypes import *
import win32api
MATRIX_TRANSPARENT_BACK_WHITE_LETTER = c_char_p("
On Aug 13, 4:07 pm, Peter Otten <__pete...@web.de> wrote:
> inhahe wrote:
> > say i have this definition:
>
> > 1 typedef struct SDL_Surface {
> > 2 Uint32 flags; /* Read-only */
> > 3 SDL_PixelFormat *format;
say i have this definition:
1 typedef struct SDL_Surface {
2 Uint32 flags; /* Read-only */
3 SDL_PixelFormat *format;/* Read-only */
4 int w, h; /* Read-only */
5 Uint16 pitch;
On Tue, Dec 29, 2009 at 6:38 PM, Irmen de Jong wrote:
> On 29-12-2009 23:22, inhahe wrote:
>
> inspect.getargvalues is used on frames, not on regular code objects.
> Maybe you were looking for inspect.getargspec?
>
That explains it!
I knew I'd done this before, I was just
On Tue, Dec 29, 2009 at 5:11 PM, inhahe wrote:
> On Tue, Dec 29, 2009 at 5:10 PM, inhahe wrote:
>>
>> So i'm guessing that the attribute has been changed from func_code to
>> f_code but the inspect module wasn't updated to reflect that.
>>
>
> er
On Tue, Dec 29, 2009 at 5:10 PM, inhahe wrote:
>
> So i'm guessing that the attribute has been changed from func_code to
> f_code but the inspect module wasn't updated to reflect that.
>
er i mean from f_code to func_code
--
http://mail.python.org/mailman/listinfo/python-list
Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import inspect
>>> def a(b=1): pass
...
>>> inspect.getargvalues(a)
Traceback (most recent call last):
File "", line 1, in
File "C:\P
On Thu, Dec 3, 2009 at 9:32 AM, inhahe wrote:
> On Thu, Dec 3, 2009 at 9:16 AM, Lie Ryan wrote:
>> On 12/2/2009 10:26 AM, allen.fowler wrote:
>>>
>>> I've tried this, but have found two issues:
>>>
>>> 1) I can't set default values.
>
On Thu, Dec 3, 2009 at 9:16 AM, Lie Ryan wrote:
> On 12/2/2009 10:26 AM, allen.fowler wrote:
>>
>> I've tried this, but have found two issues:
>>
>> 1) I can't set default values.
>> 2) I can't set required values.
>>
>> In both of the above cases, if the object is created without the
>> "exact" d
or i guess you could go the middle-way and just use regex.
people generally say don't use regex for html (regex can't do the
nesting), but it's what i would do in this case.
though i don't exactly understand the question, re the html file
parsing script you say you have already, or how the date is
it seems to me like it should work just fine if you just take out the
second line where it just says nestedClass
On Wed, Dec 2, 2009 at 11:55 PM, cmckenzie wrote:
> Hi.
>
> I'm new to Python, but I've managed to make some nice progress up to
> this point. After some code refactoring, I ran into a
On Mon, Nov 30, 2009 at 2:05 PM, Lie Ryan wrote:
> On 12/1/2009 5:58 AM, inhahe wrote:
>>
>> i wasn't suggesting it as a feature for python, just pointing out why
>> it might seem counterintuitive.
>
> I'm interested, what do YOU (inhahe) think the result
On Mon, Nov 30, 2009 at 2:17 PM, Lie Ryan wrote:
> On 12/1/2009 5:00 AM, inhahe wrote:
>>
>> On Mon, Nov 30, 2009 at 12:58 PM, inhahe wrote:
>>>
>>> On Mon, Nov 30, 2009 at 12:49 PM, Victor Subervi
>>> wrote:
>>>>
>>>>
>>
distinction explains the behavior, but I
>>>> find it somewhat counter-intuitive.
>>>
>>> You shouldn't find it any more surprising than the fact that
>>>
>>> a = 2 + 3
>>> print a * 5
>>>
>>> gives a different
On Wed, Nov 25, 2009 at 7:33 PM, ShoqulKutlu wrote:
> Hi,
>
> Managing load of high volume of visitors is a common issue for all
> kind of web technologies. I mean this is not the python issue. This
> issue is mostly about server level designs. You need to supply load
> balancing for both web serv
On Mon, Nov 30, 2009 at 1:21 PM, Victor Subervi wrote:
> On Mon, Nov 30, 2009 at 2:00 PM, inhahe wrote:
>>
>> On Mon, Nov 30, 2009 at 12:58 PM, inhahe wrote:
>> > On Mon, Nov 30, 2009 at 12:49 PM, Victor Subervi
>> > wrote:
>> >>
>> >&g
list comprehensions, not generator comprehensions)
i.e. notice that you can do this
''.join(x for x in ['a','b','c'])
no list or [] involved - it's just a generator comprehension being
passed to a function.
On Mon, Nov 30, 2009 at 1:12 PM, inhahe wrote:
On Mon, Nov 30, 2009 at 12:22 PM, Manuel Graune wrote:
>
> Hello,
>
> in (most) python documentation the syntax "list()"
> and "[]" is treated as being more or less the same
> thing. For example "help([])" and "help(list())" point
> to the same documentation. Since there are at least
> two cases w
On Mon, Nov 30, 2009 at 12:58 PM, inhahe wrote:
> On Mon, Nov 30, 2009 at 12:49 PM, Victor Subervi
> wrote:
>>
>>
>> If I'm not mistaken, that won't help me actually print to screen the user's
>> choices as he selects them, which in my application,
On Mon, Nov 30, 2009 at 12:49 PM, Victor Subervi
wrote:
>
>
> On Mon, Nov 30, 2009 at 1:39 PM, inhahe wrote:
>>
>> i'm pretty new to javascript programming, but i'm pretty sure you just
>> need ajax, which AFAIK is a highly technical way of saying "u
i don't understand the point of using 'with'
but i don't understand what 'with' does at all
i've tried to understand it a few times
anyway here:
import random
result = random.choice(open("c:\\test.txt").readlines())
On Mon, Nov 30, 2009 at 10:41 AM, Tim Golden wrote:
> Olof Bjarnason wrote:
>>
>
i'm pretty new to javascript programming, but i'm pretty sure you just
need ajax, which AFAIK is a highly technical way of saying "using
javascript in a way that makes web pages interactive"
JSON afaik is a way of data to and from the server that allows for
lists and more variable types and such, b
On Mon, Nov 30, 2009 at 10:54 AM, Benjamin Kaplan
wrote:
>
> I don't know if anyone considers python's incomplete implementation of
> closures a "feature" but it's documented so it's not really a bug
> either. I believe there is a trick with default arguments to get this
> to work, but I don't use
to put it simplistically it's a way of combining multiple variables into one
for example, for a person you could have
person.haircolor
person.echnicity
person.age
etc.
but you can then also manipulate 'person' as a whole like you would
any other variable, such as
x[n] = person
a struct, as far a
one point of confusion could be the use of ** instead of superscript.
it might make things a little bit more counterintuitive-looking than
with superscripts, since the issue with
would only apply to exponents, as
-5*4
and
a = -5
a*4
return the same answer, and superscripts make it a little eas
On Sun, Nov 29, 2009 at 8:04 PM, Esmail wrote:
> Chris Rebert wrote:
> Wow .. never heard of Concatenative_languages languages before or the
> distinction you make. Your distinction explains the behavior, but I
> find it somewhat counter-intuitive. (I use the Python interpreter frequently
> for sm
On Sun, Nov 29, 2009 at 10:40 AM, Mel wrote:
> Russell Warren wrote:
>
>> Maybe it's just that * is strictly for arguments, and trying it for
>> generic tuple unpacking is abuse (which is down the corridor in 12A).
>
> I'd agree with that. It's a feature of function calls, not a feature of
> sequ
On Sun, Nov 29, 2009 at 9:10 AM, n00m wrote:
>
> Even if Py by 4x *slower* -- it's still a perfect Ok for it (C# will
> be
> much (much) slower than Python).
>
>
How do you figure? As far as I know C# is many, many times faster than
Python. (i was disappointed to find out that even IronPython is
I'm trying to come up with a system for singletons, where I don't have to
modify anything for an individual class except to define __metaclass__ or,
if possible, to inherit another class.
I want it to raise an error if making a duplicate instance of a class is
attempted, rather than to return the
I had this same problem with an application called Notepad++, which is a
shame because I like the way it works and it's nice and tight. Now I use
Komodo Edit instead, which doesn't have that problem, and has all the
features of Notepad++ but just isn't as fast. Also all the colors were
awful, and
On Sun, Nov 29, 2009 at 5:15 AM, The Music Guy
wrote:
> Okay, I'm having a really hard time telling which messages are getting
> on to the list and which ones aren't. Some of the messages I send show
> up in the comp.lang.python mirror in Google Groups, and some aren't.
> Others show up on the Gro
On Sun, Nov 29, 2009 at 4:42 AM, inhahe wrote:
> maybe that thing in python 3 that someone mentioned is the answer, but
> otherwise i always think Python should admit something like this:
>
> a, b, c, *d = list
>
> i.e. if list were [1,2,3,4,5], you'd get a=1, b=2, c=3
maybe that thing in python 3 that someone mentioned is the answer, but
otherwise i always think Python should admit something like this:
a, b, c, *d = list
i.e. if list were [1,2,3,4,5], you'd get a=1, b=2, c=3, d=[4, 5]
not that that solves the None problem, though i don't have any feature
sugg
i like this idea (i posted some thoughts on it in the blog, but it's not
approved yet as of this writing)
in short, i suggested extending the idea to make it more a) generalized, b)
simple, c) intuitive, and d) flexible.
so instead of just using $ for attributes, you could use it anywhere you
def
On Mon, Oct 19, 2009 at 1:55 PM, inhahe wrote:
>
>
> On Sat, Oct 10, 2009 at 6:34 PM, Mensanator wrote:
>
>> On Oct 10, 5:02�pm, kj wrote:
>> > In <01ccc46d-5ea9-4dfe-ba22-699c6b859...@v36g2000yqv.googlegroups.com>
>> Mensanator writes:
>> >
Can somebody clear this up for me?
--
Class B(A): def __init__(self, a) A.__init__(a) self.a = a a = A() ba = B(a)
bc = B(a) bd = B(a) -- I'm not sure what A.__init__ here does. I would
think its __init__ is designed specifically to run once for any given
object.. so i'm not sure what happ
Can someone tell me why this doesn't work?
colorre = re.compile ('('
'^'
'|'
'(?:'
'\x0b(?:10|11|12|13|14|15|0\\d|\\d)'
'(?:'
',(?:10|11|12|13|1
I don't know how much the community knows about this - i haven't been
participating much of late - but here's something amazing.
Apparently javascript is just as dynamic as python, because someone made a
python-to-javascript converter in just 1200 line (pyjamas). Meanwhile
google's new javascr
"Alex Bryan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Okay, so i don't really understand the Yield thing and i know it is
> useful. I've read a few things about it but it is all programming jargon
> and so basically it is hard for me to understand. So can anyone give me a
How would I import a python file whose name contains characters like .'s or
!'s?
Is there really _no_ way to do that? I have to use plain jane letters and
numbers for everything?
--
http://mail.python.org/mailman/listinfo/python-list
"Gandalf" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On May 30, 12:14 am, John Henderson <[EMAIL PROTECTED]> wrote:
>> Gandalf wrote:
>> > how do i write this code in order for python to understand it
>> > and print me the x variable
>>
>> > x=1
>> > def ():
>> > x++
>>
i used py2exe with python 2.5 and it worked fine just the other day.
py2exe-0.6.6.win32-py2.5.exe was the download filename.
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Dear Members of the group,
> py2exe does not seem to be integrating with 2.5 or later versions.
> I was tryin
"""
"Dutton, Sam" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Thanks for all the answers and comments.
>math.pi is exactly equal to 884279719003555/281474976710656, which is the
>closest C double to the actual value of pi
So much for poor old 22/7...
Sam
"""
The biblically cor
"Paul Rubin" <http://[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> "inhahe" <[EMAIL PROTECTED]> writes:
>> planets are spherical (all implementations of Python are not natively
>> compiled (and you said for whatever definition)), a
"
I wish this worked:
>>> def main(a,b,*argv): pass
>>> options['argv'] = argv
>>> main(**options)
TypeError: main() got an unexpected keyword argument 'argv'
"
-
I was thinking about that exact same thing actually. Except that I was
thinking you might want it like this, otherwise it could be
>
>> To be more specific, let's say I want to create a simple, 2D strategy
>> game. It will have a board layout like chess or checkers and the player
>> will move around the board. Let's say this is all I know, and perhaps I
>> don't even know *this* for sure either. Is it possible to write the
>>
"inhahe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> if we assume the constraints are that:
> 1.he has list, l
> 2.he has a dictionary, d
> 3.he wants the function to print the values in the dictionary according to
> a specific order of their
"Nick Craig-Wood" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> bukzor <[EMAIL PROTECTED]> wrote:
>> That does, in fact work. Thanks! I'm a little sad that there's no
>> builtin way to do it, owell.
>>
>> >>> def f(a, *args):
>> ... print a
>> ... for b in args: print
"Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote in
message news:[EMAIL PROTECTED]
> Brad a écrit :
>> cm_gui wrote:
>>> Python is slow.
>>
>> It ain't C++, but it ain't a punch card either... somewhere in between. I
>> find it suitable for lots of stuff. I use C++ when performance really
>> ma
> PHP can do that. There are also a number of templating engines
> available. The nice thing about PHP is you have a choice.
i just meant that php is sort of invented to combine html and code, so if
you use python instead you should use a templating engine. but i suppose
it's useful for php
>> 1
>> 2
actually, you don't want it to print 3 also? if not, then you would do
f(*map(kwargs.get, inspect.getargspec(f)[0])+args[:1])
> import inspect
> f(*map(kwargs.get, inspect.getargspec(f)[0])+args)
>
--
http://mail.python.org/mailman/listinfo/python-list
"bukzor" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> This question seems easy but I can't figure it out.
> Lets say there's a function:
>
> def f(a, *args):
>print a
>for b in args: print b
>
> and elsewhere in your program you have a list and a dict like this:
> args =
> Apparently, args already is a tuple, so this should be:
>
> def __getitem__(self, args):
>
> Is this documented somewhere? I couldn't find it anywhere.
>
Don't know, I just assumed it would take multiple arguments because I knew I
had seen the form d[1,2] before, which incidentally is equival
actually i ddin't think about the fact that you're overloading dict, which
can already take multiple values in getitem
so how about
class crazy: pass
and then in your dict class:
def __getitem__(*args):
if args[-1] is crazy:
return self.get(args[:-1])*5
else:
return self.get(args)
"inhahe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> crazy = True
> print foo['a',crazy]
>
just to clarify, you could use it like:
crazy = "I'm crazy" #this only has to be done once
print foo['a']
it seems like you can't do it exactly the way you're trying but you could do
this
def __getitem__(*args):
if len(args) > 1 and args[1]: return self.get(args[0]) * 5
return self.get(args[0])
then you would use it like
print foo['a']
print foo['a',True]
or even
print foo['a',"crazy"]
if you
I don't like php. I tried it once and I had it sort a list, but the list
was apparently too long for its sorting function because it just sorted the
first so-many elements of it and left the rest in order, and didn't generate
any error. I like a language that's actually determined by what you
"Joel Koltner" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is there an easy way to get a list comprehension to produce a flat list
> of, say, [x,2*x] for each input argument?
>
> E.g., I'd like to do something like:
>
> [ [x,2*x] for x in range(4) ]
>
> ...and receive
>
> [ 0,0
Might have a stack overflow issue, if it retries too many times?
"alex23" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On May 22, 6:15 pm, Karlo Lozovina <[EMAIL PROTECTED]> wrote:
>> Because when you expect exception to occur on something like 0.01% of
>> cases, and you have 4 o
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> import Tkinter
> from Tkinter import *
>
> i have a program where if i comment out either of those import-
> statements i get an error.
>
> i thought they meant the same thing and from was supposed to be just
> to imort just a specific
I don't get what the issue is between sites that use Python and being slow,
if there is one, because there's a website online that shows the results of
a dozen or so benchmarks when comparing any two languages. Python beats PHP
in almost all the benchmarks. (it also beats almost all the other
"Dutton, Sam" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I've noticed that the value of math.pi -- just entering it at the
> interactive prompt -- is returned as 3.1415926535897931, whereas (as every
> pi-obsessive knows) the value is 3.1415926535897932... (Note the 2 at the
"Dutton, Sam" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I've noticed that the value of math.pi -- just entering it at the
> interactive prompt -- is returned as 3.1415926535897931, whereas (as every
> pi-obsessive knows) the value is 3.1415926535897932... (Note the 2 at the
"inhahe" <[EMAIL PROTECTED]> wrote in message news:...
>
> "inhahe" <[EMAIL PROTECTED]> wrote in message news:...
>> >Ma: Symbolic identity is a mathematical relation
>>>Mb: Symbols are acausal
>>>m: Matter is causal
>>>C:
"inhahe" <[EMAIL PROTECTED]> wrote in message news:...
> >Ma: Symbolic identity is a mathematical relation
>>Mb: Symbols are acausal
>>m: Matter is causal
>>C: Symbolic identity is not defined on matter.
>
I do think though that a computer languages c
>Ma: Symbolic identity is a mathematical relation
>Mb: Symbols are acausal
>m: Matter is causal
>C: Symbolic identity is not defined on matter.
What is defined on matter then? You're saying all symbolism is not defined
on matter. Much of our thinking about the world itself is symbolic. How do
"inhahe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> 4. can someone tell me if the way i'm using the decorator is sane? i've
> never used decorators before. it just seems ridiculous to a) define a
> lambda that just throws away the
something randomly made me realize why my second solution didn't work, so i
fixed it. now you have a working persistent deque.
1. if you call somepdequeobject.load(filename) (as opposed to
pdeque.load(filename)), do you want it to return a new object that it loaded
from file, or do you want it
>>
>> One thing I hate from C is the assignment in expressions...Forcing
>> myself to write
>> 0 == Something
>> rather than
>> Something == 0
>
> interesting trick, i've never thought of that/seen it
> although if Python implemented it I think it should default to giving
> warnings when you use =
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On May 21, 4:57 pm, "inhahe" <[EMAIL PROTECTED]> wrote:
>> one of the few things i miss from C is being able to use assignment in
>> expressions. that's the only thing, really.
>>
1 - 100 of 143 matches
Mail list logo