On Sat, 21 Oct 2023 11:32:03 -0400
Larry Martell wrote:
> On Sat, Oct 21, 2023 at 9:49 AM Johannes Findeisen
> wrote:
> >
> > On Sat, 21 Oct 2023 09:01:18 -0400
> > Larry Martell via Python-list wrote:
> >
> > > I have a python script, and from that
c.kill() etc.
Is this the answer you are looking for?
Detailed docs: https://docs.python.org/3/library/subprocess.html
Regards,
Johannes
--
https://mail.python.org/mailman/listinfo/python-list
.strftime('%y.%m.%d')} {'<-' * (x['d'] // 4)}"
q = magic_function(s, x = x)
and have "q" then be
'01100 ->->->-> 00.05.11 <-<-<-'
I believe the closest solution would be using a templating mechanism
(like Mako), but that has slightly different syntax and doesn't do
string formatting as nice as f-strings do. f-strings really are the
perfect syntax for what I want to do.
Cheers,
Johannes
--
https://mail.python.org/mailman/listinfo/python-list
orable how you're trying to frame yourself as the victim.
I'll be here if you need a hug, buddy.
But you're not going to change the laws of physics.
Yeah we'll have to disagree about the fact that it's the "laws of
physics" preventing a specific implementation of a Python function.
Cheers,
Johannes
--
https://mail.python.org/mailman/listinfo/python-list
Am 27.01.23 um 23:10 schrieb Christian Gollwitzer:
Am 27.01.23 um 21:43 schrieb Johannes Bauer:
I don't understand why you fully ignore literally the FIRST example I
gave in my original post and angrily claim that you solution works
when it does not:
x = { "y": "z"
ords, if there were a magic function:
evalfstring(s, x = x)
That would have been the ideal answer. There does not seem to be one,
however. So I'm back to silly workarounds.
Cheers,
Johannes
--
https://mail.python.org/mailman/listinfo/python-list
string, as long as it could successfully evaluate using the f-string
grammar.
Stop with the rock management already and explain (briefly if possible)
what you are up to.
I have a string. I want to evaluate it as if it were an f-string. I.e.,
there *are* obviously restrictions that apply (namely,
can't, and that's a horrible idea".
"You can't" would have been sufficient. Pity. Your judgement is
unnecessary and, frankly, uncalled for as well. Multiple instances you
claim that you have no idea what I am doing so how would you even begin
to judge a solution
Am 23.01.23 um 17:43 schrieb Stefan Ram:
Johannes Bauer writes:
x = { "y": "z" }
s = "-> {x['y']}"
print(s.format(x = x))
x = { "y": "z" }
def s( x ): return '-> ' + x[ 'y' ]
print( s( x = x ))
Exce
fy
File "", line 1
f"""""""""
^
SyntaxError: unterminated triple-quoted string literal (detected at line 1)
This is literally the version I described myself, except using triple
quotes. It only modifies the underlying problem, but doesn't solve it.
Cheers,
Johannes
--
https://mail.python.org/mailman/listinfo/python-list
as code, ask for
what you ACTUALLY need, and we can help?
I want to render data from a template using an easily understandable
syntax (like an f-string), ideally using native Python. I want the
template to make use of Python code constructs AND formatting (e.g.
{x['time']['runtime']['seconds'] // 60:02d}).
Cheers,
Johannes
--
https://mail.python.org/mailman/listinfo/python-list
gns or ':' or '{'
included inside the expression as a literal).
3. Somehow compile the bytecode representing an actual f-string
expression, then execute it. Sounds like a royal pain in the butt, have
not tried it.
All solutions are extremely undesirable and come with heavy drawbacks.
Is there any standard solution (Py3.10+) that does what I would?
Anything I'm missing?
Thanks,
Johannes
--
https://mail.python.org/mailman/listinfo/python-list
Hi list,
I've just encounted something that I found extremely unintuitive and
would like your feedback. This bit me *hard*, causing me to question my
sanity for a moment. Consider this minimal example code (Py 3.10.4 on
Linux x64):
class Msg():
def hascode(self, value):
p
Aha!
conds = [ lambda msg, z = z: msg.hascode(z) for z in ("foo", "bar") ]
Is what I was looking for to explicitly use the value of z. What a
caveat, didn't see that coming.
Learning something new every day.
Cheers,
Joe
Am 29.06.22 um 11:50 schrieb Johannes Bauer:
Am 06.12.21 um 13:56 schrieb Martin Di Paola:
> Hi!, in short your code should work.
>
> I think that the join-joined problem is just an interpretation problem.
>
> In pseudo code the background_thread function does:
>
> def background_thread()
> # bla
> print("join?")
> # bla
> print("j
of Python, the
started Thread is still running in the background:
$ ps ax | grep minimal
370167 pts/0S 0:00 python3 minimal.py
370175 pts/2 S+ 0:00 grep minimal
Can someone figure out what is going on there?
Best,
Johannes
--
https://mail.python.org/mailman/listinfo/python-list
not match format '%Y-%m-%d'
>>> d.strptime("0001-01-01", "%Y-%m-%d")
datetime.datetime(1, 1, 1, 0, 0)
I.e. for years that are not 4 digits longs, strftime() produces no
leading zeros for the '%Y' replacement, but strptime() requires leading
zeros.
Is this expected behavior? Shouldn't %Y be consistent across both?
All the best,
Johannes
--
https://mail.python.org/mailman/listinfo/python-list
way of discovering a peer has disconnected and
exiting cleanly?
Thanks in advance,
All the best,
Johannes
--
"Performance ist nicht das Problem, es läuft ja nachher beides auf der
selben Hardware." -- Hans-Peter Diettrich in d.s.e.
--
https://mail.python.org/mailman/listinfo/python-list
On 03.09.19 05:28, rmli...@riseup.net wrote:
> But I just don't understand how to get
> and pass information back to the gpg command line prompts at all, not to
> mention automating the process.
The manpage describes how to enable the machine-parsable interface,
which is exactly what you want. Th
Hi list,
I'm looking for ideas as to a pretty, Pythonic solution for a specific
problem that I am solving over and over but where I'm never happy about
the solution in the end. It always works, but never is pretty. So see
this as an open-ended brainstorming question.
Here's the task: There's a cu
On 30.03.2018 16:46, Ben Bacarisse wrote:
>> Yup, but why? I mean, at the point of definition of "z", the only
>> definition of "collections" that would be visible to the code would be
>> the globally imported module, would it not? How can the code know of the
>> local declaration that only comes
On 30.03.2018 13:25, Johannes Bauer wrote:
>> This mention of collections refers to ...
>>
>>> }
>>> for (_, collections) in z.items():
>>
>> ... this local variable.
>
> Yup, but why? I mean, at the point of definition of
On 30.03.2018 13:13, Ben Bacarisse wrote:
>> import collections
>>
>> class Test(object):
>> def __init__(self):
>> z = {
>> "y": collections.defaultdict(list),
>
> This mention of collections refers to ...
>
>> }
>> for (_, collec
Hey group,
I stumbled about something that I cannot quite explain while doing some
stupid naming of variables in my code, in particular using "collections"
as an identifier. However, what results is strange. I've created a
minimal example. Consider this:
import collections
class Test(object):
On 23.03.2018 14:01, ast wrote:
> It is not beautiful and not very readable. It is better to
> have a fixed number of digits per line (eg 50)
Oh yes, because clearly a 400-digit number becomes VERY beautiful and
readable once you add line breaks to it.
Cheers,
Joe
--
>> Wo hattest Du das Beben
On Wed, 21 Feb 2018 00:11:24 +0100
Johannes Findeisen wrote:
> On Tue, 20 Feb 2018 23:12:23 +1100
> Chris Angelico wrote:
>
> > On Mon, Feb 19, 2018 at 3:57 AM, Johannes Findeisen
> > wrote:
> > > On Sun, 18 Feb 2018 20:57:02 +1100
> > > Chris Angel
On Tue, 20 Feb 2018 23:12:23 +1100
Chris Angelico wrote:
> On Mon, Feb 19, 2018 at 3:57 AM, Johannes Findeisen wrote:
> > On Sun, 18 Feb 2018 20:57:02 +1100
> > Chris Angelico wrote:
> >
> >> Does anyone have experience with running Python scripts on Android
bind your Python
code to some buttons and execute it when clicking. Not very useful when
you need the output but very useful when you have some tasks you wanna
execute with just one click... ;)
Johannes
[0] http://kivy.org
--
https://mail.python.org/mailman/listinfo/python-list
id3/files/arm-linux-androideabi/bin/python
but I can not access it in a normal terminal without being user "root"
but it is usable from within the terminal included in the Pydroid App.
I do only execute some basic Python stuff for fun and learning when
traveling but that should work
By the way, here's my work in progress:
https://gist.github.com/johndoe31415/7e432b4f47f0030f0903dbd6a401e5dc
I really really love the look & feel, but am unsure if there's a better
way for this?
Cheers,
Joe
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich
Hi group,
so I'm having a problem that I'd like to solve *nicely*. I know plenty
of ways to solve it, but am curious if there's a solution that allows me
to write the solution in a way that is most comfortable for the user.
I'm trying to map registers of a processor. So assume you have a n bit
ad
atch?
I thought it'd only match once a "start_string" was encountered (which
it isn't).
Since I'm the parsing noob, I don't think TPG (which is FREAKING
AMAZING, seriously!) is at fault but rather my understanding of TPG. Can
someone help me with this?
I've uploaded
y identifying and using character sets.
Everything about the thought makes me shiver.
Cheers,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Die Geheim-Vorhersage.
re is no
performance impact.
Cheers,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Die Geheim-Vorhersage.
- Karl Kaos über Rüdiger Thomas in dsa
--
https://mai
On 18.06.2016 01:12, Lawrence D’Oliveiro wrote:
> I’m not sure how you can write “30” with one digit...
3e1 has one significant digit.
Cheers,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genia
.. what?
This here:
pytz.timezone("Europe/Berlin").localize(datetime.datetime(2016,1,1))
Gives me the expected result of:
datetime.datetime(2016, 1, 1, 0, 0, tzinfo=)
Can someone explain what's going on here and why I end up with the weird
"00:53" timezone? Is this
be free if any process would
sbrk(). My guess is that you only looked at the "free" number going down
and concluded your program is eating your RAM. Which it wasn't.
Cheers
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah,
't envy you
> > if you should need to subclass something to change its behavior, but
> > it is effective.
> >
> > --
> > Zach
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> >
>
> That page 404s for me
SourceForge seems to have problems at all... The Homepage is down too.
Johannes
--
https://mail.python.org/mailman/listinfo/python-list
believe, You should ask the Pycharm People about this.
Python is not Pycharm... :|
Johannes
--
https://mail.python.org/mailman/listinfo/python-list
e-go. Your argumentation makes therefore no sense
in this context.
Cheers,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Die Geheim-Vorhersage.
- Karl Kaos über
the tracebacks really
are unintuitive.
Unless I missed something, this seems like a nice feature.
Cheers,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Die Geheim
general or what
could cause the described issue in particular, I'd really be grateful.
Thanks,
Best regards,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen:
the interrupt
configuration myself (this works through the /proc filesystem on the Pi).
Hope this helps,
Cheers,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Di
x27;t even respond
> to this post of yours, but I feel like something has to be said).
I'll follow your advice and thank you for your honest words.
Cheers,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und
suspect that either the OPs program is at fault or the OP's setup
(name resolution or some other weird stuff going on). But instead of
tackling this problem systematically, like a Software Engineer would
(Wireshark, debugger, profiler) he just blames other people's software.
This, in my hum
should take a course
in Software Engineering. You wouldn't otherwise ask embarassingly stupid
questions over and over and over again. Really eats away at your
seniority if you ask me.
Cheers,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht ö
s?
Namely, circle the error, reproduce it reliably. Change your machine,
network setup and change between your software versions. Create a
minimal example that demonstrate the issue. Then, should you find one,
blame bottle. Not sooner, very wise Senior Software Engineer, not sooner.
Cheers,
Joha
o an amateur's problem instead of
firing off a Usenet post, oh very wise Senior Software Engineer?
Cheers,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Di
On 21.08.2015 23:22, Cecil Westerhof wrote:
> Just before everything was done in a second:
Since you're on GitHub, why don't you git bisect and find out where you
screwed up instead of trying to get people to remotely debug and profile
your broken code?
Cheers,
Johannes
--
>
re
(especially against only one to identify parent certificates by crypto).
I was frustrated back then about the indecisiveness and wrote my own
wrapper around the functions I needed and was done with it.
Best regards,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
>
On 27.06.2015 12:16, Chris Angelico wrote:
> Okay, Johannes, NOW you're proving that you don't have a clue what
> you're talking about. D-K effect doesn't go away...
:-D
It does in some people. I've seen it happen, with knowledge comes
humility. Not saying Jon
and
offline solution at the cost of being comparatively expensive. The
others use symmetric transponders which have limited off-line
functionality: i.e. monotonic counters which are reset in a
cryptographically secured way by backend systems every time a
online-connection persists and which ar
On 27.06.2015 11:27, Jon Ribbens wrote:
> Johannes might have all the education in the world, but he's
> demonstrated quite comprehensively in this thread that he doesn't
> have a clue what he's talking about.
Oh, how hurtful. I might even shed a tear or two, but it
you a
thourough appreciation for the true crypto experts (i.e. people doing
theoretical cryptography).
Best regards,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Di
user to make a serious mess of stuff.) But I'm under no
> delusions. I don't say "this is secure" - all I'm saying is "this
> works in proof-of-concept".
I must admit that I haven't seen your ideas in this thread?
Best regards,
Johannes
--
>>
or bad schemes.
Rest snipped, explanation futile.
Cheers,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Die Geheim-Vorhersage.
- Karl Kaos über Rüdiger Thomas in
ing to your definition, this would be:
It's okay if the attacker can control 6 of 8 bits.
>> That people in 2015 actually defend inventing a substitution-cipher
>> "crypto"system sends literally shivers down my spine.
>
> Nobody is defending such a thing, you just h
obfuscation system that can't
be broken by laymen in a Python newsgroup and which appers to be secure.
This does not imply one bit that it is even remotely secure.
Cheers,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah,
ou're
not), since the first question people will ask will be: "Why? Why on
earth?" It's a blatantly obvious bad idea(tm).
That people in 2015 actually defend inventing a substitution-cipher
"crypto"system sends literally shivers down my spine.
Cheers,
Johannes
--
>&
On 21.06.2015 11:40, Cecil Westerhof wrote:
> Thanks. Good that I asked it. :-D
Good for you that you found someone able to enter words into a Google
query. That's a skill you might want to acquire some time in the future.
Cheers,
Johannes
--
>> Wo hattest Du das Beben
be cool to have
an alternative way of specifying a send/recv function IMHO).
Cheers,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Die Geheim-Vorhersage.
- K
m this discussion. I do not aid people who fail to
recognize their major social dysfunction. Not even when they are coding
geniuses. Which, judging from your code snippet, you clearly aren't.
Cheers,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest ni
> works in ipython, not python and which also not works with Windows).
Protip: Ditch the shitty attitude. I don't know if you're a jerk or not
but I know for sure that you sound like one. Makes it also much less
likely to get the answers you'd like.
Cheers,
Johannes
--
>
On 23.05.2015 19:05, Marko Rauhamaa wrote:
> Johannes Bauer :
>
>> I think the major flaw of the X.509 certificate PKI we have today is
>> that there's no namespacing whatsoever. This is a major problem, as
>> the Government of Untrustworthia may give out certifictes
r
google.de
But CA1 could never sign any .de domain webserver certificate. It would
only ever get more restrictive down the chain.
Sounds like it's trivial to implement, I wonder why it's not in place.
It must have some huge drawback that I can't think of right now.
Cheers,
Johannes
On 23.05.2015 14:44, Marko Rauhamaa wrote:
> Johannes Bauer :
>
>> I dislike CAs as much as the next guy. But the problem of distributing
>> trust is just not easy to solve, a TTP is a way out. Do you have an
>> alternative that does not at the same time to providing a s
olution also
opens up obvious attack surface?
Cheers,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Die Geheim-Vorhersage.
- Karl Kaos über Rüdiger Thomas in ds
nt break
Apparently it does recognize that \xa0 is a kind of space, but it thinks
it can break any space. The point of \xa0 being exactly to avoid this
kind of thing.
Any remedy or ideas?
Cheers,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffe
n all, I'd be more confused why someone would introduct
"EMPTY_LIST" in the first place and think there's some strange weird
reason behind it. Explaining the reason in the comments doesn't really
help in my opinion.
Best regards,
Johannes
--
>> Wo hattest Du das Beben
where in the code at some point in time
>>> foo = EMPTY_LIST
>>> foo.append(123)
>>> print(foo)
[123]
# Some other place in code
>>> bar = EMPTY_LIST
>>> print(bar)
[123]
Regards,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
On 18.02.2015 13:14, Chris Angelico wrote:
> On Wed, Feb 18, 2015 at 10:57 PM, Johannes Bauer wrote:
>> SQLite and Postgres are so vastly different in their setup,
>> configuration, capabilities and requirements that the original developer
>> has to have done a MAJOR error i
fort to setup and it *does* take a
significant effort to maintain. Especially in comparison with something
like SQLite that literally has no setup at all.
PostgreSQL is great. It's an incredible database and that it's free is
amazing. But in very few settings will it be a replacement for SQLite.
ar. I was quite surprised that regular lawnmowers don't support
those.
Cheers,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Die Geheim-Vorhersage
pproach to backtracking problems? If so, I'd love to hear your solutions!
Cheers,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Die Geheim-Vorhersage.
- Karl
i loved the rant about how zope would have all these features, and then some
other python framework would come on with like 1 and act like its the bomb, and
zope was like we been doing that and more for X years
those who dont study zope are doomed to repeat it!!!
is zope scoffing at drupal? bot
d-in.
>>>
>>> Now, internal audit takes exception in some cases if users are able to
>>> see the source code.
>>
>> The solution is to fix your internal audit.
>
> +1
You two have obviously never worked at a large corporation or you would
both real
Hello,
This whole world of Python language is completely new to me (never programmed
before in my life) - anyway sort of besides the point. Anyway, I’ve sort of
been learning ‘all over the place’, that is to say that ill read something do
it and then find out i should have done something else
olution to add your script to the Windows
services list.
I didn't do windows development but it seems very easy to do.
Regards,
Johannes
--
https://mail.python.org/mailman/listinfo/python-list
cores
> CPython 2.6: 0.7/4 cores
> CPython 3.3: 0.7/4 cores
CPython 3.4: 0.9/4 cores
Cheers,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Die Geheim-V
an i pars it in a webpage ?
t.pars_in_a_webpage()
Cheers,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Die Geheim-Vorhersage.
- Karl Kaos über Rüdiger Thomas in dsa
--
https://mail.python.org/mailman/listinfo/python-list
On 09.08.2014 19:22, luofeiyu wrote:
>>>> x=["x1","x3","x7","x5"]
>>>> y="x3"
>
> how can i get the ordinal number by some codes?
>
> for id ,value in enumerate(x):
> if y==value : print(id)
>
actually terminate. What
happens to it?
My guess is that normal scoping rules apply. Using my example, the generator
is referenced by 'x', so when 'x' goes out of scope, the generator is
garbage collected, even though it never completed.
Is this correct?
Frank Millm
en you also don't want refelexivity of equals, I think.
Because, obviously, not all types support comparison for equality:
#!/usr/bin/python3
class Yeah(object):
def __eq__(self, other):
raise TypeError("Booya")
Yeah() == Yeah()
You cherrypick your logic and ha
but not
when x < x -> False
If you're arguing from a mathematical/logical standpoint then if you
want the former you'll also have to want the latter.
Cheers,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neu
On 24.06.2014 03:23, Steven D'Aprano wrote:
> http://www.iflscience.com/technology/new-type-computer-capable-
> calculating-640tbs-data-one-billionth-second-could
>
> Relevance: The Machine uses *eighty times less power* for the same amount
> of computing power as conventional architectures. If t
street_address_map(info_list):
return { info.get_street_address(): info.get_zip_code()
for info in info_list }
Regards,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich un
27;s even a GM company memo that states "Hey Ray, just
do what is sensible engineering-wise and don't worry about cost. It's
kewl." But no, Ray just had to go rogue. Just had to do it his way. Man.
Typical Ray thing.
Cheers,
Johannes
--
>> Wo hattest Du das Beben nochmal
ht now:
(DOS encoded file "y")
>>> for line in open("y", "r"): print(line.encode("utf-8"))
...
b'foo\n'
b'bar\n'
b'moo\n'
b'koo\n'
Yup, the \r was removed automatically. Are there cases when it isn't?
On 05.06.2014 20:52, Ryan Hiebert wrote:
> 2014-06-05 13:42 GMT-05:00 Johannes Bauer :
>
>> On 05.06.2014 20:16, Paul Rubin wrote:
>>> Johannes Bauer writes:
>>>> line = line[:-1]
>>>> Which truncates the trailing "\n" of a textfile lin
On 05.06.2014 20:16, Paul Rubin wrote:
> Johannes Bauer writes:
>> line = line[:-1]
>> Which truncates the trailing "\n" of a textfile line.
>
> use line.rstrip() for that.
rstrip has different functionality than what I'm doing.
Cheers,
Johannes
--
>
that comes up a lot is
line = line[:-1]
Which truncates the trailing "\n" of a textfile line.
Then some indexing in the form of
negative = (line[0] == "-")
All in all I'm actually a bit surprised this isn't too common.
Cheers,
Johannes
--
>> Wo
On 02.06.2014 18:21, Roy Smith wrote:
> Are we talking Tolkien trolls, Pratchett trolls, Rowling trolls, D&D
> trolls, WoW trolls, or what? Details matter.
Monkey Island trolls, obviously.
Cheers,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
&
from Py3 and most of it
will apply. You'll be missing out on a bunch of cool features (arbitrary
precision ints, int division operator, real Unicode support) but that's
no big deal.
Regards,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
all: They would complain to each other and stay away from the
mailing lists of people who actually *embrace* progress and who
appreciate the wonderful features Py3 has given us.
What a wonderful world it would be. So, I agree with the above blogpost.
Some lazy blogwriting bum should fork Py2!
Che
garbage!
import time
def myfunction(constant):
if constant == 1:
time.sleep(1)
else:
time.sleep(1000)
constant = 1
myfunction(constant)
Now let's all code Itanium assembler, yes?
Cheers,
Johannes
--
>> Wo hattest Du das Beben nochmal
easy
after that.
2. other way:
Use Stair-functions: you can approximate the Value of IV() by the sum
over T(E_i) * (E_{i+1} - E_i) s.t. E_0 = E_F-\frac{eV}{2} and E_n =
E_F+\frac{eV}{2}.
3 one more way:
use a computer algebra system like sage.
bg,
Johannes
On 16.05.2014 10:49, Enlong Liu
. Even though I
could claim that the vertical formatting is all messed up when you don't
display my code with the correct font size! Ridiculous, right?
Regards,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heu
ctly as it gives developers *guarantees* about what
they can and cannot do with text datatypes without having to deal with
encoding issues in many places. Just one place: The interface where text
is read or written, just as it should be.
Regards,
Johannes
--
>> Wo hattest Du das Beben nochmal
esentation (data bytes), which is
beautiful. Accidental mixing is not possible. And you have some thing
*guaranteed* for the string type which aren't guaranteed for the bytes
type (for example when doing string manipulation).
Regards,
Johannes
--
>> Wo hattest Du das Beben nochmal GENAU vo
e still valid strings. Manipulating
the bytes representation of unicode data just doesn't work.
And I'm very very glad that some people felt the same way and
implemented a sane, consistent way of dealing with Unicode in Python3.
It's one of the reasons why I switched to Py3 very
1 - 100 of 309 matches
Mail list logo