Re: python's future?

2012-06-15 Thread Mark Lawrence
the python rules long~ time. what do you think about future of this lang or famous lang like C, JAVA, C#, LISP&C I believe that this still holds true http://www.gossamer-threads.com/lists/python/python/129650?do=post_view_threaded -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/l

Re: python's future?

2012-06-15 Thread Mark Lawrence
that it's also pre-installed on OS X. It's just a pity that Python is no longer maintained on the finest OS ever, i.e. VMS :( -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL for the Python 3.2.3

2012-06-15 Thread Mark Lawrence
On 15/06/2012 13:18, Gonzalo de Soto wrote: Dear Python Org, It wanted to know if already PIL's version is available for Python 3.2.3. Thanks. Gonzalo Please refer to Matthew 7:7 for a way forward. -- Cheers. Mark Lawrence. --

Academic citation of Python

2012-06-15 Thread Mark Livingstone
Hello! I wish to properly cite Python in an academic paper I am writing. Is there a preferred document etc to cite? Thanks in advance, MArkL -- http://mail.python.org/mailman/listinfo/python-list

Re: Academic citation of Python

2012-06-16 Thread Mark Lawrence
On 16/06/2012 04:24, Mark Livingstone wrote: Hello! I wish to properly cite Python in an academic paper I am writing. Is there a preferred document etc to cite? Thanks in advance, MArkL The main website www.python.org and possibly the sites for Jython, IronPython and PyPY? -- Cheers

Re: Distutils beginner question - windows

2011-06-05 Thread Mark Hammond
tell it you want to package Sendmailmsg.py and it finds all other dependent modules like smtplib etc, bundles them up with a full python runtime and rolls it into a nice executable) HTH, Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple windows services on the same machine

2011-06-06 Thread Mark Hammond
your own argv parsing and call InstallService directly. HTH, Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: pexpect and OpenVMS

2011-06-09 Thread Mark Franklin
I ran into a similar problem. I found throttling self.sh.delaybeforesend works for me. I'm on ubuntu. -- http://mail.python.org/mailman/listinfo/python-list

Re: the stupid encoding problem to stdout

2011-06-09 Thread Mark Tolonen
encoding: PYTHONIOENCODING=utf-8 -Mark -- http://mail.python.org/mailman/listinfo/python-list

Question About Command line arguments

2011-06-10 Thread Mark Phillips
prints out the usage statement. Is the problem with the echo command, or how I wrote my script? Thanks! Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Question About Command line arguments

2011-06-10 Thread Mark Phillips
On Fri, Jun 10, 2011 at 10:41 AM, MRAB wrote: > On 10/06/2011 18:21, Mark Phillips wrote: > >> I have a script that processes command line arguments >> >> def main(argv=None): >> syslog.syslog("Sparkler stared processing") >> if argv is None:

Re: Question About Command line arguments

2011-06-10 Thread Mark Phillips
On Fri, Jun 10, 2011 at 11:03 AM, Kurt Smith wrote: > On Fri, Jun 10, 2011 at 12:58 PM, Mark Phillips > wrote: > > How do I write my script so it picks up argument from the output of > commands > > that pipe input into my script? > > def main(): >import

Re: Fun and games with lambda

2011-06-17 Thread Mark Dickinson
t; [0]*13,(F,(F*F)//S(2*F),2,F//2)))(lambda n:f(lambda x,_:(x-x//2+(n*F)// > (2*x)),[0]*15,n//2)))(10**(5010[:5000])))(reduce)) Very nice, but a little unnatural. Can't you find room to stick an extra factor of 2 in there somewhere? (See also: http://bugs.python.org/issue12345 ) -- M

Re: Python 2.7.2 for Windows reports version as 2.7.0?

2011-06-18 Thread Mark Hammond
is somehow old? Make sure: >>> import sys >>> win32api.GetModuleFileName(sys.dllhandle) Is the DLL you expect. Mark -- http://mail.python.org/mailman/listinfo/python-list

[ANN] Shed Skin 0.8

2011-06-21 Thread Mark Dufour
Hi all, I have just released version 0.8 of Shed Skin, an experimental (restricted-)Python-to-C++ compiler. Please see my blog for the full announcement: http://shed-skin.blogspot.com The Shed Skin homepage can be found here: http://shedskin.googlecode.com Thanks, Mark Dufour -- http

Re: Large number multiplication

2011-07-08 Thread Mark Dickinson
on's implementation of long integers; see Victor Stinner's efforts in this direction [2]. Licensing concerns, and the fact that Python's implementation is faster for small integers, ended up killing this issue. [1] http://mail.python.org/pipermail/python-dev/2008-November/083355.ht

CI and BDD with Python

2011-07-08 Thread mark curphey
world for adopting something native like Trac and one of the CI plugins like Bitten? Cheers! Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: CI and BDD with Python

2011-07-09 Thread mark curphey
) is tough to beat IMHO but I am sure this is just my personal preference. Anyways thanks for the help. Cheers, Mark On Jul 9, 2011, at 7:05 PM, Phlip wrote: > On Jul 8, 9:36 pm, Stefan Behnel wrote: >> mark curphey, 09.07.2011 01:41: >> >>> And for CI having been

Python 2.6.6 on Windows 7 problem - "ImportError: No module named site"

2011-07-15 Thread Mark Ohrboot
: can't find encoding" I reinstalled it, but this makes no difference. Any suggestions? Thanks Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: a little parsing challenge ☺

2011-07-19 Thread Mark Tarver
(snd Br) (error "parse failure at position ~A~%" (- (length Stuff) (length Residue)) e.g. (tellme ["(" 1 2 3 ")" "(" 4]) parse failure at position 5 (tellme ["(" 1 2 3 ")" "(" ")" 4]) [[1 2 3] [] 4] The extension of this program to the case described is fairly simple. Qi-YACC is very similar. Nice problem. I do not have further time to correspond right now. Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: ActivePython: multiple versions on OSX?

2011-07-26 Thread Mark Curphey
Why not use Virtualenv ? http://pypi.python.org/pypi/virtualenv On Mon, Jul 25, 2011 at 5:18 PM, Robert wrote: > Is it possible to install the 2 and 3 series side by side? > > -- > Robert > > > -- > http://mail.python.org/**mailman/listinfo/python-list

Re: Is it bad practise to write __all__ like that

2011-07-28 Thread mark ferguson
HI Thomas, I've not really got the hang of decorators yet, so I was wondering why one might use your approach rather than just using Karim's original method? I only really use python for smallish, utility programs, so I suppose I haven't come across an issue complex enough to see a clear advantag

Re: Is it bad practise to write __all__ like that

2011-07-29 Thread mark ferguson
Thomas, A ha! Now I feel all warm and fuzzy inside. It's nice to start the day with learning something new. To be honest, the initial problem was that I didn't understand the meaning of '__all__', again probably from not working in the large with python. After posting, I went and had another go a

Re: Question

2011-08-01 Thread mark ferguson
Peter - well caught! I've been wondering how that line could have arisen when running a script through the interpreter from the command line! Pasting it into Idle gives exactly that output. It was the leading $ that threw me, I took it as the shell prompt. I think that Camilo was actually typing i

Re: Dynamically linking python into my vc project - help required

2011-08-05 Thread Mark Hammond
ct on those function pointer decls? How can this be done ? Please help. Is there a different approach to linking to python dynamically. Please could you write to me ? py2exe takes the same basic approach as you and might be worth copying its declarations for the function pointers? Mark --

Re: lists and for loops

2011-08-18 Thread Mark Niemczyk
Or, using list comprehension. >>> numbers = [1, 2, 3, 4, 5] >>> numbers = [n + 5 for n in numbers] >>> numbers [6, 7, 8, 9, 10] -- http://mail.python.org/mailman/listinfo/python-list

Re: import os or import os.path

2011-09-06 Thread Mark Hammond
s it might not. That's probably a matter of opinion - eg, http://docs.python.org/tutorial/interpreter.html has an example of importing the os module then accessing os.path. Personally I think directly importing os.path is a waste of precious keystrokes ;) Cheers, Mark. -- http://mail.python.org/mailman/listinfo/python-list

Re: Representation of floats (-> Mark Dickinson?)

2011-09-07 Thread Mark Dickinson
; 1.1 * 1.1 1.21 in jmf's message. Cut-and-paste typo? -- Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems of Symbol Congestion in Computer Languages

2011-03-01 Thread Mark Thomas
I know someone who was involved in creating a language called A+. It was invented at Morgan Stanley where they used Sun keyboards and had access to many symbols, so the language did have set symbols, math symbols, logic symbols etc. Here's a keyboard map including the language's symbols (the red ch

Re: builtin max() and weak ordering

2011-03-03 Thread Mark Dickinson
tation update ? See: http://bugs.python.org/issue9802 (and feel free to add comments to that issue). Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Python fails on math

2011-03-09 Thread Mark Dickinson
ion.) In theory this is prohibited too, under C99 + Annex F. -- Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido rethinking removal of cmp from sort method

2011-03-26 Thread Mark Dickinson
dard library rather than the core. And then the existence of the ** operator obviates the need for two- argument pow. Worse than pow itself is the fact that the __pow__ special method takes an optional 3rd argument, which apart from unnecessarily complicating Python's internal, also leads to horrors like Decimal's (IMO inappropriate) support for 3-argument pow. -- Mark -- http://mail.python.org/mailman/listinfo/python-list

[ANN] Shed Skin 0.7.1

2011-03-26 Thread Mark Dufour
hed-skin.blogspot.com Or go straight to the homepage: http://shedskin.googlecode.com Please have a look at the tutorial, try it out, and file any problems in the issue tracker. I'm also always very interested in hearing about potential new programs to add to the example set! Thanks, Mar

Re: embedding interactive python interpreter

2011-03-27 Thread Mark Hammond
be to look into the code/console modules where you may be able to arrange for more control over the REPL. Cheers, Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Some questions on pow and random

2011-03-27 Thread Mark Dickinson
to work with log likelihood instead of likelihood itself, in which case you'd want a sum instead: >>> sum(fi*log(pi) for pi, fi in zip(p, f)) -40.03652078615561 If you really need the likelihood itself, you might try using the Decimal module, which allows a much wider exponent range than Python's builtin float. -- Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Some questions on pow and random

2011-03-27 Thread Mark Dickinson
g > to multiply them, is it fine? Or should I take anything else? Sorry, it's unclear to me what you're asking here. Can you rephrase this as a question about Python's random.random() function? If you're asking whether it's okay to regard your generated x1 and x2 as in

Re: Some questions on pow and random

2011-03-27 Thread Mark Dickinson
8e-08, 6.87194767e-08]) > (ii) The second question is, if I have another set of variables, > > variable1=random.random() > variable2=random.random() In this case 'variable1' and 'variable2' are Python floats, so yes, you can multiply them directly. (BTW, you can always exp

Re: embedding interactive python interpreter

2011-03-27 Thread Mark Hammond
t exit the process, as long as Py_InspectFlag is not set. Looks like it should refer to SystemExit, not SystemError. If you check out pythonrun.c in handle_system_exit, you will note the behaviour described above is exactly what is implemented for SystemExit. See also http://bugs.python.org/

Re: embedding interactive python interpreter

2011-03-28 Thread Mark Hammond
he exception is caught) and things will return normally (albeit without any return code that may have been specified in the SystemExit exception). If you arrange to call that code in your app (either by importing it as a module of even by calling PyRun_SimpleString) things should work as you need

Looking for a urllib(2) cookie handler

2011-04-19 Thread Mark Carter
I'm in python 2.6.5, and have Firefox 3.6.13. I would like to download some html from a site and scrape it programatically. The site requires a cookie, which I have in Firefox. Is there a simple python recipe I can use to read the contents of a url and say "just use the cookie that I have in Firef

Re: Looking for a urllib(2) cookie handler

2011-04-19 Thread Mark Carter
On Apr 19, 12:44 pm, Mark Carter wrote: > url and say "just use the cookie that I have in Firefox"? "mechanize" looks kinda like what I want, but i still can't get it to work properly. So far I have: import cookielib import mechanize cookiefile = "C:\\User

Re: multiple Python 2.7 Windows installations

2011-04-19 Thread Mark Hammond
; package to install (ie, no C extension modules), that routine will offer to install it into *any* Python version. Cheers, Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: dictionary size changed during iteration

2011-04-22 Thread Mark Niemczyk
ion could be to change the ukeys assignment statement to: ukeys = list(self.updates.keys()) Hope this helps, Mark N. -- http://mail.python.org/mailman/listinfo/python-list

Re: De-tupleizing a list

2011-04-26 Thread Mark Niemczyk
#relative time: 63 return list(itertools.chain.from_iterable(lst)) (5)return [x for (x,) in lst] #relative time: 52 With the caveat that 'your mileage may vary' Regards, Mark -- http://mail.python.org/mailman/listi

Re: Fibonacci series recursion error

2011-05-02 Thread Mark Dickinson
Any other definition is rather, shall we say, idiosyncratic. And a concrete reason for preferring the above definition (in either form) is that divisibility properties of the sequence are much neater with this choice: gcd(F_m, F_n) = F_{gcd(m, n)} -- Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: What other languages use the same data model as Python?

2011-05-04 Thread Mark Hammond
stand exactly how things work (so don't need an explanation), the point is that for anything close to a high-level language, things aren't as black and white as they are for the low-level languages... Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: How best to convert a string "list" to a python list

2011-05-13 Thread Mark Niemczyk
;, 'blue', 'green', 'yellow'] >>> Here is the link to a discussion of the build-in str methods (3.2), but this documentation exists for prior versions of Python as well. http://docs.python.org/py3k/library/stdtypes.html#str.split Good luck, Mark Niemczyk -- http://mail.python.org/mailman/listinfo/python-list

Re: Recursion or iteration (was Fibonacci series recursion error)

2011-05-13 Thread Mark Dickinson
those with a bit of abstract algebra, the above algorithm is just computing x^n in the ring Z[x] / (x^2 - x - 1). A pair 'Pair(a, b)' represents the element 'a + bx' (more precisely, the image of 'a + bx' under the natural quotient map Z[x] -> Z[x] / (x^2 - x

Re: Recursion or iteration (was Fibonacci series recursion error)

2011-05-15 Thread Mark Dickinson
tion of n, and (b) g(2^k) = 2^k - 1 for all k >= 1. Hence g(n) is O(n). Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Recursion or iteration (was Fibonacci series recursion error)

2011-05-15 Thread Mark Dickinson
On May 15, 8:20 pm, Mark Dickinson wrote: > On May 15, 4:32 am, rusi wrote: > > > On May 15, 2:19 am, Ian Kelly wrote: > > > Yup, linear.  Assuming you optimize the even case so that it doesn't > > > actually call fib(n//2) twice, the call tree can be appr

Re: bdist_wininst: install_script not run on uninstall

2011-05-25 Thread Mark Hammond
h is there. But can anybody find out why the install script is not run? Works for me in the pywin32 install script - maybe you should make the smallest possible example that doesn't work and post the entire thing here? Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: bdist_wininst: install_script not run on uninstall

2011-05-27 Thread Mark Hammond
On 26/05/2011 6:00 PM, Wilbert Berendsen wrote: Op donderdag 26 mei 2011 schreef Mark: Wilbert wrote: can anybody find out why the install script is not run? Works for me in the pywin32 install script - maybe you should make the smallest possible example that doesn't work and pos

Re: This newsgroup (comp.lang.python) may soon be blocked by Google Groups

2018-02-03 Thread Mark Lawrence
ou, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: This newsgroup (comp.lang.python) may soon be blocked by Google Gro

2018-02-08 Thread Mark Lawrence
;m pointing out the disgraceful state of gg and why it should be dropped as it's less than useless. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: This newsgroup (comp.lang.python) may soon be blocked by Google Gro

2018-02-09 Thread Mark Lawrence
with the gmane website. Just point any (semi-)decent mail client like Thunderbird at news.gmane.org and you've access to hundreds of Python lists and thousands of other technical lists. I find the search facilities perfectly adequate. -- My fellow Pythonistas, ask not what our language

Re: Extracting data from ython dictionary object

2018-02-09 Thread Mark Lawrence
ts ['MILANI,', 'JOHN', 'C', 'Tmt.', 'Dt.'] # I'll leave you to grab the names, and strip the comma from the last name. >>> start = bits[3].find('- ') >>> stop = bits[3].find('(') >>> date = bits[3][start + 2: stop].strip() >>> date '05/28/2014' Apologies for the variable names used, I'm sure that you can think of something better :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Regex on a Dictionary

2018-02-13 Thread Mark Lawrence
l(MyDict) print(x) Thanks in advance for any help. Was the string methods solution that I gave a week or so ago so bad that you still think that you need a regex to solve this? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Respam levels.

2018-02-13 Thread Mark Lawrence
hich I believe was purely accidental. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Regex on a Dictionary

2018-02-13 Thread Mark Lawrence
On 13/02/18 18:08, Stanley Denman wrote: On Tuesday, February 13, 2018 at 9:41:14 AM UTC-6, Mark Lawrence wrote: On 13/02/18 13:11, Stanley Denman wrote: I am trying to performance a regex on a "string" of text that python isinstance is telling me is a dictionary. When I run the

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-17 Thread Mark Lawrence
ou, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Gmane seems to be gone

2018-02-18 Thread Mark Lawrence
ervice is resumed :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Computer History Museum Announces 2018 Fellow Award Honorees

2018-02-21 Thread Mark Lawrence
One is the BDFL http://www.computerhistory.org/press/2018-fellow-honorees.html -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: atws

2018-02-21 Thread Mark Lawrence
or their own work? According to https://github.com/byt3bl33d3r/CrackMapExec/issues/167, which reports the same error, you just need to update the requests package. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

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

2018-02-22 Thread Mark Lawrence
park for every test that was run. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: atws

2018-02-22 Thread Mark Lawrence
nd then help(atws) shows help so I'm guessing that it's just a poor informational message, so I suggest that you just try running your code and see what happens. p.s. enjoying the curling at the Winter Olympics? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: RFC: Proposal: Deterministic Object Destruction

2018-03-04 Thread Mark Lawrence
s I can't see this happening in a month of Sundays. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: RFC: Proposal: Deterministic Object Destruction

2018-03-04 Thread Mark Lawrence
On 05/03/18 01:01, Ooomzay wrote: On Sunday, 4 March 2018 23:57:24 UTC, Mark Lawrence wrote: On 04/03/18 02:28, Ooomzay wrote: On Friday, 2 March 2018 15:37:25 UTC, Paul Moore wrote: [snip] def fn(): for i in range(1): with open(f"file{i}.txt",

Re: Python installation

2022-07-04 Thread Mark Pawelek
I also have a windows installation issue on Windows 10: ISSUE: I cannot select a folder to install Python in. I want to put it under Program Files. The 'installer' only wants to put it in C:\users\Lenovo\AppData\local\Programs\Python\Python310 What do I do to alter the path to something like: C:

Re: How to make a variable's late binding crosses the module boundary?

2022-08-28 Thread Mark Bourne
to `test.x`, for example: import test test.x = 4 test.foo() -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to make a variable's late binding crosses the module boundary?

2022-08-29 Thread Mark Bourne
Jach Feng wrote: Chris Angelico 在 2022年8月29日 星期一下午1:58:58 [UTC+8] 的信中寫道: On Mon, 29 Aug 2022 at 15:54, Jach Feng wrote: Richard Damon 在 2022年8月29日 星期一上午10:47:08 [UTC+8] 的信中寫道: On 8/27/22 7:42 AM, Mark Bourne wrote: Jach Feng wrote: I have two files: test.py and test2.py --test.py-- x = 2

Re: What can I do about this?

2022-08-29 Thread Mark Bourne
Roel Schroeven wrote: Op 29/08/2022 om 2:55 schreef gene heskett: On 8/28/22 19:39, Peter J. Holzer wrote: On 2022-08-28 18:40:17 -0400, gene heskett wrote: Persuant to my claim the py3.10 is busted, here is a sample. This is me, trying to make pronterface, inside a venv: When the package man

Re: What can I do about this?

2022-08-29 Thread Mark Bourne
gene heskett wrote: On 8/29/22 12:50, Mark Bourne wrote: Roel Schroeven wrote: Op 29/08/2022 om 2:55 schreef gene heskett: On 8/28/22 19:39, Peter J. Holzer wrote: On 2022-08-28 18:40:17 -0400, gene heskett wrote: Persuant to my claim the py3.10 is busted, here is a sample. This is me

Re: How to make a variable's late binding crosses the module boundary?

2022-08-31 Thread Mark Bourne
Jach Feng wrote: Mark Bourne 在 2022年8月29日 星期一下午6:40:59 [UTC+8] 的信中寫道: Jach Feng wrote: Chris Angelico 在 2022年8月29日 星期一下午1:58:58 [UTC+8] 的信中寫道: On Mon, 29 Aug 2022 at 15:54, Jach Feng wrote: Richard Damon 在 2022年8月29日 星期一上午10:47:08 [UTC+8] 的信中寫道: On 8/27/22 7:42 AM, Mark Bourne wrote

Re: How to enter escape character in a positional string argument from the command line?

2022-12-19 Thread Mark Bourne
cript $'step\x0a' (dollar sign before a single-quoted string which contains escape sequences) -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: How make your module substitute a python stdlib module.

2022-12-27 Thread Mark Bourne
g `%(myThread)d` and `%(myThreadName)s` in the log format string would use those attributes, without needing a custom formatter. That would allow both thread IDs to be logged, in case a mix of standard threads and your threads is used. -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: To clarify how Python handles two equal objects

2023-01-15 Thread Mark Bourne
ule me. I haven't done much with C extensions, but I don't think you'd need to do anything with "x" in that case. If something else is assigned to "y", "x" would still be a reference to the original object - why would it need to be "restored" to anything? Unless I've misunderstood what's going on here... -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-22 Thread Mark Bourne
ling your script. e.g. you'd call (from a Windows command prompt / Linux shell / etc.): > ./convert_infix.py -- '-4^2+5.3*abs(-2-1)/2' (it's probably a good idea to quote the expression, in case it includes any characters which would be interpreted specially by the shell - e.g. "*" without quotes usually expands to all matching files in the current directory) -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: bool and int

2023-01-27 Thread Mark Bourne
gh to be made to deal with insane situations where False is 2! -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-28 Thread Mark Bourne
st shells I've used pass the pattern unchanged if it doesn't match any files). In bash, if a "$" is used I'd need to enclose that in 'single quotes' (can't even use "double quotes" for that one). You can't really expect to document all that sort of thing, because it depends on which shell the user happens to run your application from - you just have to trust the user to know or learn how to use their shell. -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: evaluation question

2023-01-28 Thread Mark Bourne
al("print(123)"), which prints 123 and returns None. The P step doesn't print anything if the result is None. You'd still see that output if this was in a script. Using eval in those examples is pretty pointless, since: >>> 1+1 >>> print(123) would produce

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread Mark Bourne
gain, this is a feature of the shell, not your application, and other shells might behave differently. You probably don't want to go down the line of trying to document this kind of thing in your applications usage information, because it won't work like that for someone using e.g. the bash shell (which can be run on Windows). -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread Mark Bourne
applications might not use that convention even if called from the same shell, so it seems *more* in scope for your application to document than using quotes around spaces. -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: evaluation question

2023-01-31 Thread Mark Bourne
ose is to have an effect just return None. -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: evaluation question

2023-02-02 Thread Mark Bourne
ioned. That's about an 11 year transition period, which is hardly sudden! Python 3 *was* the point at which the features deprecated in Python 2 were removed. The problem is, a lot seemed to ignore Python 3 for the first 12 years and then suddenly panic because Python 2 support had ended.

Re: A Function's name during its definition

2023-02-07 Thread Mark Bourne
y eval() can't see it. The following does work: def g(): def f(): print(eval('g')) f() g() ...because in this case "g" is defined in the global scope, so the code in the eval call can see it. The following also works: def g(): def f(): pas

Re: A Function's name during its definition

2023-02-07 Thread Mark Bourne
Stefan Ram wrote: Mark Bourne writes: In the second case, eval() only gets the globals and immediate locals, Yes, I think you are right. Curiously, the following program would mislead one to thing that eval /does/ see the intermediate names: main.py def f(): x = 22 def g

Re: ChatGPT Generated news poster code

2023-02-13 Thread Mark Bourne
d have been, because the block size was reported differently.) -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: Add angle brackets for required args in argparse

2023-02-20 Thread Mark Bourne
` for every positional argument. However, it is overriding a non-public method of the `HelpFormatter` class, so might not work across all Python versions if the name or signature of that method changes (even if it does work with all current versions, it might break in future). -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: Line continuation and comments

2023-02-24 Thread Mark Bourne
ontinuation anyway. You could almost think of "\ (newline)" in a multiline string as being like an escape sequence meaning "don't actually put a newline character in the string here", in a similar way to "\n" meaning "put a newline character here" and

Re: Windows installer from python source code without access to source code

2023-04-07 Thread Mark Bourne
r list administrators! Ignore the admin address and password boxes, just fill in your email address in the box below those and click "Unsubscribe or edit options". -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: Pycharm IDE

2023-04-19 Thread Mark Bourne
at 11:17:52 PM MDT, Kevin M. Wilson via Python-list wrote:   print (f'"I am thinking of a number between 1 to {LIMIT}\n")I had the impression that the format specifier 'f' was necessary for the print function, but the double quotes are for the string printed to the

Re: Question regarding unexpected behavior in using __enter__ method

2023-04-26 Thread Mark Bourne
that it's the first example (with `__enter__ = int`) that should be a bit more surprising. (I'm not sure there's much practical use for the original `__enter__ = int` either, but presumably that's just used as a cut-down demonstration). -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Fwd: Problems Installing and getting started.

2023-05-31 Thread Mark Bass
-- Forwarded message - From: Mark Bass Date: Wed, 31 May 2023 at 08:09 Subject: Problems Installing and getting started. To: Good morning, I installed python several hours ago (from python.org), I then installed the IDE PyCharm. I'm using AI to help with a project

Is it possible to process dist files before they are build via a setuptools hook?

2016-09-09 Thread Mark Summerfield
Hi, I use setuptools (in my case with cx_Freeze) to package some of my Python applications. As part of this process a build\exe.win-amd64-3.4 dir is created with all the necessary files, and then a separate dist\ dir is created with the distributable package (e.g., a .msi file). I'd like to r

What is the correct form for saying "licensed under the same terms as Python itself"?

2016-09-14 Thread Mark Summerfield
Hi, I'm developing a small Python software library that I want to publish as free software under the same terms as Python itself. I notice that a few of Python's own files begin like this: # Copyright 2007 XXX. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. Is this form

Re: What is the correct form for saying "licensed under the same terms as Python itself"?

2016-09-14 Thread Mark Summerfield
Thanks v. much: I'll use the Apache 2.0 license. -- https://mail.python.org/mailman/listinfo/python-list

Re: Solid Approach For Creating A Desktop Application

2016-10-10 Thread Mark Summerfield
On Monday, October 10, 2016 at 5:53:37 AM UTC+1, Mahan Marwat wrote: > I want to know what will be your approach creating a solid/reliable > application in Python? > i.e > 1. Which GUI framework will you use i.e PyQT or what? (will you make it work > removing the window default border) > 2. What

Re: PyQT - Signals and Slots?

2016-10-10 Thread Mark Summerfield
The ZeroSpinBox is a tiny example designed to show how the signal/slot mechanism works. It is just a QSpinBox with the addition of remembering how many times (all the) ZeroSpinBox(es) have had a 0 value. Nowadays the connections would be made with a new improved syntax: self.connect(self, SIGNAL

Re: [FAQ] "Best" GUI toolkit for python

2016-10-18 Thread Mark Summerfield
PySide/PyQt On Windows I use Python 3.4 + PySide 1.2.4 (Qt 4.8). I have found this very reliable and use it for both my personal projects and for my commercial products. I don't use a GUI design tool but you could use Qt Designer to visually draw your GUI since PySide can read the .ui files it out

Re: [FAQ] "Best" GUI toolkit for python

2016-10-18 Thread Mark Summerfield
On Tuesday, October 18, 2016 at 9:04:48 AM UTC+1, pozz wrote: > Il 18/10/2016 09:42, Mark Summerfield ha scritto: [snip] > Why don't you use a GUI design tool? Better... how can you design a GUI > without seeing it? For me it's very difficult to "code the GUI".

<    4   5   6   7   8   9   10   11   12   13   >