x27;:29.15,'lon':-15.667,'place':'ESTOC'}
return estoc
Why is it that the first call works fine, but the second tells me
'global name 'self' is not defined'? What I want is to have the
dictionary 'estoc' available in my calling scr
the new
one, and no problem. I don't know why it worked with one and not the
other when they are identical, but I have what I want now.
Thanks for your replies.
-Evan
--
http://mail.python.org/mailman/listinfo/python-list
[97]: %run call
8
---
exceptions.NameError Traceback (most
recent call last)
/home/evan/python/mapping/call.py
2
3 sum=canp.addme(3,5)
4 print sum
> 5 estoc=canp.estocStn()
6 pri
#x27;t found an explanation for it so far?
Also, as I understand , the .pyc files should be updated every time you
change and run the equivalent .py file?
Thanks, Evan
--
http://mail.python.org/mailman/listinfo/python-list
so I want to remove
one of each pair.
Many thanks, Evan
--
http://mail.python.org/mailman/listinfo/python-list
That's great, thank you, the caveats are no matter!
-Evan
--
http://mail.python.org/mailman/listinfo/python-list
= [3,5,7,2,4,7,8,24]
In [691]: ind[0]Out[691]: 3
In [692]: ind[-1:] Out[692]: [24]
In [693]: ??
How do I pull out multiple indices as in matlab?
Thanks, Evan
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for all the replies, it's much clearer now.
-Evan
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I'm a new hire with python program, I want to write script for
changing/moniter/filter the network packet, it seems there are two
extensions in python, pycap and pylibcap.
I was confused, what is the difference about pycap and pylibpcap?
Differnet user interface only?
Thanks,
--
http://mai
A web-link would do, becuase of I don't know how many parameters I
need to use in function about pylibpcap.
Or what kind of parameters I need to use/transfer?
I'm very gratefully if you can help on this question.
Thanks,
--
http://mail.python.org/mailman/listinfo/python-list
Hi, guys ~~
How can i work on VIM for python code? I use cscope plugin on VIM for
C code before, it helps me to different function and search C
variable where it is defined.
I'm now starting to learn python, and I'd like to know how works on
VIM.
I saw that the VIM is support python such as sy
(["goest",'-f \'\"%s %s\" name addr\' ',
'file_name'], shell=True)
It always failed.
I also try like so:
p = subprocess.Popen(["goest","-f '\"%s %s\" name addr' ",
'file_name'], shell=True)
It
(["goest",'-f \'\"%s %s\" name addr\' ',
'file_name'], shell=True)
It always failed.
I also try like so:
p = subprocess.Popen(["goest","-f '\"%s %s\" name addr' ",
'file_name'], shell=True)
It
.bin','w+b')
>>> e.write(socket.ntohs(struct.unpack('H',st[:2])[0]))
Traceback (most recent call last):
File "", line 1, in
TypeError: argument 1 must be string or read-only buffer, not int
+
It failed due to the parameter is 'int', not 'str' in write function.
but how can i do that?
Thanks,
Evan
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 5, 9:50 pm, Philipp Hagemeister wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA512
>
> Evan wrote:
> >>> inp='\x04\x00'
> >>> out = socket.ntohs(struct.unpack('H',inp[:2])[0]))
> > Traceback (most recent call last)
ckets to a pcap file? such as *.pcap.
The problem is I do not want to send these packets, I just want to
generate some special packets and then store it in a pcap file
(libpcap format), so other guys can check it by tcpdump or wireshark.
Thanks,
Evan
--
http://mail.python.org/mailman/listinfo/p
On Apr 2, 6:59 am, "Rhodri James" wrote:
> On Wed, 01 Apr 2009 14:53:34 +0100, Evan wrote:
>
> > Hello -
>
> > I'm trying to decode thepcapfilewhich is packet capture by tcpdump
> > or wireshark. Is there a python module that I can use it for this
>
Hello -
I'm new with Python, I try to do a mail problem, the code likes below:
+
import smtplib
import mimetypes
from email.Encoders import encode_base64
from email.MIMEAudio import MIMEAudio
from email.MIMEBase import MIMEBase
from ema
se HTML tag "", it worked:
(1) HTML:
I use tag "" and " ", and when I reply that mail, I will
see "" tag in mail content, it is not a good option.
thanks,
Evan
--
http://mail.python.org/mailman/listinfo/python-list
HI,
When I check example of "cmd2" module (a enhancement of cmd module), I
can not understand all, for example: the character "@",
+
def options(option_list):
..
class cmd(...):
...
@opt
cool, thanks, I will check document.
--
http://mail.python.org/mailman/listinfo/python-list
Hello -
My script use a DB file which is written by XML, and the user load
this DB file (XML tree in memory), and then do some updating about
this tree, such as delete element, generate new element or move
element.
The thing is, my script is a cmd based program (based on module
"cmd"), and there
If I get rid of the XML, I have to change my script more and more, it
is not easy to do that. :( :(
Thanks,
--
http://mail.python.org/mailman/listinfo/python-list
t? which means I do not want to use Window UI (via
"control panel"), if it is possible, I can save so many time to
create various network connection when I want to do testing in the
lab.
Thanks very much.
Evan
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 15, 6:22 am, Larry Bates <[EMAIL PROTECTED]> wrote:
> Evan wrote:
> > Hello,
>
> > one of my PC is window system, and in "control panel ->Network
> >Connections", I can see somenetworkconnectionssuch as PPPOE or VPN
> > which I created by c
a simple problem but I do not know why...:(, could anyone help me?
MySQLdb nominally uses just the %s placeholder style, in my script, i
got error if you want to use placeholder(%s) for table name:
+
>>> str="select tID,tNote from %s wher
er a prompt, for
example, " - >> ", and then you can execute any commands what you
defined in script.
Now, in python, are there any common way(class) to finish this work?
or does anybody has a example to do that?
Thanks,
Evan
--
http://mail.python.org/mailman/listinfo/python-list
that's great, a custom shell is what I need.
Thanks all
Evan
--
http://mail.python.org/mailman/listinfo/python-list
retically this isn't necessary)
- pure compiled
I'd say these categories tend to be qualitative "I know it when I see
it" rather than hard divisions.
Evan
>
> java has available a "runtime" environment, for those who don't want or
> need the compil
ight thing to the new-directory script, e.g. that it
works with whitespace in the arguments and that it isn't including the
equivalent to argv[0] in the script.
Evan
--
http://mail.python.org/mailman/listinfo/python-list
< is not associative and "a < b < c"
is a syntax error. (FWIW this is my favorite approach.) You may also
want to put Java in there as well, as < is effectively not commutative
in that language. (I didn't try C#.)
I've been programming in Python for a few year
On 6/30/2012 23:45, Evan Driscoll wrote:
> You may also
> want to put Java in there as well, as < is effectively not commutative
> in that language. (I didn't try C#.)
I guess you could actually put Lua and Ruby into the roughly same
category as Java too.
But things get a
On 7/1/2012 4:54, Alister wrote:
> On Sat, 30 Jun 2012 23:45:25 -0500, Evan Driscoll wrote:
>> If I had seen that in a program, I'd have assumed it was a bug.
>
> You would?
> I have only been using python for 6 - 12 months but in my past I
> programmed microcontrollers
the values of literals by passing them to a function by
reference and then modifying the value.
Evan
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
On 01/-10/-28163 01:59 PM, Alexander Blinne wrote:
5+0 is actually 4+0, because 5 == 4, so 5+0 gives 4.
5+1 is actually 4+1, which is 5, but 5 is again 4.
5+2 is 4+2 which is 6.
Now all I can think is "Hoory for new math, new-hoo-hoo math" :-)
Evan
--
http://mail.python.org/mailma
valuable
free data from freely donated time.
Leaving aside questions of relevance to the email list and the quality
of results from a self-selected survey, the PDF is linked directly from
the Google Scholar link in the original post: "[PDF] from tue.nl".
Evan
--
http://mail.
aught up in categorizing everything
into "strong" and "weak"; that's a spectrum, and where things fall is a
lot more interesting than just "here or there". Really it's even more
complex than just a linear spectrum -- Language A can be stronger than
Language B in one respect but weaker in another.
In particular, it's possible to have rather stronger typing than Python
(especially with respect to Booleans, but in some other respects as well).
Evan
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
On 08/22/2012 02:45 PM, lipska the kat wrote:
> On 22/08/12 20:03, Evan Driscoll wrote:
>> Second, this concept isn't *so* unfamiliar to you. If I give you the
>> following Java code:
>>
>>void foo(Object o) { ... }
>>
> looking at this method decla
ill call their
bindings "variables", e.g. Scheme.
Evan
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
le Java programming so can't point to any concrete cases if
you would (reasonably) reject the example of java.util.collections being
used in their non-generic form.)
Anyway, the point wasn't that 'foo(Object o)' is common, just that
you've probably seen something whi
ing "Python doesn't have variables" is, IMO, at least as silly as
what Jussi said. To me, dancing around the issue just leads to more
confusing terminology and makes things worse.
(And this is reinforced by the fact that neither I nor Google seems to
have really seen "Python doesn't have classes" ever used, when that
statement is at least as true as "Python doesn't have variables".)
Evan
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
On 08/23/2012 12:56 PM, Steven D'Aprano wrote:
> On Thu, 23 Aug 2012 12:17:03 -0500, Evan Driscoll wrote:
>
>> I definitely *wouldn't* say "Python
>> classes aren't really classes" -- even though (I assert) Python classes
>> are *far* further
t this way. If C removed the & operator -- and thus you couldn't
tell what address a variable (or "variable instance", if you prefer) was
at -- would "int x;" cease to be a variable?
Evan
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
y think of variables as naming data, and addresses
mostly come into play when thinking about points-to and aliasing
information at a more abstract level, much the same as I do in Python.
Evan
--
http://mail.python.org/mailman/listinfo/python-list
ive ranges would wind up in memory.)
Third, and more wackily, you could technically create a C implementation
that works like Python, where it stores variables (whose addresses
aren't taken) in a dict keyed by name, and generates code that on a
variable access looks up the value by accessing that dict using the name
of the variable.
Evan
--
http://mail.python.org/mailman/listinfo/python-list
. (I didn't actually look.)
> You can probably implement them, but they're not going to be very
> efficient. (And never "remove" an element from the linked-list
> implementation because Python would shift all the other elements, hence
> your "links&q
ssive quantifier which Python doesn't support. But that
still doesn't explain why my expectation isn't what happened.)
In what way is that an unreasonable question?
Evan
--
http://mail.python.org/mailman/listinfo/python-list
a lie in most real-world regex implementations (in
part because they're not actually regular expressions) and repeated
quantifiers cause problems with the parsing techniques that actually get
used?
Evan
--
http://mail.python.org/mailman/listinfo/python-list
On 10/05/2012 10:27 AM, Evan Driscoll wrote:
On 10/05/2012 04:23 AM, Duncan Booth wrote:
A regular expression element may be followed by a quantifier.
Quantifiers are '*', '+', '?', '{n}', '{n,m}' (and lazy quantifiers
'*?', '+?&
#x27;t do it for speed, I did it because it seemed like a
reasonable way to get access to those APIs. (ctypes was insufficient for
my needs.)
So wrapping a C++ class using Cython also seems pretty natural to me,
assuming that Cython does OK with C++ and isn't restricted to C (which I
have no idea ab
se; for mine, I'd say I'm
trying to keep subexpressions together in space (both horizontal and
vertical). I'm not sure that "drawing boxes" is exactly the right thing
to say what I'm doing, but I think it at least serves to illustrate my
point in this case.
Evan
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
Oh, and a little more information:
The log.txt file I create has the message that it's "about to execlp",
and the exec() *does* actually happen -- the IOError is raised after the
child process quits.
Evan
On 10/23/2012 09:59 PM, Evan Driscoll wrote:
I have the fo
s I've mostly only worked with 2.)
I'm not 100% sure how this will come through, so I've also put it at
http://pastebin.com/60wjXSF3.
Evan
import sys
import pty
import os
def get_text(filename):
try:
( child_pid, fd ) = pty.fork()# OK
except OSError as e:
rious if anyone know why it worked in 2 though.
Evan
On 10/23/2012 10:03 PM, Evan Driscoll wrote:
Oh, and a little more information:
The log.txt file I create has the message that it's "about to execlp",
and the exec() *does* actually happen -- the IOError is raised after
the c
? I don't think I like 'from' on a couple counts,
but there's probably some word that fits.
Evan
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
le in one rather widely-used one.
If you are PerHaPs talking about the language I think you are, my
favorite fact about that is I'm that I think a while back I saw a bug
entry about something like that and they weren't sure how or even if it
should be fixed.
Evan
--
http://mail.python.org/mailman/listinfo/python-list
rth the hassle
and have done the __getattribute__/__setattribute__ thing the couple of
times I wanted immutability.
Evan
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
n the install
directory (which will just be overwritten).
Evan
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
s a noun, not a
verb. What does it do? Tell you if its parameters are keystrokes?
(gen_keystrokes is fine, though personally I'd probably stick with
generate_keystrokes of the two.)
Evan
--
http://mail.python.org/mailman/listinfo/python-list
cute accent.)
So far the discussion has been on single Unicode code points which
appear as a double-wide glyph (I did not know about those!); depending
on how you want to look at it, combining characters result in sequences
of Unicode code points which result in a single glyph, or combining
characters are zero-width code points.
Evan
--
http://mail.python.org/mailman/listinfo/python-list
install to a prefix
that doesn't exist, says "you want me to MAKE DIRECTORIES?! what are
you, some kind of slave driver?!". Admittedly that second reason is not
so rational and very occasionally putting up with that in exchange for
development mode is plenty worth it, but being a
e
second level with tabs (consistently), indent from the second to third
level with spaces (consistently), and indent from the third to fourth
level with tabs (consistently), it should not complain. Or perhaps I
should say "it should complain that you're a bad person and should feel
ba
record and anyone looking for other posts, I'd guess
said discussion was on Python-dev. I don't look at even remotely
everything on python-list (there's just too much), but I do skim most
subject lines and I haven't noticed any discussion on it before now.)
Evan
signature.a
On 12/17/2012 01:50 PM, Oscar Benjamin wrote:
> On 17 December 2012 18:40, Evan Driscoll wrote:
>> On 12/17/2012 09:52 AM, Oscar Benjamin wrote:
>>> https://github.com/benhoyt/betterwalk
>>
>> This is very useful to know about; thanks.
>>
>> I actually
it(l2[0], ", ")
Um, that doesn't copy the list:
>>> l = ["C100, C117", "X7R ..."]
>>> l2 = l
>>> import string
>>> l2[0] = string.split(l2[0], ", ")
>>> l
[['C100', 'C117'], 'X7R ...
t about the best
domain name ever) and it says it's down too.
Evan
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
climbing is very different from why I
continued it. And I feel that the same could be said of programming.
Just because you don't enjoy parts of programming when you're starting
out doesn't mean that you're a lost cause by ANY means.
Evan
--
http://mail.python.org/mailman/listinfo/python-list
will
set data again, while the lower one will not.
So if what you mean is "are they equivalent no matter what legal Python
code you put in the ...", no, they aren't.
Evan
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
off, I'd hate to see what you do when you learn that Python accepts
loops like 'while x' where the condition evaluates to true if x is a
non-zero integer and false if x is 0.
All that said, I like the 'while "stuff to do"' idea.
Evan
--
http://mail.python.org/mailman/listinfo/python-list
On 1/23/2012 23:57, Rick Johnson wrote:
> Of
> course, "used to" and "supposed to" will require people to rethink
> there lazy and slothful ways.
I'll go repent in the corner, over their.
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
I would just like to make a strong plea that you make it possible to
install in places other than /usr. Bascially, 'python setup.py install
--prefix /some/alternative/place' should work.
Evan
On 01/25/2012 11:26 AM, bvdp wrote:
I'm having a disagreement with a buddy on the
: "About as good of an idea as no longer
calling PCRE-alikes 'regular expressions', because they aren't." Ahhh,
got that out of my system. :-))
Evan
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
On 01/-10/-28163 01:59 PM, 8 Dihedral wrote:
If you're working in C++ and overload your operators so that 'a +='
and 'a = + b' have different observable behaviors (besides perhaps
time), then either your implementation is buggy or your design is very
bad-mannered
which is why it's not already provided.
Does anyone know why Python doesn't already come with a frozendict, or
why there seem to only be a couple attempts to write one?
Evan
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
uiltin, per se. I know how to spell
'import'. :-)
Evan
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
d that takes a bunch of functions. I didn't
know about the ABTs in 'collections' though, so that helps a bit.
However, I'd still prefer something that guaranteed immutability better
than that. I might just be fighting the language too much at that point
though...
Evan
mporary list, which is why this
idiom would even fit in pretty well in Scheme.
Evan
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
ialog for a
"extract .tar.gz files in one go" setting.)
Evan
--
http://mail.python.org/mailman/listinfo/python-list
rk
label .A4
# do something
if : goto .A1
label .A5
# something more
if : goto .A2
Clearly the best solution of all.
(Note: do not actually do this.)
Evan
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
27;stack' while #1/2
won't, but even that isn't true of course. For instance, CLOS will let
you write '(push stack item)' (which is the direct analogy in that
language to #1) and do even more powerful dynamic dispatch than what a
language like C++, Java, or Python will let you
ever
unpickle data received from an untrusted or unauthenticated
source.
- http://docs.python.org/library/pickle.html
Evan
--
http://mail.python.org/mailman/listinfo/python-list
not a mapping of strings to
internal representation is silly, because there is. However, there's
nothing you can say about that mapping.
Evan
--
http://mail.python.org/mailman/listinfo/python-list
On 3/28/2012 14:43, Ross Ridge wrote:
> Evan Driscoll wrote:
>> So yes, you can say that pretending there's not a mapping of strings to
>> internal representation is silly, because there is. However, there's
>> nothing you can say about that mapping.
>
>
On 01/-10/-28163 01:59 PM, Ross Ridge wrote:
Evan Driscoll wrote:
People like you -- who write to assumptions which are not even remotely
guaranteed by the spec -- are part of the reason software sucks.
...
This email is a bit harsher than it deserves -- but I feel not by much.
I don'
t;eval from *this dictionary* if
you want, which solves Steven D'Aprano's objection that your
suggestion is too weak.
4. Languages changes should be viewed suspiciously in general.
Evan
--
http://mail.python.org/mailman/listinfo/python-list
oblems with all the other suggestions.
Evan
--
http://mail.python.org/mailman/listinfo/python-list
unorderable:
>>> 0 < True
True
I think it also has bearing on the ' vs " issue. For instance, I totally
think it's not at all surprising that one can be accepted and the other
not, or that they behave differently. (Though I *do* find it surprising
in the c
eally work with Python because more stuff is
immutable, and Python's behavior is arguably the least-bad solution, but
it WAS definitely surprising for me (and others!) when I learned about
Python's behavior.
In particular, the translation of 'a+=b' to 'temp = a + b; a = te
On 4/5/2012 17:11, Evan Driscoll wrote:
> In particular, the translation of 'a+=b' to 'temp = a + b; a = temp' is
> *not* a very natural one to me.
To expand on this point slightly, because of common C++ idioms guided by
efficiency, I would be much more likely to thi
rehension or itertools expression or something. At
this point I'm asking mostly out of curiosity and less for some code to
actually use, so either Python 2 or 3 is acceptable (but I'm writing in
3 at the moment).
Evan
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
On 4/13/2012 22:33, Evan Driscoll wrote:
> d = {}
> def appender(e):
> d.get(f(e), []).append(e)
> map(appender, l)
Just in case it isn't clear, the above has at least two problems and
won't even come close to working. :-)
Though I might as well ask an
On 4/13/2012 22:42, Evan Driscoll wrote:
> Though I might as well ask another question... if I have a dict with
> values which are lists, what's a good way to say "append x to the list
> at key k, creating a list if it's not there"? dict.setdefault seems
> potent
r dismissed it.)
Personally though, I'd probably say an iterator *to* Foos.
Evan
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
vior
(in the technical C++ sense of "your program is now allowed to set your
cat on fire").
Evan
--
http://mail.python.org/mailman/listinfo/python-list
llustrate, in a different manner that doesn't
use this "undefined" thing:
def foo():
print "Inside the first version of foo"
def call_foo():
foo()
call_foo()
def foo():
print "Inside the second version of foo"
call_foo()
This prints:
Inside t
I've had much success doing round trips through the lxml.html parser.
https://lxml.de/lxmlhtml.html
I ditched bs for lxml long ago and never regretted it.
If you find that you have a bunch of invalid html that lxml inadvertently
"fixes", I would recommend adding a stutter-step to your project: p
On Thu, Feb 11, 2021 at 1:49 PM dn via Python-list
wrote:
> When I first met it, one of the concepts I found difficult to 'wrap my
> head around' was the idea that "open software" allowed folk to fork the
> original work and 'do their own thing'. My thinking was (probably)
> "surely, the original
I started to send this to python-ideas, but I'm having second thoughts.
Does tihs have merit?
---
I stumble on this a lot, and I see it in many python libraries:
def f(*args, **kwargs):
...
f(*[list comprehension])
f(**mydict)
It always seems a shame to carefully build up an object in order
Received?
On Sun, Sep 16, 2018 at 3:39 PM Buck Evan wrote:
> I started to send this to python-ideas, but I'm having second thoughts.
> Does tihs have merit?
>
> ---
> I stumble on this a lot, and I see it in many python libraries:
>
> def f(*args, **kwargs):
> .
I frequently use binary as bool placeholders and find myself filtering lists
based on those bools, this seems to have a similar semantic meaning as the bit
wise ^ or __xor__ operator and could add syntactic sugar to the base list class.
Use Case:
Controlling a stepper at half-step has the follo
1 - 100 of 261 matches
Mail list logo