Re: Pyserial never read

2006-02-22 Thread sam
Thanks for the info Grant. It'll teach me not to read the documentation :>) Sam -- http://mail.python.org/mailman/listinfo/python-list

The old round off problem?

2006-03-04 Thread sam
. 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

Re: The old round off problem?

2006-03-04 Thread sam
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

Re: The old round off problem?

2006-03-04 Thread sam
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

Dual Python Installed Environments..

2007-10-25 Thread sam
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

RE: Dual Python Installed Environments..

2007-10-25 Thread sam
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

Re: Accessing class variables in staticmethods.

2007-01-21 Thread Sam
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 >

Re: Socket and array

2007-02-07 Thread Sam
(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

Re: c++ for python programmers

2007-02-13 Thread Sam
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

Re: Pep 3105: the end of print?

2007-02-16 Thread Sam
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

Allowing Arbitrary Indentation in Python

2007-12-18 Thread Sam
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

Re: Allowing Arbitrary Indentation in Python

2007-12-18 Thread Sam
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

Re: Allowing Arbitrary Indentation in Python

2007-12-18 Thread Sam
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') >

Re: Allowing Arbitrary Indentation in Python

2007-12-19 Thread Sam
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

Re: Using ctypes with lib not found via ldconfig

2007-12-20 Thread Sam
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 use of PyW32_BEGIN_ALLOW_THREADS and PyW32_END_ALLOW_THREADS

2006-05-19 Thread sam
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

Re: IronPython 1.0 Beta 7 Released

2006-05-24 Thread sam
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

Re: for loop without variable

2008-01-09 Thread Sam
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

online marketing make money

2008-02-09 Thread sam
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

Re: Keeping the console window

2008-03-02 Thread Sam
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

Re: Checking if a variable is a dictionary

2008-03-06 Thread Sam
Hello if type(a) is dict: print "a is a dictionnary!" ++ Sam -- http://mail.python.org/mailman/listinfo/python-list

Re: access to base class __init__

2008-03-06 Thread Sam
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

Re: parsing directory for certain filetypes

2008-03-10 Thread sam
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

Re: parsing directory for certain filetypes

2008-03-10 Thread sam
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:/

defining a method that could be used as instance or static method

2008-03-10 Thread Sam
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

Re: defining a method that could be used as instance or static method

2008-03-10 Thread Sam
> 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

Re: execute python script question

2008-03-10 Thread Sam
(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

Re: access to base class __init__

2008-03-12 Thread Sam
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

Prototype OO

2008-03-19 Thread sam
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

Re: Prototype OO

2008-03-20 Thread sam
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

Re: Prototype OO

2008-03-21 Thread sam
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

No Module Named MySQLdb Error

2009-01-15 Thread Sam
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 and buffering modes...

2009-02-10 Thread Sam
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

Re: codecs.open and buffering modes...

2009-02-14 Thread Sam
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

Centralized logging server...

2008-12-05 Thread Sam
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

Re: Centralized logging server...

2008-12-05 Thread Sam
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

Parsing a sitemap library?

2008-12-27 Thread Sam
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

Re: Prototype OO

2008-03-31 Thread sam
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

Re: Prototype OO

2008-03-31 Thread sam
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

Re: Prototype OO

2008-03-31 Thread sam
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

Re: Prototype OO

2008-04-02 Thread sam
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

Re: Prototype OO

2008-04-02 Thread sam
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. >>>

Re: Prototype OO

2008-04-02 Thread sam
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

Re: wsdl (soap) without code generation

2008-04-02 Thread sam
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

Re: Prototype OO

2008-04-03 Thread sam
[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

Re: Prototype OO

2008-04-03 Thread sam
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

Re: Prototype OO

2008-04-03 Thread sam
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

Re: Request a short code review

2008-04-18 Thread Sam
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

Re: relative import broken?

2008-04-30 Thread Sam
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,

Re: relative import broken?

2008-04-30 Thread Sam
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

Re: relative import broken?

2008-04-30 Thread Sam
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

Re: relative import broken?

2008-04-30 Thread Sam
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

Re: relative import broken?

2008-04-30 Thread Sam
> > 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

Deflate with urllib2...

2008-09-09 Thread Sam
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

Re: Deflate with urllib2...

2008-09-16 Thread Sam
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,

Program works great, except under less, cron or execl (Unicode?)

2008-09-18 Thread Sam
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

Re: Deflate with urllib2...

2008-09-18 Thread Sam
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

Re: Deflate with urllib2...

2008-09-18 Thread Sam
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

Re: Program works great, except under less, cron or execl (Unicode?)

2008-09-18 Thread Sam
<[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

Re: Deflate with urllib2...

2008-09-19 Thread Sam
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

Re: Are there any python micro-frameworks (like ruby's Camping)?

2008-10-01 Thread Sam
Did you try WebPy? http://webpy.org/ Hum, the website seems to be down today Sam -- http://mail.python.org/mailman/listinfo/python-list

Re: Are there any python micro-frameworks (like ruby's Camping)?

2008-10-01 Thread Sam
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

Re: "pow" (power) function

2006-03-15 Thread sam
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

ANN: SCSIPYTHON on Sourceforge

2006-03-22 Thread sam
: http://starship.python.net/crew/samschul Sourceforge link: https://sourceforge.net/projects/scsipython Sam Schulenburg -- http://mail.python.org/mailman/listinfo/python-list

MySQLdb Confusion

2010-01-17 Thread Sam
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

Pretty Print Python Data Structures to HTML

2009-10-17 Thread Sam
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

decoding a byte array that is unicode escaped?

2009-11-06 Thread sam
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

------->>>FREE MAC<<<-------

2010-03-21 Thread sam
http://michellemichaeldiscounts.com/16801.html -- http://mail.python.org/mailman/listinfo/python-list

Re: CGI python 3 write RAW BINARY

2010-05-21 Thread sam
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

ukhomemadescandals

2010-10-11 Thread sam
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

Question about pickle

2013-06-25 Thread Phu Sam
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):

Re: Question about pickle

2013-06-26 Thread Phu Sam
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

Re: Proposal: Syntax for attribute initialisation in __init__ methods

2022-04-20 Thread Sam Ezeh
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

Enums and nested classes

2022-04-20 Thread Sam Ezeh
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

Re: Tuple unpacking inside lambda expressions

2022-04-20 Thread Sam Ezeh
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

Re: Tuple unpacking inside lambda expressions

2022-04-20 Thread Sam Ezeh
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

Re: Why no list as dict key?

2022-04-20 Thread Sam Ezeh
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

Fwd: Do projects exist to audit PyPI-hosted packages?

2022-05-06 Thread Sam Ezeh
-- 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

Re: Seeking deeper understanding of python equality (==)

2022-05-06 Thread Sam Ezeh
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

Re: Python installation

2022-06-21 Thread Sam Ezeh
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, > > &

Building on Windows

2022-07-02 Thread Sam Ezeh
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

Re: Building on Windows

2022-07-02 Thread Sam Ezeh
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

Re: Virtual PUG-meeting: An applied introduction to Finite State Machines

2022-09-13 Thread Sam Ezeh
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 > >

Fwd: A typing question

2022-10-29 Thread Sam Ezeh
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

Re: How to 'ignore' an error in Python?

2023-04-29 Thread Phu Sam
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

Re: Functionality like local static in C

2022-04-14 Thread Sam Ezeh
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

Proposal: Syntax for attribute initialisation in __init__ methods

2022-04-15 Thread Sam Ezeh
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

Tuple unpacking inside lambda expressions

2022-04-16 Thread Sam Ezeh
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

Fwd: Proposal: Syntax for attribute initialisation in __init__ methods

2022-04-16 Thread Sam Ezeh
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: > ..

Fwd: Proposal: Syntax for attribute initialisation in __init__ methods

2022-04-16 Thread Sam Ezeh
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

Re: Tuple unpacking inside lambda expressions

2022-04-16 Thread Sam Ezeh
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

Re: Scraping multiple web pages help

2019-02-27 Thread Phu Sam
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

Re: Dictionary

2019-02-27 Thread Phu Sam
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] >>>

Error getting data from website

2019-12-06 Thread Sam Paython
;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

Re: What is "self"?

2005-09-22 Thread Sam Pointon
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

Could this C extension be leaking memory?

2005-09-24 Thread Sam L.
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)",

Re: forum

2005-10-02 Thread Sam Francke
th kind regards / met vriendelijke groeten Sam Francke -- http://mail.python.org/mailman/listinfo/python-list

Re: how do you pronounce wxpython

2005-10-08 Thread Sam Pointon
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

Re: Function decorator that caches function results

2005-10-08 Thread Sam Pointon
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)

Re: Works only in interactive mode

2005-10-10 Thread Sam Pointon
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,

<    1   2   3   4   >