I have written a basic tcp server factory, server client and a service using
twisted. The tcp server acts as the middleware between a django server and an
another program (let's call it client program).
What I want to achieve -
1.client requests the middleware tcp server;
2.it sends a string a
Am 05.11.15 um 01:42 schrieb Chris Angelico:
On Thu, Nov 5, 2015 at 6:38 AM, Christian Gollwitzer wrote:
As someone who grew up on MS-DOS, I'd like to mention that EDLIN's
value wasn't in the obvious places. There were two features it had
that most other editors didn't: firstly, it would read on
Joel Goldstick wrote:
Sometimes (maybe most times) the follow on discussion goes off on
insightful tangents that may have little to do with the OP.
And then someone mentions a Monty Python sketch about
Hitler, thereby both bring the discussion back on-topic
*and* invoking Godwin's Law at the sa
On Wednesday, November 4, 2015 at 7:46:24 PM UTC-7, Chris Angelico wrote:
> On Thu, Nov 5, 2015 at 11:24 AM, rurpy wrote:
> The "take away" that I recommend is: Rurpy loves to argue in favour of
> regular expressions,
No, I don't love it, I quite dislike it.
> but as you can see from the other p
On 11/04/2015 07:24 PM, Steven D'Aprano wrote:
> On Thu, 5 Nov 2015 11:24 am, wrote:
>
>> You will find they are an indispensable tool, not just in Python
>> programming but in many aspects of computer use.
>
> You will find them a useful tool, but not indispensable by any means.
>
> Hint:
>
> - Ho
On Wednesday, November 4, 2015 at 7:31:34 PM UTC-7, Steven D'Aprano wrote:
> On Thu, 5 Nov 2015 11:13 am, rurpy wrote:
>
> > There would be far fewer computer languages, and they would be much
> > more primitive if regular expressions (and the fundamental concepts
> > that they express) did not ex
On 11/04/2015 05:33 PM, Chris Angelico wrote:
> On Thu, Nov 5, 2015 at 11:13 AM, rurpy--- via Python-list
> wrote:
>> On 11/04/2015 07:52 AM, Chris Angelico wrote:
>>> On Thu, Nov 5, 2015 at 1:38 AM, rurpy wrote:
I'm afraid you are making a category error but perhaps that's in
part becau
在 2015年11月4日星期三 UTC-6下午3:45:09,input/ld...@casema.nl写道:
> I have an continues loop with "while True:"
> Now I want to use "raw_input" and when I press "s" on the keybord that it
> will
> "break" the continues loop.
>
> I tried:
> choices = raw_input
> if choises == s:
> break
>
> But even when
Hi,
If I may, I feel you are tying to address a few questions at the same time,
although they are related
1. Where to put the try/except block, inside or outside the function
2. How to deal with un-anticipated exceptions
3. How to keep record
My personal feelings are:
1. Kind of prefer try/except
在 2015年11月4日星期三 UTC-6下午10:18:33,zlju...@gmail.com写道:
> > Which would you prefer?
>
> So if I am just checking for the ConnectionError in get_html and a new
> exception arises, I will have traceback to the get_html function showing that
> unhandled exception has happened.
> Now I have to put addi
On Thu, Nov 5, 2015 at 3:18 PM, wrote:
>> Which would you prefer?
>
> So if I am just checking for the ConnectionError in get_html and a new
> exception arises, I will have traceback to the get_html function showing that
> unhandled exception has happened.
> Now I have to put additional excepti
> Which would you prefer?
So if I am just checking for the ConnectionError in get_html and a new
exception arises, I will have traceback to the get_html function showing that
unhandled exception has happened.
Now I have to put additional exception block for managing the new exception in
the get
On Monday, 2 November 2015 21:59:45 UTC+1, Ian wrote:
> I'm having a hard time understanding what question you're asking.
:)
I am really having a hard time to explain the problem as English is not my
first language.
> You
> have a lot of discussion about where to handle exceptions,
That's
On Thu, Nov 5, 2015 at 2:41 PM, wrote:
> Raising an exception forces me to put every call of the get_html function in
> try/except block.
> If I am returning a special value, than I can call get_html and then test the
> value.
>
> I am not sure which approach is better.
Raising an exception me
> The best way is probably to do nothing at all, and let the caller handle
> any exceptions.
In that case every call of the get_html function has to be in the try/except
block with many exceptions.
Sometimes, it is enough just to know whether I managed to get the html or not.
In that case, I coul
Steven D'Aprano writes:
> Yes yes, I know that regexes aren't the only tool in my tool box, but
> *right now* I want to learn how to use regexes.
I'll gently suggest this isn't a particularly good forum to do so.
Learn them with a tool like http://www.regexr.com/> and a tutorial
http://www.usna
Steven D'Aprano writes:
> On Wed, 4 Nov 2015 07:57 pm, Peter Otten wrote:
>
> > I tried Tim's example
> >
> > $ seq 5 | grep '1*'
> > 1
> > 2
> > 3
> > 4
> > 5
> > $
>
> I don't understand this. What on earth is grep matching? How does "4"
> match "1*"?
You can experiment with regular expressio
On 2015-11-05 13:28, Steven D'Aprano wrote:
> > I tried Tim's example
> >
> > $ seq 5 | grep '1*'
> > 1
> > 2
> > 3
> > 4
> > 5
> > $
>
> I don't understand this. What on earth is grep matching? How does
> "4" match "1*"?
The line with "4" matches "zero or more 1s". If it was searching for
a
On Thu, Nov 5, 2015 at 11:24 AM, rurpy--- via Python-list
wrote:
> On Wednesday, November 4, 2015 at 4:05:06 PM UTC-7, Seymore4Head wrote:
>>[...]
>> I am still here, but I have to admit I am not picking up too much.
>
> The "take away" I recommend is: the folks here are often way
> overly negativ
On Thu, 5 Nov 2015 11:13 am, ru...@yahoo.com wrote:
> There would be far fewer computer languages, and they would be much
> more primitive if regular expressions (and the fundamental concepts
> that they express) did not exist.
Well, that's certainly true. But only because contra-factual statemen
On Wed, 4 Nov 2015 07:57 pm, Peter Otten wrote:
> I tried Tim's example
>
> $ seq 5 | grep '1*'
> 1
> 2
> 3
> 4
> 5
> $
I don't understand this. What on earth is grep matching? How does "4"
match "1*"?
> which surprised me because I remembered that there usually weren't any
> matching lines wh
On Thu, 5 Nov 2015 11:24 am, ru...@yahoo.com wrote:
> You will find they are an indispensable tool, not just in Python
> programming but in many aspects of computer use.
You will find them a useful tool, but not indispensable by any means.
Hint:
- How many languages make arithmetic a built-in p
On Thu, 5 Nov 2015 10:02 am, Seymore4Head wrote:
> So far the only use I have for regex is to replace slicing, but I
> think it is an improvement.
I don't understand this. This is like saying "so far the only use I have for
a sandwich press is to replace my coffee pot". Regular expressions and
sl
On Thu, 5 Nov 2015 09:37 am, input/ldompel...@casema.nl wrote:
> I quote the s, but its still break even when I not press the s.
The code you have shown us is so full of bugs and typos that you cannot
possibly be running that code.
Unfortunately, we do not have magical powers. We cannot see the
On Thu, Nov 5, 2015 at 6:38 AM, Christian Gollwitzer wrote:
> Am 04.11.15 um 19:24 schrieb Ben Finney:
>>
>> The name is a mnemonic for a compound command in ‘ed’ [0], a text editor
>> that pre-dates extravagant luxuries like “presenting a full screen of
>> text at one time”.
>>
>> [... lots of f
On Thu, Nov 5, 2015 at 11:13 AM, rurpy--- via Python-list
wrote:
> On 11/04/2015 07:52 AM, Chris Angelico wrote:
>> On Thu, Nov 5, 2015 at 1:38 AM, rurpy wrote:
>>> I'm afraid you are making a category error but perhaps that's in
>>> part because I wasn't clear. I was not talking about computer
>
On Wednesday, November 4, 2015 at 4:05:06 PM UTC-7, Seymore4Head wrote:
>[...]
> I am still here, but I have to admit I am not picking up too much.
The "take away" I recommend is: the folks here are often way
overly negative regarding regular expressions and that you not
ignore them, but take the
On 11/04/2015 07:52 AM, Chris Angelico wrote:
> On Thu, Nov 5, 2015 at 1:38 AM, rurpy wrote:
>> I'm afraid you are making a category error but perhaps that's in
>> part because I wasn't clear. I was not talking about computer
>> science. I was talking about human beings learning about computers.
https://www.youtube.com/watch?v=M9ebkjWU6Z4
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, 4 Nov 2015 18:08:51 -0500, Terry Reedy
wrote:
>On 11/3/2015 10:23 PM, Steven D'Aprano wrote:
>
>> I don't even know what grep stands for.
>
>Get Regular Expression & Print
Thanks, I may get around to that eventually.
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, Nov 4, 2015 at 5:59 PM, Emile van Sebille wrote:
> On 11/4/2015 11:38 AM, alperen wrote:
>
>> hi guys.
>> i am computer engineering student and i want to practise the lectures
>> that i saw at school. for example dictionaries tuples or some other topics.
>> i know eulerproject but it is h
On Wed, 04 Nov 2015 14:48:21 +1100, Steven D'Aprano
wrote:
>On Wednesday 04 November 2015 11:33, ru...@yahoo.com wrote:
>
>>> Not quite. Core language concepts like ifs, loops, functions,
>>> variables, slicing, etc are the socket wrenches of the programmer's
>>> toolbox. Regexs are like an ele
Hello,
Yes, the fix has been merged. If 3.5.1 gets released in a month, it
should not be a problem. And looks like it dpends on
http://bugs.python.org/issue25446 .
Thank you for the information.
Dmitry
On Wed, Nov 4, 2015 at 5:52 PM, Terry Reedy wrote:
> On 11/3/2015 8:24 PM, Dmitry Panteleev w
On 11/3/2015 10:23 PM, Steven D'Aprano wrote:
I don't even know what grep stands for.
Get Regular Expression & Print
--
Terry Jan Reedy
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, 04 Nov 2015 08:13:51 -0700, Michael Torrie
wrote:
>On 11/04/2015 01:57 AM, Peter Otten wrote:
>> and then headed for the man page. Apparently there is a subset
>> called "basic regular expressions":
>>
>> """> Basic vs Extended Regular Expressions
>>In basic regular expressions
On 11/3/2015 10:18 PM, Steven D'Aprano wrote:
On Wednesday 04 November 2015 09:25, Terry Reedy wrote:
On 11/3/2015 10:42 AM, Chris Angelico wrote:
On Wed, Nov 4, 2015 at 2:00 AM, Random832 wrote:
Nobody writes:
It's probably related to the fact that std{in,out,err} are Unicode
streams.
On 11/4/2015 11:38 AM, alperen wrote:
hi guys.
i am computer engineering student and i want to practise the lectures that i
saw at school. for example dictionaries tuples or some other topics. i know
eulerproject but it is hard for starting. do you know any exercise sites for
students or begin
On 11/3/2015 8:24 PM, Dmitry Panteleev wrote:
Hello,
There is a bug in asyncio.Queue
(https://github.com/python/asyncio/issues/268), which makes it
unusable for us. It is fixed in master now.
I presume that the fix has been merged into the CPython repository (you
could check). If so, it shou
In reply to "Joel Goldstick" who wrote the following:
> On Wed, Nov 4, 2015 at 4:44 PM, wrote:
>
> > I have an continues loop with "while True:"
> > Now I want to use "raw_input" and when I press "s" on the keybord that it
> > will
> > "break" the continues loop.
> >
> > I tried:
> > choices =
On Wed, Nov 4, 2015 at 4:44 PM, wrote:
> I have an continues loop with "while True:"
> Now I want to use "raw_input" and when I press "s" on the keybord that it
> will
> "break" the continues loop.
>
> I tried:
> choices = raw_input
> if choises == s:
> break
>
> But even when I not press "s" it
On Wed, Nov 4, 2015 at 2:44 PM, wrote:
> I have an continues loop with "while True:"
> Now I want to use "raw_input" and when I press "s" on the keybord that it will
> "break" the continues loop.
>
> I tried:
> choices = raw_input
This doesn't call raw_input. For that you need to write raw_input
I have an continues loop with "while True:"
Now I want to use "raw_input" and when I press "s" on the keybord that it will
"break" the continues loop.
I tried:
choices = raw_input
if choises == s:
break
But even when I not press "s" it "break"
I want that I not press "s" the script continues.
A
On Wed, Nov 4, 2015 at 11:18 AM, Storey, Geneva
wrote:
>
>
>
>
> I am having the same problem that we experienced earlier (see below). This
> student was exploring random numbers in Python. She named her program random
> which caused confusion for her computer. We deleted the file, but still
Ok, let me ask a different question: the impression I have gotten when trying
to find help with CherryPy in general and ws4py specifically is that these
frameworks are not widely used or well supported. Is that a fair assessment, or
do I just have issues that are outside the realm of experience
I am having the same problem that we experienced earlier (see below). This
student was exploring random numbers in Python. She named her program random
which caused confusion for her computer. We deleted the file, but still had
the problem. I removed Python from the machine. When I trie
Am 04.11.15 um 19:24 schrieb Ben Finney:
The name is a mnemonic for a compound command in ‘ed’ [0], a text editor
that pre-dates extravagant luxuries like “presenting a full screen of
text at one time”.
[... lots of fun facts ...]
Here is another fun fact: The convincing UI of ed was actually
hi guys.
i am computer engineering student and i want to practise the lectures that i
saw at school. for example dictionaries tuples or some other topics. i know
eulerproject but it is hard for starting. do you know any exercise sites for
students or beginners
--
https://mail.python.org/mailman
On 2015-11-05 05:24, Ben Finney wrote:
> A very common command to issue, then, is “actually show me the line
> of text I just specified”; the ‘p’ (for “print”) command.
>
> Another very common command is “find the text matching this pattern
> and perform these commands on it”, which is ‘g’ (for “g
Can u give me a suited solution that simply works for me?
> http://stackoverflow.com/questions/11405549/how-do-i-install-pycrypto-on-windows
Voidspace only has Python 3.3. They are usually behind some minor
versions. The only good way to do this is to compile it from sources.
Unfortunately, not
Steven D'Aprano writes:
> On Wednesday 04 November 2015 13:55, Dan Sommers wrote:
>
> > Its very name indicates that its default mode most certainly is
> > regular expressions.
>
> I don't even know what grep stands for.
“grep” stands for ‘g/RE/p’.
The name is a mnemonic for a compound command
Random832 wrote:
>The opposite of line buffering is not no buffering, but full
>(i.e. block) buffering, that doesn't get flushed until it runs
>out of space. TextIOWrapper has its own internal buffer, and its
>design apparently doesn't contemplate the possibility of using
>it with a raw FileIO ob
On Wed, Nov 4, 2015 at 5:41 AM, Christoph Zallmann wrote:
> Hey there,
>
>
>
> i tried using Python 3.5.0 in combination with pycrypto and everything i got
> was crap. Really. I tried so many things, how to solve my problem - using
> environment variables, vs 2015 and many more. With python 2.7 or
On 2015-11-04 09:57, Peter Otten wrote:
> Well, I didn't know that grep uses regular expressions by default.
It doesn't help that grep(1) comes in multiple flavors:
grep: should use BRE (Basic REs)
fgrep: same as "grep -F"; uses fixed strings, no REs
egrep: same as "grep -E"; uses ERE (Extende
On 2015-11-04 14:39, Steven D'Aprano wrote:
> On Wednesday 04 November 2015 03:56, Tim Chase wrote:
>> Or even more valuable to me:
>>
>> with open(..., newline="strip") as f:
>> assert all(not line.endswith(("\n", "\r")) for line in f)
>
> # Works only on Windows text files.
> def chomp(li
On 11/04/2015 01:57 AM, Peter Otten wrote:
> and then headed for the man page. Apparently there is a subset
> called "basic regular expressions":
>
> """> Basic vs Extended Regular Expressions
>In basic regular expressions the meta-characters ?, +, {, |, (,
>and ) lose their speci
On Thu, Nov 5, 2015 at 1:38 AM, rurpy--- via Python-list
wrote:
> I'm afraid you are making a category error but perhaps that's in
> part because I wasn't clear. I was not talking about computer
> science. I was talking about human beings learning about computers.
> Most people I know consider p
On Wednesday, November 4, 2015 at 1:52:31 AM UTC-7, Steven D'Aprano wrote:
> On Wednesday 04 November 2015 18:21, Christian Gollwitzer wrote:
>
> > What rurpy meant, was that regexes can surface to a computer user
> > earlier than variables and branches; a user who does not go into the
> > depth t
On 11/03/2015 08:48 PM, Steven D'Aprano wrote:
> On Wednesday 04 November 2015 11:33, rurpy wrote:
>
>>> Not quite. Core language concepts like ifs, loops, functions,
>>> variables, slicing, etc are the socket wrenches of the programmer's
>>> toolbox. Regexs are like an electric impact socket wre
Wolfgang Maier writes:
> Standard I/O streams are line-buffered only if interactive (i.e.,
> connected to a console), but block-buffered otherwise.
That's not appropriate for stderr, nor is it justified by the argument
that Terry Reedy cited earlier. I had assumed he was making an implicit
claim
On 2015-11-04, Michael Torrie wrote:
> On 11/03/2015 08:23 PM, Steven D'Aprano wrote:
>>
Grep can use regular expressions (and I do so with it regularly), but
it's default mode is certainly not regular expressions ...
>>>
>>> Its very name indicates that its default mode most certainly i
> Hey,
>
> I have to write a LU-decomposition. My Code worked so far but (I want to
> become better:) ) I want to ask you, if I could write this LU-decomposition
> in a better way?
Why can't you just use scipy for this?
http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.linalg.lu.
Hello,
There is a bug in asyncio.Queue
(https://github.com/python/asyncio/issues/268), which makes it
unusable for us. It is fixed in master now. What is the easiest way to
patch the asyncio bundled with python if I have to distribute it among
5 colleagues? It is used in our private module.
I can
Hey there,
i tried using Python 3.5.0 in combination with pycrypto and everything i got
was crap. Really. I tried so many things, how to solve my problem - using
environment variables, vs 2015 and many more. With python 2.7 or even 3.4 i
heard it was no problem but using 3.5 all i got was one e
On 04.11.2015 11:43, Wolfgang Maier wrote:
On 04.11.2015 11:24, Steven D'Aprano wrote:
On Wed, 4 Nov 2015 07:19 pm, Wolfgang Maier wrote:
On 04.11.2015 04:18, Steven D'Aprano wrote:
This is one of the offending line from our code base:
print('<4>Suspicious answer "{}"!'.format(answer), file
Op 04-11-15 om 04:35 schreef Steven D'Aprano:
> On Wednesday 04 November 2015 03:20, Chris Angelico wrote:
>
>> (So,
>> too, are all the comments about using [-1] or string methods. But we
>> weren't to know that.)
> If MRAB could understand what he wanted, I'm sure most others could have
> too.
On 04.11.2015 11:24, Steven D'Aprano wrote:
On Wed, 4 Nov 2015 07:19 pm, Wolfgang Maier wrote:
On 04.11.2015 04:18, Steven D'Aprano wrote:
This is one of the offending line from our code base:
print('<4>Suspicious answer "{}"!'.format(answer), file=sys.stderr)
So that ought to be terminated
On Wed, 4 Nov 2015 07:19 pm, Wolfgang Maier wrote:
> On 04.11.2015 04:18, Steven D'Aprano wrote:
>> On Wednesday 04 November 2015 09:25, Terry Reedy wrote:
>>
>>> On 11/3/2015 10:42 AM, Chris Angelico wrote:
On Wed, Nov 4, 2015 at 2:00 AM, Random832
wrote:
> Nobody writes:
>
>>
On 03/11/2015 22:12, Chris Angelico wrote:
> On Wed, Nov 4, 2015 at 6:09 AM, Anthony Papillion
> wrote:
>> Does anyone know of a module that allows the wiring of Outlook PST
>> files using Python? I'm working on a project that will require me
>> to migrate 60gb of maildir mail (multiple accounts)
On 4 November 2015 at 03:39, Steven D'Aprano
wrote:
>
> Better would be this:
>
> def chomp(lines):
> for line in lines:
> yield line.rstrip() # remove all trailing whitespace
>
>
> with open(...) as f:
> for line in chomp(f): ...
with open(...) as f:
for line in map(str.rstr
Michael Torrie wrote:
> On 11/03/2015 08:23 PM, Steven D'Aprano wrote:
Grep can use regular expressions (and I do so with it regularly), but
it's default mode is certainly not regular expressions ...
>>>
>>> Its very name indicates that its default mode most certainly is regular
>>> expr
On Wednesday 04 November 2015 18:21, Christian Gollwitzer wrote:
> What rurpy meant, was that regexes can surface to a computer user
> earlier than variables and branches; a user who does not go into the
> depth to actually program the machine, might still encounter them in a
> text editor or data
On 10/29/2015 01:07 PM, Steven D'Aprano wrote:
My question is: what will happen when about 20 students will do the same
>at the same time? I know too little about what's going under the hood
>with an "import X" command to be able to predict problems that might
>occur.
I think it should be fine.
On 04.11.2015 04:18, Steven D'Aprano wrote:
On Wednesday 04 November 2015 09:25, Terry Reedy wrote:
On 11/3/2015 10:42 AM, Chris Angelico wrote:
On Wed, Nov 4, 2015 at 2:00 AM, Random832 wrote:
Nobody writes:
It's probably related to the fact that std{in,out,err} are Unicode
streams.
Th
73 matches
Mail list logo