Re: Running a subprocess in a venv

2023-10-21 Thread Johannes Findeisen via Python-list
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

Re: Running a subprocess in a venv

2023-10-21 Thread Johannes Findeisen via Python-list
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

Re: Evaluation of variable as f-string

2023-01-29 Thread Johannes Bauer
.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

Re: Evaluation of variable as f-string

2023-01-29 Thread Johannes Bauer
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

Re: Evaluation of variable as f-string

2023-01-28 Thread Johannes Bauer
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"

Re: Evaluation of variable as f-string

2023-01-28 Thread Johannes Bauer
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

Re: Evaluation of variable as f-string

2023-01-28 Thread Johannes Bauer
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,

Re: Evaluation of variable as f-string

2023-01-27 Thread Johannes Bauer
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

Re: Evaluation of variable as f-string

2023-01-27 Thread Johannes Bauer
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

Re: Evaluation of variable as f-string

2023-01-27 Thread Johannes Bauer
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

Re: Evaluation of variable as f-string

2023-01-27 Thread Johannes Bauer
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

Evaluation of variable as f-string

2023-01-23 Thread Johannes Bauer
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

Creating lambdas inside generator expression

2022-06-29 Thread Johannes Bauer
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

Re: Creating lambdas inside generator expression

2022-06-29 Thread Johannes Bauer
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:

Re: threading and multiprocessing deadlock

2021-12-06 Thread 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

threading and multiprocessing deadlock

2021-12-05 Thread Johannes Bauer
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

'%Y' in strftime() vs. strptime()

2019-12-29 Thread Johannes Bauer
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

Handling of disconnecting clients in asyncio

2019-09-24 Thread Johannes Bauer
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

Re: GPG wrapper, ECC 25519 compatible?

2019-09-02 Thread Johannes Bauer
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

Pythonic custom multi-line parsers

2019-07-10 Thread Johannes Bauer
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

Re: Curious case of UnboundLocalError

2018-03-31 Thread Johannes Bauer
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

Re: Curious case of UnboundLocalError

2018-03-30 Thread Johannes Bauer
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

Re: Curious case of UnboundLocalError

2018-03-30 Thread Johannes Bauer
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

Curious case of UnboundLocalError

2018-03-30 Thread Johannes Bauer
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):

Re: Entering a very large number

2018-03-23 Thread Johannes Bauer
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

Re: Python on Android?

2018-02-20 Thread Johannes Findeisen
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

Re: Python on Android?

2018-02-20 Thread Johannes Findeisen
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

Re: Python on Android?

2018-02-18 Thread Johannes Findeisen
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

Re: Python on Android?

2018-02-18 Thread Johannes Findeisen
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

Re: Brainstorming on recursive class definitions

2017-09-12 Thread Johannes Bauer
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

Brainstorming on recursive class definitions

2017-09-12 Thread Johannes Bauer
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

Lexer/Parser question: TPG

2016-11-14 Thread Johannes Bauer
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

Re: Magic UTF-8/Windows-1252 encodings

2016-08-30 Thread Johannes Bauer
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.

Zero runtime impact tracing

2016-07-30 Thread Johannes Bauer
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

Re: value of pi and 22/7

2016-06-18 Thread Johannes Bauer
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

pytz and Python timezones

2016-06-11 Thread Johannes Bauer
.. 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

Re: What is heating the memory here? hashlib?

2016-02-15 Thread Johannes Bauer
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,

Re: snmpset

2016-02-05 Thread Johannes Findeisen
'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

Re: Recurring Prompt

2016-01-21 Thread Johannes Findeisen
believe, You should ask the Pycharm People about this. Python is not Pycharm... :| Johannes -- https://mail.python.org/mailman/listinfo/python-list

Re: raise None

2016-01-02 Thread Johannes Bauer
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

Re: raise None

2015-12-31 Thread Johannes Bauer
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

Understanding WSGI together with Apache

2015-10-10 Thread Johannes Bauer
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:

Re: RPI.GPIO Help

2015-09-01 Thread Johannes Bauer
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

Re: Sometimes bottle takes a lot of time

2015-08-23 Thread Johannes Bauer
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

Re: Sometimes bottle takes a lot of time

2015-08-23 Thread Johannes Bauer
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

Re: Sometimes bottle takes a lot of time

2015-08-22 Thread Johannes Bauer
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 ö

Re: Sometimes bottle takes a lot of time

2015-08-22 Thread Johannes Bauer
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

Re: Every character of a string becomes a binding

2015-08-22 Thread Johannes Bauer
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

Re: Sometimes bottle takes a lot of time

2015-08-22 Thread Johannes Bauer
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: Searching for a usable X509 implementation

2015-07-06 Thread Johannes Bauer
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? >

Re: Pure Python Data Mangling or Encrypting

2015-06-27 Thread Johannes Bauer
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

Re: Pure Python Data Mangling or Encrypting

2015-06-27 Thread Johannes Bauer
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

Re: Pure Python Data Mangling or Encrypting

2015-06-27 Thread Johannes Bauer
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&#

Re: Pure Python Data Mangling or Encrypting

2015-06-27 Thread Johannes Bauer
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

Re: Pure Python Data Mangling or Encrypting

2015-06-27 Thread Johannes Bauer
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 -- >>

Re: Pure Python Data Mangling or Encrypting

2015-06-26 Thread Johannes Bauer
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

Re: Pure Python Data Mangling or Encrypting

2015-06-26 Thread Johannes Bauer
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

Re: Pure Python Data Mangling or Encrypting

2015-06-26 Thread Johannes Bauer
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,

Re: Pure Python Data Mangling or Encrypting

2015-06-26 Thread Johannes Bauer
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 -- >&

Re: Jython and can't write cache file

2015-06-21 Thread Johannes Bauer
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

Re: Using ssl module over custom sockets

2015-06-08 Thread Johannes Bauer
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

Re: Function to show time to execute another function

2015-06-07 Thread Johannes Bauer
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

Re: Function to show time to execute another function

2015-06-07 Thread Johannes Bauer
> 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 -- >

Re: Ah Python, you have spoiled me for all other languages

2015-05-24 Thread Johannes Bauer
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

Re: Ah Python, you have spoiled me for all other languages

2015-05-23 Thread Johannes Bauer
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

Re: Ah Python, you have spoiled me for all other languages

2015-05-23 Thread Johannes Bauer
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

Re: Ah Python, you have spoiled me for all other languages

2015-05-23 Thread Johannes Bauer
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

textwrap.wrap() breaks non-breaking spaces

2015-05-17 Thread Johannes Bauer
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

Re: Is this unpythonic?

2015-05-10 Thread Johannes Bauer
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

Re: Is this unpythonic?

2015-05-10 Thread Johannes Bauer
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?

Re: sqlite3 and dates

2015-02-18 Thread Johannes Bauer
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

Re: sqlite3 and dates

2015-02-18 Thread Johannes Bauer
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.

Re: sqlite3 and dates

2015-02-18 Thread Johannes Bauer
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

Idiomatic backtracking in Python

2015-01-25 Thread Johannes Bauer
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

the ressurection of ZOPE for web domination? bluebream and caveman the answer?

2014-10-22 Thread johannes falcone
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

Re: Obscuring Python source from end users

2014-10-02 Thread Johannes Bauer
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

Question about uninstallation.

2014-09-27 Thread Gregory Johannes-Kinsbourg
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

Re: tcp server as windows service

2014-09-23 Thread Johannes Findeisen
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

Re: GIL detector

2014-08-17 Thread Johannes Bauer
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

Re: python small task

2014-08-15 Thread Johannes Bauer
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

Re: how to get the ordinal number in list

2014-08-09 Thread Johannes Bauer
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) >

Re: What happens when you 'break' a generator?

2014-07-29 Thread Johannes Schneider
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

Re: Proposal: === and !=== operators

2014-07-12 Thread Johannes Bauer
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

Re: Proposal: === and !=== operators

2014-07-12 Thread Johannes Bauer
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

Re: Off-Topic: The Machine

2014-06-24 Thread Johannes Bauer
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

Re: OT: This Swift thing

2014-06-15 Thread Johannes Bauer
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

Re: OT: This Swift thing

2014-06-15 Thread Johannes Bauer
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

Re: Unicode and Python - how often do you index strings?

2014-06-06 Thread Johannes Bauer
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?

Re: Unicode and Python - how often do you index strings?

2014-06-06 Thread Johannes Bauer
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

Re: Unicode and Python - how often do you index strings?

2014-06-05 Thread 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 line. > > use line.rstrip() for that. rstrip has different functionality than what I'm doing. Cheers, Johannes -- >

Re: Unicode and Python - how often do you index strings?

2014-06-05 Thread Johannes Bauer
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

Re: Python 3 is killing Python

2014-06-02 Thread Johannes Bauer
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? &

Re: Python 3 is killing Python

2014-05-31 Thread Johannes Bauer
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!

Re: Python 3 is killing Python

2014-05-28 Thread Johannes Bauer
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

Re: Python is horribly slow compared to bash!!

2014-05-26 Thread Johannes Bauer
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

Re: The possibility integration in Python without an equation, just an array-like file

2014-05-16 Thread Johannes Schneider
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

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Johannes Bauer
. 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

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Johannes Bauer
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

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Johannes Bauer
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

Re: Everything you did not want to know about Unicode in Python 3

2014-05-13 Thread Johannes Bauer
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   2   3   4   >