Losing words

2019-04-01 Thread John Doe
I'm learning SOCKETS and working with Irc. --- s.send(bytes("PRIVMSG " + channel +" "+ message + "\n", "UTF-8")) When more than one word ( for example: This is a message) in *message* it sends the FIRST word only "This" and skips th

Re: Losing words

2019-04-01 Thread Chris Angelico
On Tue, Apr 2, 2019 at 12:41 AM John Doe wrote: > > I'm learning SOCKETS and working with Irc. > --- > s.send(bytes("PRIVMSG " + channel +" "+ message + "\n", "UTF-8")) > > When more than one word ( for example: This is a message) >

RE: Losing words

2019-04-01 Thread David Raymond
https://docs.python.org/3.7/library/socket.html#socket.socket.send .send returns the number of bytes that it actually succeeded in sending. From the docs: "Applications are responsible for checking that all data has been sent; if only some of the data was transmitted, the application needs to a

Re: Losing words

2019-04-01 Thread John Doe
On 2019-04-01, Chris Angelico wrote: >> >> I'm learning SOCKETS and working with Irc. >> --- >> s.send(bytes("PRIVMSG " + channel +" "+ message + "\n", "UTF-8")) >> >> When more than one word ( for example: This is a message) >> in

Re: Losing words

2019-04-01 Thread John Doe
On 2019-04-01, David Raymond wrote: > https://docs.python.org/3.7/library/socket.html#socket.socket.send > > .send returns the number of bytes that it actually succeeded in sending. From > the docs: "Applications are responsible for checking that all data has been > sent; if only some of the dat

python os.chdir() Windows Error 2

2019-04-01 Thread grossmudda
Hey guys, I´ve got a problem importing a file with os.chdir. I´ve done a lot of research but still I can´t fix it. For any suggestions I would be so thankful! This is what I´ve tried so far: import os import numpy as np import matplotlib.pyplot as plt os.chdir('C:\Users\Ayla\Documents\Uni\Mas

Re: python os.chdir() Windows Error 2

2019-04-01 Thread Calvin Spealman
What are you actually trying to do? os.chdir() simply changes the current working directory of your process. It doesn't read any data or "import" or really have any affect on its own. The current directory is the directory you ran the script from in the first place, which is where files will be op

RE: Syntax for one-line "nonymous" functions in "declaration style"

2019-04-01 Thread Schachner, Joseph
Re: ">> Neither i like how a function magically turns into a generator if the >> keyword `yield` appears somewhere within its definition. > I agree, there should have been a required syntactic element on the "def" > line as well to signal it immediately to the reader. It won't stop me from > usi

Re: Losing words

2019-04-01 Thread Joel Goldstick
On Mon, Apr 1, 2019 at 11:16 AM John Doe wrote: > > On 2019-04-01, Chris Angelico wrote: > >> > >> I'm learning SOCKETS and working with Irc. > >> --- > >> s.send(bytes("PRIVMSG " + channel +" "+ message + "\n", "UTF-8")) > >> > >>

Re: Losing words

2019-04-01 Thread Jon Ribbens
On 2019-04-01, John Doe wrote: > I'm learning SOCKETS and working with Irc. > --- > s.send(bytes("PRIVMSG " + channel +" "+ message + "\n", "UTF-8")) > > When more than one word ( for example: This is a message) > in *message* it s

Re: Losing words

2019-04-01 Thread Rhodri James
On 01/04/2019 16:14, John Doe wrote: On 2019-04-01, Chris Angelico wrote: I'm learning SOCKETS and working with Irc. --- s.send(bytes("PRIVMSG " + channel +" "+ message + "\n", "UTF-8")) When more than one word ( for example:

Re: Losing words

2019-04-01 Thread John Doe
On 2019-04-01, Jon Ribbens wrote: > On 2019-04-01, John Doe wrote: >> I'm learning SOCKETS and working with Irc. >> --- >> s.send(bytes("PRIVMSG " + channel +" "+ message + "\n", "UTF-8")) >> >> When more than one word ( for example

Re: Losing words

2019-04-01 Thread Grant Edwards
On 2019-04-01, Rhodri James wrote: I'm learning SOCKETS and working with Irc. --- s.send(bytes("PRIVMSG " + channel +" "+ message + "\n", "UTF-8")) When more than one word ( for example: This is a messag

Re: Losing words

2019-04-01 Thread John Doe
On 2019-04-01, Joel Goldstick wrote: >> >> def text(): >> mess = input("> ") >> s.send(bytes("PRIVMSG " + " "+ channel + " " + mess + "\n", "UTF-8")) >> >> text() >> > > Is this a typo or are you calling text() from within text()? >> Indeed I do :-) I was thinking on another way but

Re: Losing words

2019-04-01 Thread Chris Angelico
On Tue, Apr 2, 2019 at 4:21 AM John Doe wrote: > > On 2019-04-01, Joel Goldstick wrote: > >> > >> def text(): > >> mess = input("> ") > >> s.send(bytes("PRIVMSG " + " "+ channel + " " + mess + "\n", "UTF-8")) > >> > >> text() > >> > > > > Is this a typo or are you calling text() fro

Re: Losing words

2019-04-01 Thread MRAB
On 2019-04-01 18:16, John Doe wrote: On 2019-04-01, Joel Goldstick wrote: def text(): mess = input("> ") s.send(bytes("PRIVMSG " + " "+ channel + " " + mess + "\n", "UTF-8")) text() Is this a typo or are you calling text() from within text()? Indeed I do :-) I was thinking

Re: Losing words

2019-04-01 Thread John Doe
On 2019-04-01, Chris Angelico wrote: > > Use a loop, not recursion :) > I can guess only you mean: while but I've got no idea while what. -- https://mail.python.org/mailman/listinfo/python-list

Re: Losing words

2019-04-01 Thread Roel Schroeven
John Doe schreef op 1/04/2019 om 19:16: On 2019-04-01, Joel Goldstick wrote: def text(): mess = input("> ") s.send(bytes("PRIVMSG " + " "+ channel + " " + mess + "\n", "UTF-8")) text() Is this a typo or are you calling text() from within text()? Indeed I do :-) I was th

Python Remote Work

2019-04-01 Thread Shane
Hi, Bit of a long shot! I am looking for remote work and like the look of Python. I am an Australian, with a degree in Commercial computing, with 15 years using Delphi in a business environment. I am looking for a company to X train me to Python remotely, or maybe even a remote Python develope

Re: Python Remote Work

2019-04-01 Thread Abdur-Rahmaan Janhangeer
Maybe add your field web? data science? machine learning? automation? computer vision? ... Abdur-Rahmaan Janhangeer http://www.pythonmembers.club | https://github.com/Abdur-rahmaanJ Mauritius -- https://mail.python.org/mailman/listinfo/python-list

Re: Losing words

2019-04-01 Thread John Doe
The colon was the solution, thanks. -- https://mail.python.org/mailman/listinfo/python-list

Re: Losing words

2019-04-01 Thread Abdur-Rahmaan Janhangeer
Since this is IRC, you might want to see a demo here: https://github.com/Abdur-rahmaanJ/honeybot/blob/master/honeybot/main.py Abdur-Rahmaan Janhangeer Mauritius -- https://mail.python.org/mailman/listinfo/python-list

Re: Losing words

2019-04-01 Thread John Doe
On 2019-04-01, Roel Schroeven wrote: > This is what 'while' is made for: > > def text(): > while True: > mess = input("> ") > s.send(bytes("PRIVMSG " + " "+ channel + " " + mess + "\n", > "UTF-8")) > see it working thanks, indeed while is powerful, had to add colon to b

Re: Losing words

2019-04-01 Thread Chris Angelico
On Tue, Apr 2, 2019 at 6:31 AM John Doe wrote: > > > The colon was the solution, thanks. > Cool. Please don't post context-free messages though - not everyone knows that you were talking about IRC. (Part of that is because your subject line didn't mention IRC either.) If you're going to do a lot

Re: Losing words

2019-04-01 Thread Chris Angelico
On Tue, Apr 2, 2019 at 6:36 AM John Doe wrote: > > On 2019-04-01, Roel Schroeven wrote: > > This is what 'while' is made for: > > > > def text(): > > while True: > > mess = input("> ") > > s.send(bytes("PRIVMSG " + " "+ channel + " " + mess + "\n", > > "UTF-8")) > > > >

Re: Losing words

2019-04-01 Thread John Doe
On 2019-04-01, Chris Angelico wrote: > > Cool. Please don't post context-free messages though - not everyone > knows that you were talking about IRC. (Part of that is because your > subject line didn't mention IRC either.) > I've mentioned it in a mother post mate. > If you're going to do a lot w

Re: Losing words

2019-04-01 Thread Chris Angelico
On Tue, Apr 2, 2019 at 7:11 AM John Doe wrote: > > On 2019-04-01, Chris Angelico wrote: > > > > Cool. Please don't post context-free messages though - not everyone > > knows that you were talking about IRC. (Part of that is because your > > subject line didn't mention IRC either.) > > > I've ment

Re: Losing words

2019-04-01 Thread John Doe
On 2019-04-01, Rhodri James wrote: > > I'm not an expert, but looking at RFC-1459 it looks like your final > parameter (the message) needs to be preceded by a colon. In other words > you want: > > s.send(bytes("PRIVMSG " + channel + " :" + mess + "\n", "UTF-8")) > > (Try printing out the line y

Re: Losing words

2019-04-01 Thread John Doe
On 2019-04-01, Abdur-Rahmaan Janhangeer wrote: > Since this is IRC, you might want to see a demo here: > https://github.com/Abdur-rahmaanJ/honeybot/blob/master/honeybot/main.py Yes. However get these def text() and loop while 1: working together. def text(): while True: mess = input

Logging module and datetime - oil & water for some reason?

2019-04-01 Thread Skip Montanaro
I assiduously avoided using Python's logging package for about the first dozen years of its existence. I eventually gave in and started using it relatively recently in the guise of a thin wrapper provided by a colleague at work. Today I had occasion to tweak the timestamp format only to discover th

Re: Syntax for one-line "nonymous" functions in "declaration style"

2019-04-01 Thread Alexey Muranov
On lun., avril 1, 2019 at 6:00 PM, python-list-requ...@python.org wrote: On Sun, Mar 31, 2019 at 1:09 PM Alexey Muranov wrote: On dim., Mar 31, 2019 at 6:00 PM, python-list-requ...@python.org wrote: > On Sat, Mar 30, 2019, 5:32 AM Alexey Muranov > > wrote: > >> >> On ven., Mar 29,

Re: Handy utilities = Friday Filosofical Finking

2019-04-01 Thread Cameron Simpson
On 29Mar2019 09:32, DL Neil wrote: How do you keep, use, and maintain those handy snippets, functions, classes... - units of code, which you employ over-and-over again? Having coded 'stuff' once, most of us will keep units of code, "utilities", which we expect will be useful in-future (DRY pri

Re: python os.chdir() Windows Error 2

2019-04-01 Thread eryk sun
On 4/1/19, grossmu...@gmail.com wrote: > > os.chdir('C:\\Users\\Ayla\\Documents\\Uni\\Master_Umweltingenieurwesen\\ > Study_Project\\kerschbaum_input') > os.chdir('C:/Users/Ayla/Documents/Uni/Master_Umweltingenieurwesen/ > Study_Project/kerschbaum_input') These string literals should work if the

Re: Handy utilities = Friday Filosofical Finking

2019-04-01 Thread DL Neil
Gidday Cameron, Thanks for this - some thoughts below:- On 2/04/19 11:57 AM, Cameron Simpson wrote: On 29Mar2019 09:32, DL Neil wrote: How do you keep, use, and maintain those handy snippets, functions, classes... - units of code, which you employ over-and-over again? Having coded 'stuff' o

Re: Handy utilities = Friday Filosofical Finking

2019-04-01 Thread Chris Angelico
On Tue, Apr 2, 2019 at 11:16 AM DL Neil wrote: > One of the points which intrigue me is that my colleagues don't keep > snippets/a library, preferring to remember (hah!) when/where they used > particular techniques in the past, and copying/duplicating, to fit the > new system's requirements. Am wo

Re: Handy utilities = Friday Filosofical Finking

2019-04-01 Thread Cameron Simpson
On 02Apr2019 13:14, DL Neil wrote: On 2/04/19 11:57 AM, Cameron Simpson wrote: On 29Mar2019 09:32, DL Neil wrote: Do you 'keep' these, or perhaps next time you need something you've 'done before' do you remember when/where a technique was last used/burrow into 'history'? (else, code it from

How call method from a method in same class?

2019-04-01 Thread Dave
As classes get more complex, it is good to call a function to do some of the processing, and make the code easier to follow. My question is how to do that? I've attached some silly code to illustrate the point. The error is: name 'validScale' is not defined. Well, yes it is, but maybe not t

Re: How call method from a method in same class?

2019-04-01 Thread Irv Kalb
> On Apr 1, 2019, at 7:02 PM, Dave wrote: > > As classes get more complex, it is good to call a function to do some of the > processing, and make the code easier to follow. My question is how to do > that? I've attached some silly code to illustrate the point. The error is: > name 'validS

Re: How call method from a method in same class?

2019-04-01 Thread Dan Sommers
On 4/1/19 10:02 PM, Dave wrote: def validScale(self, scaleName): if scaleName.upper == 'F' or 'C' or 'K': return True else: return False def convertTemp(self): """ Converts temperature scale if scales valid.""" if v

Re: Handy utilities = Friday Filosofical Finking

2019-04-01 Thread DL Neil
On 2/04/19 1:25 PM, Chris Angelico wrote: On Tue, Apr 2, 2019 at 11:16 AM DL Neil wrote: One of the points which intrigue me is that my colleagues don't keep snippets/a library, preferring to remember (hah!) when/where they used particular techniques in the past, and copying/duplicating, to fit

Re: How call method from a method in same class?

2019-04-01 Thread Dave
On 4/1/19 10:12 PM, Irv Kalb wrote: On Apr 1, 2019, at 7:02 PM, Dave wrote: As classes get more complex, it is good to call a function to do some of the processing, and make the code easier to follow. My question is how to do that? I've attached some silly code to illustrate the point. T

Re: How call method from a method in same class?

2019-04-01 Thread Dave
On 4/1/19 10:02 PM, Dave wrote: As classes get more complex, it is good to call a function to do some of the processing, and make the code easier to follow.  My question is how to do that?  I've attached some silly code to illustrate the point.  The error is: name 'validScale' is not defined. 

Re: How call method from a method in same class?

2019-04-01 Thread Cameron Simpson
On 01Apr2019 22:02, Dave wrote: As classes get more complex, it is good to call a function to do some of the processing, and make the code easier to follow. My question is how to do that? I've attached some silly code to illustrate the point. The error is: name 'validScale' is not defined.

Re: Handy utilities = Friday Filosofical Finking

2019-04-01 Thread Chris Angelico
On Tue, Apr 2, 2019 at 1:21 PM DL Neil wrote: > > Sometimes, I recollect and reference, which creates some very weird > > interdependencies until I get around to refactoring... > > but some fairly hairy "technical debt" meantime? > > > > https://github.com/Rosuav/MegaClip/blob/master/deviquotes.py

Re: How call method from a method in same class?

2019-04-01 Thread Dave
On 4/1/19 10:29 PM, Cameron Simpson wrote: On 01Apr2019 22:02, Dave wrote: As classes get more complex, it is good to call a function to do some of the processing, and make the code easier to follow.  My question is how to do that?  I've attached some silly code to illustrate the point.  The

Re: Handy utilities = Friday Filosofical Finking

2019-04-01 Thread DL Neil
On 2/04/19 1:56 PM, Cameron Simpson wrote: On 02Apr2019 13:14, DL Neil wrote: On 2/04/19 11:57 AM, Cameron Simpson wrote: On 29Mar2019 09:32, DL Neil wrote: Do you 'keep' these, or perhaps next time you need something you've 'done before' do you remember when/where a technique was last used