Thanks for the info Grant. It'll teach me not to read the documentation
:>)
Sam
--
http://mail.python.org/mailman/listinfo/python-list
. I have tried various graphing programs,and they all
exihibit this problem.
thanks in advance Sam Schulenburg
f(x) = cosh^2(x) - sinh^2(x) = 1
>>> from math import *
>>> for x in range(20):
print "x= %2d Sinh^2(x) = %20.3f f(x) = %2.10f
"%(x,pow(cosh(x),2
David I beg I beg
Can you answer the question?
Also thanks for the information on using the Taylor series.
Sam Schulenburg
--
http://mail.python.org/mailman/listinfo/python-list
David Treadwell wrote:
> exp(x) is implemented by:
>
> 1. reducing x into the range |r| <= 0.5 * ln(2), such that x = k *
> ln(2) + r
> 2. approximating exp(r) with a fifth-order polynomial,
> 3. re-scaling by multiplying by 2^k: exp(x) = 2^k * exp(r)
>
> sinh(x) is mathematically ( exp(x) - e
Hi..
I'm looking to install dual versions of python 2.3, 2.4 on the same box. I'm
trying to figure out if there's something I'm missing, some kind of gotchas
that I haven't seen.
I'm also trying to figure out how to allow my script to determine which
version to use???
Thanks
--
http://mail.p
ober 25, 2007 2:48 PM
To: python-list@python.org
Subject: Re: Dual Python Installed Environments..
sam schrieb:
> Hi..
>
> I'm looking to install dual versions of python 2.3, 2.4 on the same box.
I'm
> trying to figure out if there's something I'm missing, so
On 21 Jan 2007 12:49:17 -0800, Ramashish Baranwal
<[EMAIL PROTECTED]> wrote:
> class Base:
> staticvar = 'Base'
>
> @staticmethod
> def printname():
> # this doesn't work
> # print staticvar
> # this does work but derived classes wouldn't behave as I want
>
(such as
JSON, perhaps, or a similar lightweight notation system if you are
only sending lists) would be a good idea.
--Sam
--
http://mail.python.org/mailman/listinfo/python-list
s integrity, and I
believe I've already discussed casting and pointers), use Python, and
if you want under-the-hood pointer-fu, use C.
--Sam
--
http://mail.python.org/mailman/listinfo/python-list
or, SyntaxError):
# python 3.0
print2 = print
SyntaxError: invalid syntax
Any and all aliasing must happen in compat26.py. My suggested solution is this:
#_compat30.py
print2 = print
#compat.py
try:
from _compat30 import print2
except SyntaxErorr, ImportError):
def print2():
--Sam
--
http://mail.python.org/mailman/listinfo/python-list
A friend of mine is picking up some Python and is frustrated by
Python's indentation rules (http://greatbiggary.livejournal.com/
260460.html?thread=1835884#t1835884). Personally, I've never had any
issues with Python's ways of indentation, but that conversation got me
thinking about the issue.
Co
On Dec 18, 5:28 pm, Grant Edwards <[EMAIL PROTECTED]> wrote:
> On 2007-12-18, Sam <[EMAIL PROTECTED]> wrote:
>
>
>
> > A friend of mine is picking up some Python and is frustrated by
> > Python's indentation rules (http://greatbiggary.livejournal.com
On Dec 18, 7:09 pm, Jonathan Gardner
<[EMAIL PROTECTED]> wrote:
> On Dec 18, 2:16 pm, Sam <[EMAIL PROTECTED]> wrote:
>
>
>
> > layouts = ['column', 'form', 'frame']
> > cmds.window(t='gwfUI Builder')
>
On Dec 19, 11:09 am, gDog <[EMAIL PROTECTED]> wrote:
> Hi, Sam-
>
> I'm not wanting to start a flame war, either, but may I ask why does
> your friend want to do that? I'm always intrigued by the folks who
> object to the indentation rules in Python, even tho
Hello,
May be I misunderstand your problem, but is it not possible do link it
as follow?
import ctypes
libgaak = ctypes.CDLL("/home/me/otherLibs/libgaak.so.6")
Kind regards.
Sam
--
http://mail.python.org/mailman/listinfo/python-list
The foowing code lifted from Mark Hammond Pywin32 code shows and
example of calling the Windows Kernel32 GetTickCount(),using
PyW32_BEGIN_ALLOW_THREADS and PYW32_END_ALLOW_THREADS. My Code does not
use this,but uses SetThreadAffinityMask(GetCurrentThread(),1). My
questions are:
1) What is the
vbgunz:
When you download IronPython,the tutorial directory has some examples
of interfacing With the .NET environment i.e.:
1: IronPython -> C#
2: C# -> IronPython
3: IronPython -> VB
4: VB -> IronPython
Sam Schulenburg
--
http://mail.python.org/mailman/listinfo/python-list
r i in range(2): # pylint: disable-msg=W0612
2 print "foo"
3 for i in range(2):
4 print "foo"
pylint will not generate a warning on line 1, but will on line 3!
Cheers.
Sam
--
http://mail.python.org/mailman/listinfo/python-list
It is new one online business you can earn minimum 1000$ per month
great oppertunity to students,house wives,retired persons andall
others .
http://onlinemarketingmakemoney.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
You may use python in interactive mode:
$ python -i yourScript.py
Or use a blocking readline:
$ cat yourScript.py
import sys
sys.stdin.readline()
++
Sam
--
http://mail.python.org/mailman/listinfo/python-list
Hello
if type(a) is dict:
print "a is a dictionnary!"
++
Sam
--
http://mail.python.org/mailman/listinfo/python-list
Dennis Lee Bieber wrote:
>
> I'm not sure why you need to subclass from threading.Thread if all
> the thread control is being done internal to this class. Subclassing
> means being able to do things like:
>
Well it was the first thing that occured to me how to have
private data for each thread
royG napisał(a):
> i wrote a function to parse a given directory and make a sorted list
> of files with .txt,.doc extensions .it works,but i want to know if it
> is too bloated..can this be rewritten in more efficient manner?
>
Probably this should be rewriten and should be very compact. Maybe
Robert Bossy napisał(a):
> I leave you the exercice to add .doc files. But I must say (whoever's
> listening) that I was a bit disappointed that glob('*.{txt,doc}') didn't
> work.
"{" and "}" are bash invention and not POSIX standard unfortunately
--
UFO Occupation
www.totalizm.org
--
http:/
ld really appreciate a pointer or a way to complete MyClass in
order to fulfill my requirements. Thank you for your attention.
Sam
--
http://mail.python.org/mailman/listinfo/python-list
> Did you try that it doesn't work? because it should. Whenever you do
>
No... -_- I kept on trying things @staticmethod.
Thanks for your hint, it works fine!
Sam
--
http://mail.python.org/mailman/listinfo/python-list
(r251:54863, Oct 5 2007, 13:50:07)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from test_import import A
>>> a=A()
>>> a.show()
1
>>>
++
Sam
--
http://mail.python.org/mailman/listinfo/python-list
Dennis Lee Bieber wrote:
> On Thu, 06 Mar 2008 22:35:18 -0500, Sam <[EMAIL PROTECTED]> declaimed
> the following in comp.lang.python:
> ['line 1', 'line 2', 'embedded', 'line', 'something']
>>>> sample=""&quo
Some time ago (2004) there were talks about prototype-based languages and
Prothon emerged.
Can someone tell me why class-based OO is better that Prototype based,
especially in scripting langage with dynamic types as Python is?
Here are some links:
http://c2.com/cgi/wiki?PrototypeBasedProgram
Bruno Desthuilliers napisał(a):
> Most of the arguments in favor of prototypes seems to come to, mainly:
> 1/ it lets you customize behaviour on a per-object base
> 2/ it removes the mental overhead of inheritance, classes etc
>
> Point 1. is a non-problem in Python, since you can already add/rep
Bruno Desthuilliers napisał(a):
>> In dynamically typed language when you create object A that is
>> inherited from another object B, than object A knows that B is his
>> predecessor. So
>> when you reference A.prop, then prop is looked in A first, then in B,
>> then in predecessors of B, and
Hi Friends,
This is Sam, a learner of Python programming
language. I would like to know a feasible and flexible process of
importing MySQLdb module. If anyone know about this and have an
expertise over this can help me over this issue.
1) I installed interface MySQLdb 1.2.2 in my
codecs.open defaults to line buffering. But open defaults to using
the system buffer size. Why the discrepancy? Is it different for a
reason?
How do these choices affect performance? (Particularly under Linux).
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
Hmmm...no one knows the reason for the discrepancy? Should I post on
the developers' list to see if anyone knows?
Thanks
On Feb 9, 6:19 pm, Sam wrote:
> codecs.open defaults to line buffering. But open defaults to using
> the system buffer size. Why the discrepancy? Is it diff
Hi...
I'm working with a small team writing a bunch of python applications
that communicate via xml/http in a somewhat restful way. :) They are
running on about half a dozen computers. We'll probably be scaling
that to a lot more computers soon.
I've been playing with the python logging module
n could keep up with all the traffic I'm going to have. Anyone
know how well it scales compared to the alternatives?
Thanks
Sam
On Dec 5, 12:24 pm, [EMAIL PROTECTED] wrote:
> Sam> I've been playing with the python logging module. I'd like all of
> Sam> these ap
Hi...
I see an awful lot of code out there to create sitemaps using Python.
But I can't find anything to consume sitemaps using Python. Is there
a library to convert sitemaps and sitemap indexes of sitemaps into
something more Pythonic?
I know I can write one pretty easily using e.g. Beautiful
Diez B. Roggisch napisał(a):
> no "inheritance model" in Javascript. Or why does each JS-lib provide
> it's own version of an extend-function [1]?
Ok -- thank you!
> The only point you might have is the somwhat unfortunate distinction
> between lambda and function in python - but this is on
Steven D'Aprano napisał(a):
>> I can see that Python and Javascript inheritance model is almost the
>> same. Both languages are dynamically typed. And it seems that using
>> "classes" in Python makes some things more complicated then it is
>> necessary (eg functions, methods and lambdas are differ
Steve Holden napisał(a):
>> 1. You have different syntax for named and unnamed (lambdas)
>> functions. Functions and methods are different things in Python even
>> if they have same syntax. But all these are still a pieces of code
>> that you use repeatedly to make some task.
>>
> A knife and s
Bruno Desthuilliers napisał(a):
> Sam, seriously, why don't start with *learning* about Python's object
> model ? Seriously ? Not that it's "perfect", not that you have to like
> it
Ok -- thank you for your time and your strong opinions about curren
Gabriel Genellina napisał(a):
1. You have different syntax for named and unnamed (lambdas)
functions. Functions and methods are different things in Python even
if they have same syntax. But all these are still a pieces of code
that you use repeatedly to make some task.
>>>
Bruno Desthuilliers napisał(a):
> Don't misunderstand me : I'm not saying that class-based is better (or
> worse) than prototype, I'm not saying that Python is perfect, I'm not
> saying that your points are not worth any consideration, I'm just saying
> that, from your arguments, I have the ver
Thomas Guettler napisał(a):
> I googled for 'wsdl python' and found ZSI.
This is current solution, but it is quite new and actively developed, so newer
versions are sometimes not compatibile with old ones. So if you use
distribution
provided packages (eg Debian) you can have troubles after sy
[EMAIL PROTECTED] napisał(a):
> So, while I often use Python's lambdas, the imposed limitations is ok
> to me since I wouldn't use it for anything more complex.
> Also - as a side note - while the syntax is a bit different, the
> resulting object is an ordinary function.
And people start askin
Gabriel Genellina napisał(a):
>> Yes. Funciton is always a piece of code (program) that does something.
>> There is
>> no need for different syntax.
>
> Guido has regretted lambda for a long time; it was scheduled for
> deletion on Python 3000 [2] but finally will stay [3].
Thanks for that inf
Bruno Desthuilliers napisał(a):
> Ok, I'm going to be a bit harsh, but this time I'll assume it.
> Sam, you started this thread by asking about prototype vs class based
> minor syntactic points that, whether you like them or not (and
I think I will get back to this discus
Hello,
I would personally avoid using "type" as variable name, or key,
because built-in class type already exists. As I understand your code,
it was not your intention to override it.
++
Sam
--
http://mail.python.org/mailman/listinfo/python-list
t;. It says "No
module named X" for essentially any package reference, so I think it's
just not recognizing the directories as packages. The docs for
relative import make this sound much easier than it is.
Thanks in advance, I'm at my wit's end.
-Sam
On Apr 30, 9:41 am,
On Apr 30, 9:11 pm, Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
> Sam <[EMAIL PROTECTED]> writes:
> > I also have a problem with relative import; I can't for the life of me
> > figure out how to use the damn thing. I think the main problem is with
> > getting
On Apr 30, 9:11 pm, Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
> Sam <[EMAIL PROTECTED]> writes:
> > I also have a problem with relative import; I can't for the life of me
> > figure out how to use the damn thing. I think the main problem is with
> > getting
y question: is the directory that contains "S" in PYTHONPATH or
> >> in sys.path?
>
> > It's in sys.path.
>
> "S" or its parent directory?
I added r'C:\Users\Myname\S' to sys.path. Is this the correct usage?
Sam
--
http://mail.python.org/mailman/listinfo/python-list
> > I added r'C:\Users\Myname\S' to sys.path. Is this the correct usage?
>
> Try r'C:\Users\Myname'.
Excellent, it works! Thanks, Torsten.
Sam
--
http://mail.python.org/mailman/listinfo/python-list
I'm using urllib2 and accepting gzip and deflate.
It turns out that almost every site returns either normal text or
gzip. But I finally found one that returns deflate.
Here's how I un-gzip:
compressedstream = StringIO.StringIO(data)
gzipper = gzip.GzipFile(fileobj=compressedstream)
data
ng deflate. Length is: ",
str(len(data))
data = zlib.decompress(data)
print "After uncompressing, length is: ", str(len(data))
else:
print "Data is not deflated."
On Sep 10, 12:50 am, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> En Tue,
I have a program which works great when run from the command line.
But when I run it combined with something else such as:
- piping it through less
- cron
- execl (i.e. calling it from another python program)
it gives me a unicode error
File "../myparser.py", line 261, in set_attributes
pri
On Sep 18, 2:10 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> En Tue, 16 Sep 2008 21:58:31 -0300, Sam <[EMAIL PROTECTED]> escribió:
> The code is correct - try with another server. I tested it with a
> LightHTTPd server and worked fine.
Gabriel...
I foun
this site.
Trying: http://www.lighttpd.net
http://www.lighttpd.net - lighttpd/1.5.0 (deflate)
Errored out on this site.
Trying: http://www.kenrockwel.com
http://www.kenrockwel.com - lighttpd (deflate)
Able to decompress...went from 414 to 744.
On Sep 18, 7:29 pm, Sam <[EMAIL PROT
<[EMAIL PROTECTED]> wrote:
> Sam wrote:
> > I have a program which works great when run from the command line.
>
> > But when I run it combined with something else such as:
> > - piping it through less
> > - cron
> > - execl (i.e. calling it from an
p 19, 3:48 am, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> En Thu, 18 Sep 2008 23:29:30 -0300, Sam <[EMAIL PROTECTED]> escribió:
>
> > On Sep 18, 2:10 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
> > wrote:
> >> En Tue, 16 Sep 2008
Did you try WebPy?
http://webpy.org/ Hum, the website seems to be down today
Sam
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 1, 3:42 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> On Wed, 01 Oct 2008 01:02:24 -0700, Phillip B Oldham wrote:
> > Are there any python micro-frameworks (like ruby's Camping)?
>
> Maybe `CherryPy`!? It's the heart of other frameworks that add
> templating, ORM and the like to
I not shure which algorithm,but I am assumeing that all Python does,is
to call the underlying C pow() function.
Sam
--
http://mail.python.org/mailman/listinfo/python-list
:
http://starship.python.net/crew/samschul
Sourceforge link:
https://sourceforge.net/projects/scsipython
Sam Schulenburg
--
http://mail.python.org/mailman/listinfo/python-list
e a .egg file in /Library/Frameworks/
Python.framework/Versions/2.6/lib/python2.6/site-packages, so I
appended this to sys.path, and got a new error:
"
Traceback (most recent call last):
File "/Users/Sam/Sites/Spoonful/cgi-bin/view.py", line 19, in
<;module>;
import MySQLdb
I'm looking for something like the pprint module but that can take a
Python data structure and turn it into HTML (or better xHTML).
It would read through the data structure but instead of formatting it
using spaces it would format it using either dd/dt or ordered/
unordered lists or even as a html
I have a byte stream read over the internet:
responseByteStream = urllib.request.urlopen( httpRequest );
responseByteArray = responseByteStream.read();
The characters are encoded with unicode escape sequences, for example
a copyright symbol appears in the stream as the bytes:
5C 75 30 30 61 39
http://michellemichaeldiscounts.com/16801.html
--
http://mail.python.org/mailman/listinfo/python-list
On May 7, 7:33 am, Dodo wrote:
> Le 01/05/2010 12:52, Dodo a écrit :
>
>
>
>
>
> > Le 30/04/2010 17:52, Antoine Pitrou a écrit :
> >> Le Thu, 29 Apr 2010 23:37:32 +0200, Dodo a écrit :
> >>> I don't get a thing.
> >>> Now with the fix :
> >>> All browsers shows a different thing, but not the i
due to high pornography i have hidden the video in the website.
left side below search box click the image and watch all
video..http://ukhomemadescandals.tk/
--
http://mail.python.org/mailman/listinfo/python-list
I have a method that opens a file, lock it, pickle.load the file into a
dictionary.
I then modify the status of a record, then pickle.dump the dictionary back
to the file.
The problem is that the pickle.dump never works. The file never gets
updated.
def updateStatus(self, fp, stn, status):
f.seek(0) really does the trick.
Danke sehr,
Phu
On Tue, Jun 25, 2013 at 6:47 AM, Peter Otten <__pete...@web.de> wrote:
> Phu Sam wrote:
>
> > I have a method that opens a file, lock it, pickle.load the file into a
> > dictionary.
> > I then modify the status
I'll see if I can find out how positional only and keyword only
arguments are used in __init__ methods in the wild and I'll see if
there have been any other discussions talking about what this approach
could offer.
On Sun, 17 Apr 2022 at 02:54, dn wrote:
>
> On 17/04/2022 09.20
Outer(Enum):
a = 1
b = 2
class Inner(Enum):
foo = 10
bar = 11
```
```
class Outer(Enum):
a = 1
b = 2
class Inner:
c = None
def __init__(self):
```
Kind Regards,
Sam Ezeh
--
https://mail.python.org/mailman/listinfo/p
This also works great!
Kind Regards,
Sam Ezeh
On Tue, 19 Apr 2022 at 12:03, Antoon Pardon wrote:
>
> Op 16/04/2022 om 23:36 schreef Sam Ezeh:
> > Two questions here.
> >
> > Firstly, does anybody know of existing discussions (e.g. on here or on
> > python-ideas
I went back to the code recently and I remembered what the problem was.
I was using multiprocessing.Pool.pmap which takes a callable (the
lambda here) so I wasn't able to use comprehensions or starmap
Is there anything for situations like these?
Kind Regards,
Sam Ezeh
On Sat, 16 Apr 2022
Repeating the above points, here is an example of what would happen if
you tried. Dictionaries require their keys to be immutable as
under-the-hood they use hash tables and they'd fail when the
underlying values are allowed to change.
```
[sam@samtop]: ~>$ python
Python 3.10.2 (main, Jan
-- Forwarded message -
From: Sam Ezeh
Date: Fri, 6 May 2022, 15:29
Subject: Re: Do projects exist to audit PyPI-hosted packages?
To: Skip Montanaro
I've had similar thoughts in the past. I don't know of anything but I
wonder if repositiories for other languages
Kind regards,
Sam Ezeh
On Fri, 6 May 2022 at 18:12, Jonathan Kaczynski
wrote:
>
> Hi,
>
> I was recently trying to explain how python equality works and ran into a
> gap in my knowledge. I haven't found any good pages going beneath a surface
> level explanation of pyt
Inside my Windows virtual machine only entering `py` as the command
brings up the repl, if that helps.
Kind Regards,
Sam Ezeh
On Tue, 21 Jun 2022 at 18:15, Igor Korot wrote:
>
> Hi,
>
> On Tue, Jun 21, 2022 at 11:43 AM Brian Karinga wrote:
> >
> > Hello,
> >
&
x27;m not well-acquainted with Windows
and don't understand the solutions.
Thanks in advance.
Kind regards,
Sam Ezeh
[1]: https://devguide.python.org/compiler/
[2]: https://bugs.python.org/issue41213
[3]: https://bugs.python.org/issue33675
--
https://mail.python.org/mailman/listinfo/python-list
host desktop but
in this scenario, the error was that single line and I can use paste
sites where necessary.
Kind regards,
Sam Ezeh
On Sat, 2 Jul 2022 at 15:27, Sam Ezeh wrote:
>
> I have a Windows virtual machine and I'm following the instructions on
> the devguide [1] to bui
That seems interesting.
Is this hosted online? And are there any suggested reading materials for
those who might not be able to attend?
Kind regards,
Sam Ezeh
On Tue, 13 Sept 2022 at 22:53, dn wrote:
> An applied introduction to Finite State Machines
> 0730 UTC, Wed 21 Sep 2022
>
>
Do you want the following?
```
from typing import List, Optional
class GLOBALS:
foos: Optional[Foos] = None
class Foo:
def __init__(self):
pass
class Foos:
Foos: List[Foo] = []
def __init__(self):
pass
GLOBALS.foos = Foos()
```
Kind regards,
Sam Ezeh
On
Unsubscribe
On Sat, Apr 29, 2023 at 7:05 PM Chris Angelico wrote:
> On Sun, 30 Apr 2023 at 11:58, Chris Green wrote:
> >
> > Chris Angelico wrote:
> > > On Sat, 29 Apr 2023 at 14:27, Kushal Kumaran
> wrote:
> > > >
> > > > On Fri, Apr 28 2023 at 04:55:41 PM, Chris Green wrote:
> > > > > I'm
rint(function.variable)
... function.variable += 1
...
>>> function.variable = 1
>>> function()
1
>>> function()
2
>>>
```
If necessary, the variable can be initialised inside the function too.
Kind Regards,
Sam Ezeh
On Thu, 14 Apr 2022 at 16:36, Sam Ezeh wrote:
>
> I
s assigned at least 3 of their arguments as attributes with the
same name.
```
[sam@samtop]: ~/Documents/git/presearch>$ presearch -f
queries/attribute_initialisation.py sources/
Running queries...
Out of 1526 classes defining __init__, there were 290 (19.0%) classes whose
__init__ functions ass
ocess(*job),
jobs
)
```
Secondly, for situations like these, do you have any go-to methods of
rewriting these while maintaining clarity?
Kind Regards,
Sam Ezeh
--
https://mail.python.org/mailman/listinfo/python-list
ncern I have is that even if this is useful, it might
still fall to the same fate.
[1]:
https://mail.python.org/archives/list/python-id...@python.org/message/SCTXSEKOWDRDGVXXOEB7JUC6WE7XKGMO/
On Fri, 15 Apr 2022 at 22:30, dn wrote:
>
> On 15/04/2022 23.19, Sam Ezeh wrote:
> ..
I've just seen Pablo's very recent post on python-ideas so I thought
I'd link it here. [1]
[1]:
https://mail.python.org/archives/list/python-id...@python.org/message/SCXHEWCHBJN3A7DPGGPPFLSTMBLLAOTX/
Kind Regards,
Sam Ezeh
On Fri, 15 Apr 2022 at 22:57, Ethan Furman wrote:
&g
Angelico wrote:
>
> On Sun, 17 Apr 2022 at 07:37, Sam Ezeh wrote:
> >
> > Two questions here.
> >
> > Firstly, does anybody know of existing discussions (e.g. on here or on
> > python-ideas) relating to unpacking inside lambda expressions?
> >
> > I
You need to obtain a key for API first - from
https://regulationsgov.github.io/developers/
The Regulations.gov API is taking action to conserve system resources.
Beginning immediately, we will limit
access to one account per organization, and require approval for enabling
accounts.* Please contact
The condition 'if not fibs.get(n):' will not work because
n = 0
fibs.get(0) is 0 so not 0 is 1
Here is the modified code that works:
fibs={0:0,1:1}
def rfib(n):
if n == 0 or n == 1:
return fibs[n]
else:
fibs[n]=rfib(n-2)+rfib(n-1)
return fibs[n]
>>>
;id":"priceblock_dealprice"})
print(element.text.strip())
and this is the error I am getting:
C:\Users\Sam\PycharmProjects\untitled2\venv\Scripts\python.exe
C:/Users/Sam/PycharmProjects/untitled2/src/app.py
Traceback (most recent call last):
File "C:/Users/Sam/PycharmProjects/untitled
self is the class instance that the bound function being called belongs
to. This example should illustrate a bit.
class Foo(object):
def __init__(self, value):
self.value = value # so the Foo instance now has an attribute,
value
def get_value(self):
return self.value # Th
I am trying this out, parts of it are direct from the Python 2.4
manual.
//--- icallbk.c
#include "Python.h"
PyObject *fcallback = NULL;
static PyObject*
call_func(PyObject* self, PyObject* args)
{
PyObject *result;
PyObject *arglist;
int arg = 123;
arglist = Py_BuildValue("(i)",
th kind regards / met vriendelijke groeten
Sam Francke
--
http://mail.python.org/mailman/listinfo/python-list
I'd always assumed it was doubleyew-ecks python, but it could be wicks
python, or similar.
--
http://mail.python.org/mailman/listinfo/python-list
What about not storing args at all? Something like this:
def cache_function(func, args_list):
cache = {}
def cached_result(*args, **kwargs):
kwargs.update(dict(zip(args_list, args)))
if kwargs in cache:
return cache[kwargs]
result = func(**kwargs)
That looks like a different module named pcop getting in the way. If
there's another pcop.py in the directory where you're running it as a
script, then that gets priority and you'll end up with an error like
the one you got. However, if you run it interactively, then that
directory is not checked,
101 - 200 of 316 matches
Mail list logo