On Thu, 05 Jul 2018 00:56:22 +0300, Mikhail V wrote:
> for the user it is most important to
> *see* and copy-paste the path string exactly as it is displayed
> everywhere else on windows.
So in Windows, you see:
dir directory\file.pdf
so in Python, we have to use exactly the same path with
*you know x should still an int after these two statements, because
the type hint says so. Without it:x = 3x = f(x)x could be anything.*
*...*
*If something is an int, then make it an int:x: int = 0*
i'm not arguing about it being useful or not but rather people turn to
python to hav
Steven D'Aprano wrote:
Not everything in Python uses a strict left-to-right reading order. Just
like English really.
Well, English is read left to right, but it doesn't always
mean things in the order it says them. :-)
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, Jul 3, 2018 at 10:26 PM T Berger wrote:
> I don't think I want to try a mail list. I had subscribed to the
> python-list a few weeks ago and then been forced to unsubscribe
> because of the flood of irrelevant posts.
I use Gmail. It does allow various ways of filtering emails as has
bee
Mikhail V wrote:
There is one issue that I can't write \ on the end:
r"C:\programs\util\"
But since I know it's a path and not a file, I just write without trailing \.
Indeed. There's never a need to put a backslash on the end of
a path, as long as you always use os.path functions or
equivalen
Steven D'Aprano wrote:
but the type checker should infer that if you assign None to a variable
which is declared int, you must have meant Optional[int] rather than just
int.
This seems to be equivalent to saying that *all* types are
Optional, in which case what point is there in having Option
Robin Becker writes:
> ...
> I don't disagree with the above. I think the issue is that the
> configure process did not say anything about this. If ctypes is
> required and cannot be built then ./configure .. should probably
> tell me; if that's not possible then the make step should do so and
I've a dataframe all_paths with say 9000 rows, and i've another dataframe Legs
with 4000 rows. I need to filter all_paths dataframe based on a column called
'itineraries' which contains a list of strings, for each row in Legs. So,
basically its like getting a dataframe that is subset of all_path
On Wed, 04 Jul 2018 19:57:12 +0100, Bart wrote:
> On 04/07/2018 16:31, Steven D'Aprano wrote:
>> On Wed, 04 Jul 2018 13:48:26 +0100, Bart wrote:
>
>> Of course the type (whether inferred or annotated) applies for the
>> entire scope of that variable.
>>
>>
> In that case I don't understand what
On Wed, 04 Jul 2018 16:23:31 -0600, Ian Kelly wrote:
[...]
>> >> group = match.group(1) if match := re.match(data) else None
>>
>> There's no stopping some people from making poor naming choices. Surely
>> the standard name for match objects is "mo", not match?
>
> I was referring to the variable
> On Jul 4, 2018, at 5:53 PM, John Ladasky wrote:
>
> I'm a regular Matplotlib user. Normally, I graph functions. I just
> attempted to graph an icosahedral surface using the plot_trisurf() methods of
> Matplotlib's Axes3D. I have discovered that Matplotlib is basically
> hard-wired for gra
Adrian Taylor writes:
> I have just discovered Python […]
Welcome. The Python community has a starter page for beginners at
https://wiki.python.org/moin/BeginnersGuide>.
> However my next big step is to be able to use this python feature
> within a website.
Good. Be aware, though, that running
G'day All,
I have just discovered Python and thanks to a script by Ethan I can read a
foxpro database and change the required values.
However my next big step is to be able to use this python feature within a
website.
Basically I want to be able to click on a button and call the script.
This wo
On Wed, Jul 4, 2018 at 1:11 AM Steven D'Aprano
wrote:
>
> On Tue, 03 Jul 2018 23:05:01 -0600, Ian Kelly wrote:
>
> > Now that I've actually read the PEP (sorry, I just assumed it would
> > never fly), I have a couple of (tongue-in-cheek) observations about it:
> >
> >> group = re.match(data).group
ChrisA wrote:
> Mikhail V wrote:
>> Yes, and the answer was a week ago: just put "r" before the string.
>> r"C:\programs\util"
>>
>> And it worked till now. So why should I replace backslashes with
>> forward slashes?
>> There is one issue that I can't write \ on the end:
>> r"C:\programs\util\"
I'm a regular Matplotlib user. Normally, I graph functions. I just attempted
to graph an icosahedral surface using the plot_trisurf() methods of
Matplotlib's Axes3D. I have discovered that Matplotlib is basically hard-wired
for graphing functions, and therefore will not work for general-purpos
On 04/07/18 21:30, Chris Angelico wrote:
On Thu, Jul 5, 2018 at 6:25 AM, Mikhail V wrote:
Joe Pfeiffer wrote:
On Windows a path is e.g.:
C:\programs\util\
So what is reasonable about using forward slashes?
It happens to me that I need to copy-paste real paths like 100 times
a day into scripts
Has anyone tried to optimize shared libraries (for loadable python modules)
using gcc with profile guided optimization? Is it possible?
Thanks,
Neal
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, Jul 5, 2018 at 6:25 AM, Mikhail V wrote:
> Joe Pfeiffer wrote:
>
>>> On Windows a path is e.g.:
>>> C:\programs\util\
>>> So what is reasonable about using forward slashes?
>>> It happens to me that I need to copy-paste real paths like 100 times
>>> a day into scripts - do you propose to c
Joe Pfeiffer wrote:
>> On Windows a path is e.g.:
>> C:\programs\util\
>> So what is reasonable about using forward slashes?
>> It happens to me that I need to copy-paste real paths like 100 times
>> a day into scripts - do you propose to convert to forward slashes each time?
> That's what starte
On Wed, Jul 4, 2018, 9:36 AM Steven D'Aprano <
steve+comp.lang.pyt...@pearwood.info> wrote:
> On Wed, 04 Jul 2018 13:48:26 +0100, Bart wrote:
> >> A better example would be:
> >>
> >> x: int = None
> >>
> >> which ought to be read as "x is an int, or None, and it's currently
> >> None".
> >
>
On 04/07/2018 16:31, Steven D'Aprano wrote:
On Wed, 04 Jul 2018 13:48:26 +0100, Bart wrote:
Of course the type (whether inferred or annotated) applies for the entire
scope of that variable.
In that case I don't understand what you're complaining about. You say
that hinting is not needed he
On 04/07/18 17:30, muhammet bozkurt wrote:
> When i try to install sklearn, i encounter a problem which is “No module
> named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from
> distutils” and ai don’t know how to deal with it therafore i need some help.
> Could you help me?(by the
On 02/07/2018 18:51, T Berger wrote:
On Monday, July 2, 2018 at 1:22:59 PM UTC-4, T Berger wrote:
On Saturday, June 30, 2018 at 6:02:06 PM UTC-4, T Berger wrote:
On Friday, June 29, 2018 at 7:00:15 PM UTC-4, Cameron Simpson wrote:
The key point here from Jim is "simultaneously". Are you prope
When i try to install sklearn, i encounter a problem which is “No module named
'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils” and
ai don’t know how to deal with it therafore i need some help. Could you help
me?(by the way i installed numpy)
I put all error massage
On Wed, 04 Jul 2018 13:48:26 +0100, Bart wrote:
> Presumably one type hint applies for the whole scope of the variable,
> not just the one assignment.
You know how in C you can write
int x = 1; # the type applies for just this one assignment
x = 2.5;# perfectly legal, right?
Wai
Mikhail V writes:
> [Steven D'Aprano]
>
>> (The same applies to Unix/Linux systems too, of course.) But while you're
>> using Python to manipulate files, you should use Python rules, and that
>> is "always use forward slashes".
>>
>> Is that reasonable?
>>
>> Under what circumstances would a user
On 04/07/18 05:55, Jim Lee wrote:
On 07/03/18 21:25, Ben Finney wrote:
Jim Lee writes:
On 07/03/18 19:58, Ben Finney via Python-list wrote:
Jim Lee writes:
If you were to say John had 2 apples, Jane had 4 apples, and Joe had
an indefinite number of apples, how many numbers are we talkin
On 04/07/2018 06:52, Steven D'Aprano wrote:
On Sun, 01 Jul 2018 17:22:43 -0500, Tim Daneliuk wrote:
x: int = 3
[...]
This strikes me as syntactic noise. Python is dynamically typed and
will remain so. Why clutter the language - even optionally - with stuff
like this?
There's no need to d
On 04/07/2018 05:59, dieter wrote:
..
"libffi" contains the so called "foreign function interface"
(an interface that allows code written in one language to call
code written in another language). Likely, "ctypes" depends
on it.
Since some time, "ctypes" is part of Python's standard lib
On Wed, Jul 4, 2018 at 7:31 PM, Gregory Ewing
wrote:
> Ian Kelly wrote:
>>
>> I can't now write all my statements as:
>>
>> f(f := lambda f: do_something())
>
>
> No, but you should be able to do
>
>(f := lambda f: do_something())(f)
>
> although since you're binding f in a scope that can be s
Ian Kelly wrote:
I can't now write all my statements as:
f(f := lambda f: do_something())
No, but you should be able to do
(f := lambda f: do_something())(f)
although since you're binding f in a scope that can be seen
by the lambda, there's probably not much point in passing it,
you could
Ben Finney wrote:
Abdur-Rahmaan Janhangeer writes:
[…]
*cut at this point*
Ooh, I like that last step! How do we make that happen on demand?
You mention that Nazis ate fish.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
Grant Edwards wrote:
On 2018-07-03, Dan Stromberg wrote:
I used to write useful programs that ran in 256 bytes of RAM.
Me too.
The hex monitor I wrote for the keypad/display on my first
computer fitted in 256 bytes. Which was important, seeing
as the whole machine only had 1.5k.
--
Greg
-
Another way on unix that doesn't use signals:
import select, sys
print("Enter something: ", end = "")
sys.stdout.flush()
fds = select.select((0,), (), (), 5)
if fds[0] == [0]:
data = sys.stdin.readline()
print("You entered:", data)
else:
print("Too late!")
--
Greg
--
https://mail.py
On Wed, Jul 4, 2018 at 3:37 PM, Steven D'Aprano
wrote:
> On Wed, 04 Jul 2018 12:31:16 +1000, Chris Angelico wrote:
>
> [...]
>>> Ah, I see we're not going to leave it alone. In that case,
>>> "indefinite"
>>> is a "number", in that it was a quantity you cited along with the other
>>> two. If you'
On Tue, 03 Jul 2018 23:05:01 -0600, Ian Kelly wrote:
> Now that I've actually read the PEP (sorry, I just assumed it would
> never fly), I have a couple of (tongue-in-cheek) observations about it:
>
>> group = re.match(data).group(1) if re.match(data) else None
>
> The only problem with this exa
37 matches
Mail list logo