Re: Functionality like local static in C

2022-04-15 Thread Python
the function is called the variable does not have the default value, but the value it had when the function returned. Does python has something like that? Sort of, one way is to have a argument with a default value which is mutable. Hint: don't do that. -- https://mail.python.org/ma

Re: Where to store finalized python programs

2016-09-09 Thread Python
Le 09/09/2016 à 15:32, ast a écrit : hi Is there a web site to store python programs in order to make them accessible for every boby ? I know pypy, but I understood that it is for modules only. Not only, it is for programs too, for instance: pip install weboob -- https://mail.python.org

Re: How to make Python run as fast (or faster) than Julia

2018-03-07 Thread Python
On Mon, Mar 05, 2018 at 04:09:48PM -0800, Dan Stromberg wrote: > On Mon, Mar 5, 2018 at 3:53 PM, Python wrote: > > On Sat, Mar 03, 2018 at 08:18:03AM +1100, Chris Angelico wrote: > >> > Python is often a preferred solution because it is often fantastic for > >&

Re: How to make Python run as fast (or faster) than Julia

2018-03-07 Thread Python
On Thu, Mar 08, 2018 at 08:44:16AM +1100, Chris Angelico wrote: > On Thu, Mar 8, 2018 at 8:36 AM, Python wrote: > > On Mon, Mar 05, 2018 at 04:09:48PM -0800, Dan Stromberg wrote: > >> On Mon, Mar 5, 2018 at 3:53 PM, Python wrote: > >> > On Sat, Mar 03, 2018 at 08

Re: Python gotcha of the day

2018-03-15 Thread Python
TQS. But the real answer, I think, is: Just Say No to this in real code... It's extraordinarily unlikely that you'll have a real-world case that requires it, and it's extremely difficult to read even in you know well the relevant rules. If you found yourself tempted to do this, there's almost certainly a clearer way to write it, either by reducing the thing to its result, or by doing string addtion, or what have you. -- https://mail.python.org/mailman/listinfo/python-list

Re: Writing a C extension - borrowed references

2018-03-20 Thread Python
On Tue, Mar 20, 2018 at 04:33:15PM +, Paul Moore wrote: > Or, to put it another way, "if you need to ask, you can't afford to". If you don't know, you need to ask so that you can learn whether or not you can afford to. :( -- https://mail.python.org/mailman/listinfo/python-list

Re: Ruby parens-free function calls [was Re: Accessing parent objects]

2018-03-26 Thread Python
itioning of the + relative to the operand(s). That's neither consistent nor intuitive. Or, it's some other thing caused by a detail I overlooked, but if so your "unobfuscated" version did nothing to clarify what that detail is, even after scrutinizing it somewhat closely. In either case, I can't imagine how Ruby arrives at the answer 3. -- https://mail.python.org/mailman/listinfo/python-list

Re: Ruby parens-free function calls [was Re: Accessing parent objects]

2018-03-26 Thread Python
s required. And FWIW, this convinces me that Ruby is not a language I ever want to use. -- https://mail.python.org/mailman/listinfo/python-list

Re: Ruby parens-free function calls [was Re: Accessing parent objects]

2018-03-26 Thread Python
ntax right but someone else to whom the intention wasn't clear "fixed" it. Humans are already good enough at making mistakes that they require no additional encouragement, such as what is provided by allowing such syntactical horrors. -- https://mail.python.org/mailman/listinfo/python-list

Re: Ruby parens-free function calls [was Re: Accessing parent objects]

2018-03-26 Thread Python
On Mon, Mar 26, 2018 at 02:19:12PM -0700, Rick Johnson wrote: > On Monday, March 26, 2018 at 3:09:38 PM UTC-5, Python wrote: > > On Mon, Mar 26, 2018 at 11:37:35AM -0700, Rick Johnson wrote: > [...] > > > Ruby followed the rules. > > > But you didn't. > &g

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-08 Thread Python
On Tue, May 08, 2018 at 12:45:29AM +, Steven D'Aprano wrote: > Currently, the real reason is that lambda expressions are limited to a > single expression as the body of the function, and binding operations in > Python are statements. ...which begs the question, why shouldn&#x

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-12 Thread Python
On Wed, May 09, 2018 at 03:09:18PM +1000, Chris Angelico wrote: > On Wed, May 9, 2018 at 1:48 PM, Python wrote: [much snippage...] > > flag = (spam == arg) > > That's not "side effects only". Yeah, I'll chalk that up to posting too late in the evening af

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-12 Thread Python
On Tue, May 08, 2018 at 11:36:06PM -0600, Ian Kelly wrote: > On Tue, May 8, 2018 at 9:48 PM, Python wrote: > > I'll give you an example that is both a case where Python's design > > choices make creating a bug easier, AND a case where allowing > > assignments t

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-12 Thread Python
Drat, missed the main point I wanted to address in my last post: On Tue, May 08, 2018 at 11:36:06PM -0600, Ian Kelly wrote: > > This example also is a case FOR allowing assignments to be > > expressions. If Python allowed them, you could rewrite this as: > > > >while

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-12 Thread Python
[And even then...] > Guido has firmly stated that this is not going to happen in Python. > The '=' operator is NOT going to become an expression. You may as well > stop posting about it, because it's not going to change. I'm well aware of this too, but I don't thin

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-12 Thread Python
on, and binding operations > >> in Python are statements. > > > > ...which begs the question, why shouldn't assignments be expressions, as > > they are in many other languages? TBH this is one of the few things > > about Python that I dislike. > > No, it rai

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-12 Thread Python
may help that the phrase with twice as many syllables represents the operator that has twice as many characters. Eventually it becomes second nature, like not calling Dad "Mom." -- https://mail.python.org/mailman/listinfo/python-list

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-14 Thread Python
On Sun, May 13, 2018 at 02:42:48PM +1000, Chris Angelico wrote: > On Sun, May 13, 2018 at 2:31 PM, Python wrote: > >> Yes, and I'd go further: I *am* too stupid to get this right. > > > > No, you are not. Do you ever say "dog" when you mean "dot"

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-14 Thread Python
On Sun, May 13, 2018 at 11:05:48AM +, Steven D'Aprano wrote: > On Sat, 12 May 2018 21:42:13 -0500, Python wrote: > > > Responding to this further would essentially just require me to > > reiterate what I already wrote--I won't do that. I'll simply maint

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-14 Thread Python
tely essential to producing non-trivial quality software. -- https://mail.python.org/mailman/listinfo/python-list

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-14 Thread Python
On Mon, May 14, 2018 at 12:02:47PM -0600, Ian Kelly wrote: > On Mon, May 14, 2018 at 9:38 AM, Python wrote: > > Absolutely correct. If you're not doing THOROUGH code reviews, and > > not thoroughly testing your code, your job is only half done. You > > should be yo

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-15 Thread Python
you've convinced yourself of already, just as I do, and that's fine. -- https://mail.python.org/mailman/listinfo/python-list

Re: Cult-like behaviour [was Re: Kindness]

2018-07-16 Thread Python
specialized applications, which require knowledge of what bytes correspond to what units of linguistic representations, like reversing strings (which FWIW I've never found a use for, other than academic ones)--works just fine. You can--and I do (or have, at least)--write non-ASCII unicode strings a

Odd truth result with in and ==

2018-11-21 Thread Python
$ python3 Python 3.5.2 (default, Nov 23 2017, 16:37:01) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> 1 in [1,2,3] == True False >>> 1 in ([1,2,3] == True) Traceback (most recent

Re: Odd truth result with in and ==

2018-11-21 Thread Python
On Wed, Nov 21, 2018 at 01:18:22PM -0600, Python wrote: > $ python3 > Python 3.5.2 (default, Nov 23 2017, 16:37:01) > [GCC 5.4.0 20160609] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> 1 in

Re: Odd truth result with in and ==

2018-11-21 Thread Python
On Thu, Nov 22, 2018 at 07:17:52AM +1100, Cameron Simpson wrote: > On 21Nov2018 19:40, MRAB wrote: > >On 2018-11-21 19:18, Python wrote: > >>>>>1 in [1,2,3] == True > >>False > >> > >It's a chained comparison. It applies to '<'

Re: Odd truth result with in and ==

2018-11-21 Thread Python
On Thu, Nov 22, 2018 at 06:33:54AM +1100, Chris Angelico wrote: > On Thu, Nov 22, 2018 at 6:23 AM Python wrote: > > How is the first not equivalent to either one of the second or third? > > My expectation is it should produce the same result as the second. It > > *seems* li

Re: Odd truth result with in and ==

2018-11-21 Thread Python
fluous code to compensate for other people's inadequacies is irksome. The pragmatist in me admits that there's no good argument here, and sometimes (as in this case) "other people" is me. :( -- https://mail.python.org/mailman/listinfo/python-list

Re: nonlocal fails ?

2019-11-15 Thread Python
should definitely makes its way into PHP! -- https://mail.python.org/mailman/listinfo/python-list

Re: ImportError: No module named Adafruit_SSD1306

2019-12-04 Thread Python
error at line 4 Import Adafruit_SSD1306 I am using python version 2.7.16, if that makes any difference I have the same module as the authors' link goes to : Monochrome 1.3" 128x64 OLED graphic display - STEMMA QT / Qwiic Have I missed something. The error indicates that Adafruit_SSD1

Re: IOError: cannot open resource

2019-12-07 Thread Python
RobH wrote: On 07/12/2019 16:04, Peter Otten wrote: RobH wrote: When I run a python project with an oled display on a rasperry pi zero, it calls for the Minecraftia.ttf font. I have the said file in home/pi/.fonts/ I get this error: pi@raspberrypi:~/Downloads $ python interdisplay.py

Re: Aw: Re: Re: Re: stuck on time

2019-12-08 Thread Python
he date . Nothing else tho', as in no rectangle drawn Well... Maybe it's time to admit, Rob, that programming is not your thing. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python3 - How do I import a class from another file

2019-12-08 Thread Python
or ./the_file.py) then you can test the name __name__ : it is a string "__main__" when it is executed and the module name when imported : if __name__ == '__main__': # not run when imported print("Hello world!") -- https://mail.python.org/mailman/listinfo/python-list

Re: Python3 - How do I import a class from another file

2019-12-09 Thread Python
"from the_module import Child", how could it not execute the code defining Parent as well? Child *depends* on Parent. -- https://mail.python.org/mailman/listinfo/python-list

Re: More efficient/elegant branching

2019-12-10 Thread Python
https://gitlab.com/snippets/1921123 -- https://mail.python.org/mailman/listinfo/python-list

Re: More efficient/elegant branching

2019-12-10 Thread Python
but never actually used any of them in a real project :-) If we had macros it may be another story, but we don't, and we won't (or will we ?) -- https://mail.python.org/mailman/listinfo/python-list

Re: Python3 - How do I import a class from another file

2019-12-10 Thread Python
e documentation it is used from the very first example of, say, open(). -- https://mail.python.org/mailman/listinfo/python-list

Re: Python3 - How do I import a class from another file

2019-12-10 Thread Python
Michael Torrie wrote: On 12/10/19 2:08 PM, R.Wieser wrote: You might know a thing or two about Python, but you (and a number of others here) positivily stink as teachers, incapable or even unwilling to place themselves in the shoes of a newbie. As it happens, I've heard Chris speak

Re: Python3 - How do I import a class from another file

2019-12-11 Thread Python
way, I was very impressed back in the day when the with statement and context manager protocol appeared in Python. I've always wondered from what language(s) it was borrowed from (as most of good ideas in Python have been borrowed, like comprehension from Haskell, and so on, which is goo

Re: Troubleshooting

2019-12-12 Thread Python
catherine morris wrote: Good evening, My son is trying to download python 3.8.0 on my PC, which has Windows 10, and it won't install properly. I'm not tech savvy and have no idea where to start. What happened exactly? Did you download the official installer from python.org, then cli

Re: Troubleshooting

2019-12-12 Thread Python
Le 13/12/2019 à 03:53, Michael Torrie a écrit : On 12/12/19 6:33 PM, Python wrote: catherine morris wrote: Good evening, My son is trying to download python 3.8.0 on my PC, which has Windows 10, and it won't install properly. I'm not tech savvy and have no idea where to start. Wha

Re: Most elegant way to do something N times

2019-12-22 Thread Python
sometimes is eval( n * 'do();' ) or: class repeatly_do: def __init__(self,n): self.n = n def __mul__(self,action): for _ in range(self.n): action() def do(): print('Here I am...') repeatly_do(5) * do -- https://mail.python.org/mailman/listinfo/python-list

Re: Calculator

2020-01-15 Thread Python
Le 15/01/2020 à 16:34, andersh...@gmail.com a écrit : Thanks! Do not try it, though, with a expression such as import os; os.system('rm -rf ~/*'). -- https://mail.python.org/mailman/listinfo/python-list

Re: Calculator

2020-01-16 Thread Python
Le 16/01/2020 à 11:56, samna...@gmail.com a écrit : On Wednesday, 15 January 2020 17:09:56 UTC, Python wrote: Le 15/01/2020 à 16:34, andersh...@gmail.com a écrit : Thanks! Do not try it, though, with a expression such as import os; os.system('rm -rf ~/*'). If you want somet

Re: How to get filesystem in python.

2020-01-17 Thread Python
/determining-the-filesystem-type-from-a-path-in-python -- https://mail.python.org/mailman/listinfo/python-list

Re: How to hide warning about drop table message to MariaDB

2020-01-19 Thread Python
^Bart wrote: I ran this code: #!/usr/bin/python import MySQLdb # Open database connection db = MySQLdb.connect("localhost","root","MyPwd","MyDB") # prepare a cursor object using cursor() method cursor = db.cursor() # Drop table if it already exist usin

Re: I need help for multidimensional loop

2020-01-26 Thread Python
IF. I worked hours on it, but I am a newbie and it is too difficult. I was wondering if a super expert in python could give me a hand. In order to give a maximum of info (explanations + code + screenshot), I prepared a google doc for better understanding. Here in a Facebook post would be too

Re: JavaScript's void operator in Python?

2020-02-02 Thread Python
il.python.org/mailman/listinfo/python-list

datetime seems to be broken WRT timezones (even when you add them)

2020-02-10 Thread Python
As best I can tell, Python has no means to make use of the system's timezone info. In order to make datetime "timezone aware", you need to manually create a subclass of datetime.tzinfo, whose methods return the correct values for the timezone you care about. In the general cas

Re: datetime seems to be broken WRT timezones (even when you add them)

2020-02-10 Thread Python
On Mon, Feb 10, 2020 at 05:52:59PM -0600, Skip Montanaro wrote: > > As best I can tell, Python has no means to make use of the system's > > timezone info. In order to make datetime "timezone aware", you need > > to manually create a subclass of datetime.tzi

Re: datetime seems to be broken WRT timezones (even when you add them)

2020-02-10 Thread Python
On Tue, Feb 11, 2020 at 11:04:28AM +1100, Chris Angelico wrote: > On Tue, Feb 11, 2020 at 10:42 AM Python wrote: > > Now, you can instantiate a datetime.datetime object with the times you > > want, and pass an instance of this class as the tzinfo argument to the > > construc

Re: datetime seems to be broken WRT timezones (even when you add them)

2020-02-10 Thread Python
On Tue, Feb 11, 2020 at 11:33:54AM +1100, Chris Angelico wrote: > [...] instead of using the undocumented and unsupported strftime %s > format code I'm not sure this characterization is accurate... the docs (for both Python 2 and 3) say: The full set of format codes supported va

Re: datetime seems to be broken WRT timezones (even when you add them)

2020-02-11 Thread Python
> > Ribbens has the save: > > Isn't it time to stop going to great effort to support Python If you live in a world where you get to decide that, sure. Not everyone does. -- https://mail.python.org/mailman/listinfo/python-list

Re: datetime seems to be broken WRT timezones (even when you add them)

2020-02-11 Thread Python
On Wed, Feb 12, 2020 at 05:38:38AM +1100, Chris Angelico wrote: > > > Isn't it time to stop going to great effort to support Python > > > > If you live in a world where you get to decide that, sure. Not > > everyone does. > > > > Everyone gets to d

Re: Technical debt - was Re: datetime seems to be broken WRT timezones (even when you add them)

2020-02-11 Thread Python
gt; it doesn't matter what you do, there's always real cost, and therefore > > always technical debt. Moving to Python 3 incurs technical debt. > > Staying with Python 2 incurs technical debt. Thus I wonder if the term > > is actually that useful. [...] > What you&#

Re: Technical debt - was Re: datetime seems to be broken WRT timezones (even when you add them)

2020-02-12 Thread Python
On Wed, Feb 12, 2020 at 01:16:03PM +, Rhodri James wrote: > On 12/02/2020 00:53, Python wrote: > > In pretty much every job I've ever worked at, funding work (e.g. with > > humans to do it) with exactly and precisely the resources required is > > basically impossible,

Re: python

2020-02-22 Thread Python
lberia...@gmail.com wrote: hi guys can you help me.how to find maximum and minimum in list using while loop python l = [1, 4, 2, -1, 0, 4, 2, 1, 10] for i in range(100): pass maximum = max(l) minimum = min(l) -- https://mail.python.org/mailman/listinfo/python-list

Re: Mental model of lookahead assertions

2020-02-27 Thread Python
/perl.plover.com/yak/regex/ (pdf and html slides) -- https://mail.python.org/mailman/listinfo/python-list

Re: Pandas Dataframe Numbers Comma Formatted

2020-05-09 Thread Python
Joydeep C wrote: On Sat, 09 May 2020 15:46:27 +0200, Python wrote: Joydeep C wrote: On Sat, 09 May 2020 14:42:43 +0200, Python wrote: Joydeep wrote: I have a Pandas dataframe like below. XY 0 1234567890 1 54321N/A 2 67890123456 I need to make these numbers

Re: Pandas Dataframe Numbers Comma Formatted

2020-05-09 Thread Python
345' >>> '{:,}'.format(value) # >= 2.7 '12,345' -- https://mail.python.org/mailman/listinfo/python-list

Re: Pandas Dataframe Numbers Comma Formatted

2020-05-09 Thread Python
Joydeep C wrote: On Sat, 09 May 2020 17:24:41 +0200, Python wrote: Joydeep C wrote: On Sat, 09 May 2020 15:46:27 +0200, Python wrote: Joydeep C wrote: On Sat, 09 May 2020 14:42:43 +0200, Python wrote: Joydeep wrote: I have a Pandas dataframe like below. XY 0 12345

Re: Pandas Dataframe Numbers Comma Formatted

2020-05-09 Thread Python
Joydeep C wrote: On Sat, 09 May 2020 14:42:43 +0200, Python wrote: Joydeep wrote: I have a Pandas dataframe like below. XY 0 1234567890 1 54321N/A 2 67890123456 I need to make these numbers comma formatted. For example, 12345 => 12,345. >>> val

Re: PyCharm, how to setup self contained subprojects

2020-05-22 Thread Python
Le 22/05/2020 à 03:41, zljubi...@gmail.com a écrit : Hi, I should provide python code for (Spring) microservice patform. In microservice paradigm, each microservice should do a simple task, so python code beneath it should be very small. As a PyCharm (community) user, I don't know how t

Re: Syntax Help

2020-06-10 Thread Python
Le 10/06/2020 à 18:56, John Weller a écrit : Hi I am trying to learn python. Looking at an example on the web I found this line: def plot(*args, **kwargs): What do the stars mean? That, respectively, positional arguments will be packed into a sequence of references called

Re: how to let argument be optional falling back to certain integer

2020-06-20 Thread Python
lse k When comparing wih None "is" is preferred to == k = N - 1 if k is None else k -- https://mail.python.org/mailman/listinfo/python-list

Re: Dowloading package dependencies from locked down machine

2020-07-28 Thread Python
Andrew McLean wrote: At work my only Internet access is via a locked-down PC. The IT department are not willing to install Python on it [1]. Ideally I would download packages and their dependencies from PyPi using "pip download" at the command line. Any better solutions than downl

Re: "1,+2,", but not "(1,)+2,"

2020-07-31 Thread Python
Stefan Ram wrote: Jon Ribbens writes: On 2020-07-31, Stefan Ram wrote: You can write |>>> 1,+2, |(1, 2) , but not |>>> (1,)+2, |TypeError: can only concatenate tuple (not "int") to tuple . Why? (Python 3.9) For the obvious reason, as indicated by the

Re: Explicit is better than Implicit

2020-08-06 Thread Python
> > > > As always, I am reminded of Heuer's Razor: > > > > If it can't be turned off, it's not a feature. - Karl Heuer > > > > Good one. I always remember the start-up days (late 90s) when I developed > and maintained an online concert calen

Re: How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?

2020-08-06 Thread Python
me problems very naturally lend themselves to recursive solutions. Fibonacci's sequence is one. #!/usr/bin/python def fib(x): if x < 1: raise "arg must be >= 1" if x == 1: return 0 elif x == 2: return 1 else: return fib(x - 1) + fib(x -

Re: Explicit is better than Implicit

2020-08-07 Thread Python
On Thu, Aug 06, 2020 at 07:46:25PM -0500, Python wrote: > On Thu, Aug 06, 2020 at 07:19:01PM -0500, Skip Montanaro wrote: > Python is *actually* easy to work with... most of the time. "If you > want more things for you buck there's no luck..." =8^) [And yes, I'm

Re: How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?

2020-08-07 Thread Python
On Fri, Aug 07, 2020 at 04:23:42PM +1000, Chris Angelico wrote: > On Fri, Aug 7, 2020 at 11:11 AM Python wrote: > > Pretty straightforward. Now try yourself to write the iterative > > version. > > It might look slightly better to a mathematician, but it's so > abys

Re: How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?

2020-08-07 Thread Python
On Sat, Aug 08, 2020 at 01:46:28AM +1000, Chris Angelico wrote: > On Sat, Aug 8, 2020 at 1:38 AM Python wrote: > TBH most people won't get the recursive version right the first time > either. So FWIW, I/my team don't find this to be true. I was originally going to mention

Re: Another 2 to 3 mail encoding problem

2020-08-26 Thread Python
Alexa Oña wrote: Don’t send me more emails Obtener Outlook para iOS<https://aka.ms/o0ukef> You are the one spamming the mailing list with unrelated posts. STOP. -- https://mail.python.org/mailman/listinfo/python-list

Re: Threading plus multiprocessing plus cv2 error

2020-09-03 Thread Python
are common in multi-threaded programs that are written incorrectly, especially when the state of one thread depends on the state of the other thread, and the two don't synchronize correctly. This is another way that the first problem above can manifest, too: The threads can't synchronize because one of them does not exist! Hope that helps. signature.asc Description: PGP signature -- https://mail.python.org/mailman/listinfo/python-list

Re: compile error building building Python-3.8.5 on Debian 8.11 (yes, old!)

2020-09-04 Thread Python
On Fri, Sep 04, 2020 at 08:04:33AM -0800, Joshua J. Kugler wrote: > On Thursday, September 3, 2020 8:59:09 PM AKDT Cameron Simpson wrote: > > I've built 3.8.5 on a few other machines happily recently. > > > > Building Python 3.8.5, running make and gcc (Debian 4.9.2-

Re: compile error building building Python-3.8.5 on Debian 8.11 (yes, old!)

2020-09-04 Thread Python
On Fri, Sep 04, 2020 at 03:43:14PM -0500, Python wrote: > On Fri, Sep 04, 2020 at 08:04:33AM -0800, Joshua J. Kugler wrote: > > On Thursday, September 3, 2020 8:59:09 PM AKDT Cameron Simpson wrote: > > > Building Python 3.8.5, running make and gcc (Debian 4.9.2-10+deb8u2) >

Re: Use of a variable in parent loop

2020-09-28 Thread Python
On Sun, Sep 27, 2020 at 03:18:44PM +0800, Stephane Tougard via Python-list wrote: > On 2020-09-27, 2qdxy4rzwzuui...@potatochowder.com > <2qdxy4rzwzuui...@potatochowder.com> wrote: > > As ChrisA noted, Python almost always Just Works without declarations. > > If you fin

Re: How to handle a dictionary value that is a list

2020-10-02 Thread Python
d refer to it either as f or as d['regulatedActivities']['contacts']['personRoles'] when you do so. It is an alias, not a copy, so if you change one, you change the other. HTH. -- https://mail.python.org/mailman/listinfo/python-list

newbiew ?->creating multiuser database project 2 b used via internet

2005-11-07 Thread python
hello and thanks for reading this. i am a long time windows/visual_basic user and i have been quite happy using that. i am doing a consulting project for a dry cleaning company. in the past i would use windows and visual basic but i want to create an app using python and linux using something

how to modify code while debugging it without having to stop and then restart debugger

2005-11-07 Thread python
this. in fact, the free version of the visual studio 2005, which is free, have this ability. so how can i use python to debug code and change that code without having to restart the code. thanks so much, dave -- http://mail.python.org/mailman/listinfo/python-list

Re: how to modify code while debugging it without having to stop and then restart debugger

2005-11-08 Thread python
pointing at, i simple copy and paste the bad code line just below the actual code line. i fix this copied code line. then i just turn the bad line into a comment line and the debugger will move the current focus to the next time, which is the fixed code. how can such a dynamic language like python

Re: printing line numbers for debugging purpose

2005-01-09 Thread python
uple: -(file, line, func, text). - -The optional argument 'up' allows retrieval of -a caller further back up into the call stack. - -Note, the source text may be None and function -name may be '?' in the returned result. In -Pyth

Re: readline, rlcompleter

2005-01-11 Thread python
There is a pretty complete (no pun intended) example in the standard cmd module <http://docs.python.org/lib/module-cmd.html> Check file cmd.py in your Python installation .../lib/pythonX.Y/cmd.py, specifically the methods Cmd.preloop() and Cmd.complete(). Another, more elaborate example

Index server

2005-01-14 Thread python
Is there an Index server available in Python? For example: I have large intranet with several servers and I would like to index documents like search engines do. Users then can search for a domument in ALL intranet servers like I do on Google. Thanks for answers L.A. -- http://mail.python.org

How to prevent the script from stopping before it should

2005-01-17 Thread python
(from where I download the pages) is rather poor. Is there a solution how to prevent the script from hanging before all pages are downloaded? Thanks for help Lad. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to prevent the script from stopping before it should

2005-01-17 Thread python
#except Exception, e: > > #print >> sys.stderr, '%s: %s' % (e.__class__.__name__, e) > > will print an error if a page fails opening, rest opens fine > > > More generally you may wish to use the timeout features of TCP sockets. > These were int

Re: How to prevent the script from stopping before it should

2005-01-18 Thread python
oading and if the slave thread stopped, master thread would start another slave. Is it a good solution? Or is there a better solution? Thanks for help Lad -- http://mail.python.org/mailman/listinfo/python-list

Re: How to lanch a webbrowser

2005-01-20 Thread python
Steve Holden wrote: > Ola Natvig wrote: > > > [EMAIL PROTECTED] wrote: > > > >> Does anyone know > >> how to lanch a webbrowser ( from Python) without menu and toolbars? > >> Thanks for help > >> Lad > >> > > > &g

Skype and Python

2005-01-25 Thread python
Does anyone played with Skype (http://www.skype.com/ free Internet telephony ) by using Python? Lad. -- http://mail.python.org/mailman/listinfo/python-list

How to post news articles with NNTPlib

2005-01-28 Thread python
Hello, How to post a news article with NNTPlib if the news server requires login. I did not find nay login command in nntplib module. Thank you lad. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to post news articles with NNTPlib

2005-01-28 Thread python
Do Re Mi chel La Si Do wrote: > Hi ! > > > nntplib.NNTP(newsserver,port,user,passe) > > > > -- > Michel Claveau Thank you -- http://mail.python.org/mailman/listinfo/python-list

CONTEST - What is the (best) solution?

2005-02-02 Thread python
/python-list

Re: CONTEST - What is the (best) solution?

2005-02-02 Thread python
in dictionaries. I re-checked and I would need only the last dictionary. Any idea how I could do that? Thanks Lad. -- http://mail.python.org/mailman/listinfo/python-list

Re: tuples and mysqldb tables

2005-09-19 Thread Python
with output > > myPort = port > > myProtocol = result[0|3] > > myName = result[0|4] > > myDescription = result[0|5] > > print "PORT # | PROTOCOL | PORT NAME | PORT DESCRIPTION " > > print myPort, myProtocol, myName, myDescription > > cursor.close() > > conn.close() > > # end function - > > > > grabPortInfo(22) > > > > > -- Lloyd Kvam Venix Corp -- http://mail.python.org/mailman/listinfo/python-list

Re: Injecting a C side object into the local dict

2005-02-11 Thread python
Take a look at Pyrex. <http://nz.cosc.canterbury.ac.nz/~greg/python/Pyrex/> More at <http://www-106.ibm.com/developerworks/library/l-cppyrex.html> /Jean Brouwers Jamie R. Parent wrote: > Hello, > > How do you go about taking a variable which was declared in C and p

Re: For American numbers

2005-02-12 Thread python
t; else: > prefix = '' > if value < 0: > return '-%.3f %s%s' % (magnitude, prefix, units) > return '%.3f %s%s' % (magnitude, prefix, units) > > --Scott David Daniels > [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I get the source file name and current line number inside executed C-function

2005-02-16 Thread python
Below is a function to find the caller's file name, line number, etc. inside Python. Maybe this works for your case. /Jean Brouwers - import traceback - - def caller(up=0): - '''Get file name, line number, function name and -source text of the caller

Looking for tips for moving dev environment from Windows to Mac

2014-01-08 Thread python
der for my new environment.. Some early questions: 1. Which distribution of Python to install (Python.org, ActivateState, other?) and do I need to do anything special to avoid overwriting the system copy of Python? 2. Text editor: Textmate, BBEdit, Emacs/VI, or other? 3. Multiple externa

Are there performance concerns with popping from front of long lists vs. the end of long lists?

2014-06-22 Thread python
Should I have any performance concerns with the index position used to pop() values off of large lists? In other words, should pop(0) and pop() be time equivalent operations with long lists? -- https://mail.python.org/mailman/listinfo/python-list

Re: Are there performance concerns with popping from front of long lists vs. the end of long lists?

2014-06-22 Thread python
MRAB, Terry, Ethan, and others ... Thank you - collections.deque is exactly what I was looking for. Malcolm -- https://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   9   10   >