Re: Printing UTF-8 mail to terminal

2024-11-05 Thread Cameron Simpson via Python-list
On 04Nov2024 13:02, Loris Bennett wrote: OK, so I can do: ## if args.verbose: for k in mail.keys(): print(f"{k}: {mail.get(k)}") print('') print(mail.get_content()) ##

Re: Printing UTF-8 mail to terminal

2024-11-05 Thread Peter J. Holzer via Python-list
On 2024-11-04 13:02:21 +0100, Loris Bennett via Python-list wrote: > "Loris Bennett" writes: > > "Loris Bennett" writes: > >> Cameron Simpson writes: > >>> On 01Nov2024 10:10, Loris Bennett wrote: > as expected. The non-UTF-8 text occurs when I do > > mail = EmailMessage() > >>>

Re: Printing UTF-8 mail to terminal

2024-11-04 Thread Loris Bennett via Python-list
"Loris Bennett" writes: > "Loris Bennett" writes: > >> Cameron Simpson writes: >> >>> On 01Nov2024 10:10, Loris Bennett wrote: as expected. The non-UTF-8 text occurs when I do mail = EmailMessage() mail.set_content(body, cte="quoted-printable") ... if arg

Re: Printing UTF-8 mail to terminal

2024-11-04 Thread Loris Bennett via Python-list
"Loris Bennett" writes: > Cameron Simpson writes: > >> On 01Nov2024 10:10, Loris Bennett wrote: >>>as expected. The non-UTF-8 text occurs when I do >>> >>> mail = EmailMessage() >>> mail.set_content(body, cte="quoted-printable") >>> ... >>> >>> if args.verbose: >>> print(mail) >>> >>>

Re: Printing UTF-8 mail to terminal

2024-11-04 Thread Loris Bennett via Python-list
Inada Naoki writes: > 2024年11月2日(土) 0:36 Loris Bennett via Python-list : > >> Left Right writes: >> >> > There's quite a lot of misuse of terminology around terminal / console >> > / shell. Please, correct me if I'm wrong, but it looks like you are >> > printing that on MS Windows, right? MS W

Re: Printing UTF-8 mail to terminal

2024-11-04 Thread Loris Bennett via Python-list
Cameron Simpson writes: > On 01Nov2024 10:10, Loris Bennett wrote: >>as expected. The non-UTF-8 text occurs when I do >> >> mail = EmailMessage() >> mail.set_content(body, cte="quoted-printable") >> ... >> >> if args.verbose: >> print(mail) >> >>which is presumably also correct. >> >>T

Re: Printing UTF-8 mail to terminal

2024-11-02 Thread Inada Naoki via Python-list
Try PYTHONUTF8=1 envver. 2024年11月2日(土) 0:36 Loris Bennett via Python-list : > Left Right writes: > > > There's quite a lot of misuse of terminology around terminal / console > > / shell. Please, correct me if I'm wrong, but it looks like you are > > printing that on MS Windows, right? MS Windo

Re: Printing UTF-8 mail to terminal

2024-11-02 Thread Eli the Bearded via Python-list
In comp.lang.python, Gilmeh Serda wrote: > Python 3.12.6 (main, Sep 8 2024, 13:18:56) [GCC 14.2.1 20240805] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> help('modules') > > Please wait a moment while I gather a list of all available modules... > > Ass

Re: Printing UTF-8 mail to terminal

2024-11-02 Thread Jon Ribbens via Python-list
On 2024-11-01, Eli the Bearded <*@eli.users.panix.com> wrote: > In comp.lang.python, Gilmeh Serda wrote: >> Python 3.12.6 (main, Sep 8 2024, 13:18:56) [GCC 14.2.1 20240805] on linux >> Type "help", "copyright", "credits" or "license" for more information. >> >>> help('modules') >> >> Please wai

Re: Printing UTF-8 mail to terminal

2024-11-02 Thread Barry via Python-list
> On 1 Nov 2024, at 22:57, Left Right wrote: > > Does this Windows Terminal support the use > of programs like tmux? I have not tried, but should work. Best to install the terminal app from the MS app store. Most use I make is to ssh into linux systems and stuff like editors. Colour output a

Re: Printing UTF-8 mail to terminal

2024-11-01 Thread Left Right via Python-list
> Windows does now. They implemented this feature over the last few years. > Indeed they took inspiration from how linux does this. > > You might find https://devblogs.microsoft.com/commandline/ has interesting > articles about this. I don't have MS Windows. My wife does, but I don't want to both

Re: Printing UTF-8 mail to terminal

2024-11-01 Thread Barry via Python-list
> On 31 Oct 2024, at 16:42, Left Right via Python-list > wrote: > > MS Windows doesn't have or use > terminals (that's more of a Unix-related concept). Windows does now. They implemented this feature over the last few years. Indeed they took inspiration from how linux does this. You might f

Re: Printing UTF-8 mail to terminal

2024-11-01 Thread Cameron Simpson via Python-list
On 31Oct2024 21:53, alan.ga...@yahoo.co.uk wrote: On 31/10/2024 20:50, Cameron Simpson via Python-list wrote: If you're just dealing with this directly, use the `quopri` stdlib module: https://docs.python.org/3/library/quopri.html One of the things I love about this list are these little feat

Re: Printing UTF-8 mail to terminal

2024-11-01 Thread Cameron Simpson via Python-list
On 01Nov2024 10:10, Loris Bennett wrote: as expected. The non-UTF-8 text occurs when I do mail = EmailMessage() mail.set_content(body, cte="quoted-printable") ... if args.verbose: print(mail) which is presumably also correct. The question is: What conversion is necessary in order t

Re: Printing UTF-8 mail to terminal

2024-11-01 Thread Cameron Simpson via Python-list
On 01Nov2024 08:11, Loris Bennett wrote: Cameron Simpson writes: If you're using the Python email module to parse (or construct) the message as a `Message` object I'd expect that to happen automatically. I am using email.message.EmailMessage Noted. That seems like the correct approach to

Re: Printing UTF-8 mail to terminal

2024-11-01 Thread Dieter Maurer via Python-list
Loris Bennett wrote at 2024-11-1 10:10 +0100: > ... > mail.set_content(body, cte="quoted-printable") In the line above, you request the content to use the "cte" (= "Content-Transfer-Encoding") "quoted-printable" and consequently, the content is encoded with `quoted-printable`. Maybe, you do not n

Re: Printing UTF-8 mail to terminal

2024-11-01 Thread Loris Bennett via Python-list
Cameron Simpson writes: > On 31Oct2024 16:33, Loris Bennett wrote: >>I have a command-line program which creates an email containing German >>umlauts. On receiving the mail, my mail client displays the subject and >>body correctly: > [...] >>So far, so good. However, when I use the --verbose o

Re: Printing UTF-8 mail to terminal

2024-11-01 Thread Loris Bennett via Python-list
Left Right writes: > There's quite a lot of misuse of terminology around terminal / console > / shell. Please, correct me if I'm wrong, but it looks like you are > printing that on MS Windows, right? MS Windows doesn't have or use > terminals (that's more of a Unix-related concept). And, by "te

Re: Printing UTF-8 mail to terminal

2024-11-01 Thread Loris Bennett via Python-list
"Loris Bennett" writes: > Cameron Simpson writes: > >> On 31Oct2024 16:33, Loris Bennett wrote: >>>I have a command-line program which creates an email containing German >>>umlauts. On receiving the mail, my mail client displays the subject and >>>body correctly: >> [...] >>>So far, so good.

Re: Printing UTF-8 mail to terminal

2024-10-31 Thread Alan Gauld via Python-list
On 31/10/2024 20:50, Cameron Simpson via Python-list wrote: > That looks to me like quoted-printable. This is an encoding for binary > transport of text to make it robust against not 8-buit clean ... > If you're just dealing with this directly, use the `quopri` stdlib > module: https://docs.py

Re: Printing UTF-8 mail to terminal

2024-10-31 Thread Cameron Simpson via Python-list
On 31Oct2024 16:33, Loris Bennett wrote: I have a command-line program which creates an email containing German umlauts. On receiving the mail, my mail client displays the subject and body correctly: [...] So far, so good. However, when I use the --verbose option to print the mail to the ter

Re: Printing UTF-8 mail to terminal

2024-10-31 Thread Left Right via Python-list
There's quite a lot of misuse of terminology around terminal / console / shell. Please, correct me if I'm wrong, but it looks like you are printing that on MS Windows, right? MS Windows doesn't have or use terminals (that's more of a Unix-related concept). And, by "terminal" I mean terminal emula

Re: Printing dict value for possibly undefined key

2023-11-28 Thread Loris Bennett via Python-list
DL Neil writes: > On 11/25/2023 3:31 AM, Loris Bennett via Python-list wrote: >> Hi, >> I want to print some records from a database table where one of the >> fields contains a JSON string which is read into a dict. I am doing >> something like >>print(f"{id} {d['foo']} {d['bar']}") >> Howev

Re: Printing dict value for possibly undefined key

2023-11-28 Thread Loris Bennett via Python-list
duncan smith writes: > On 24/11/2023 16:35, duncan smith wrote: >> On 24/11/2023 14:31, Loris Bennett wrote: >>> Hi, >>> >>> I want to print some records from a database table where one of the >>> fields contains a JSON string which is read into a dict.  I am doing >>> something like >>> >>>    p

Re: Printing dict value for possibly undefined key

2023-11-25 Thread DL Neil via Python-list
On 11/25/2023 3:31 AM, Loris Bennett via Python-list wrote: Hi, I want to print some records from a database table where one of the fields contains a JSON string which is read into a dict. I am doing something like print(f"{id} {d['foo']} {d['bar']}") However, the dict does not always have

Re: Printing dict value for possibly undefined key

2023-11-25 Thread duncan smith via Python-list
On 24/11/2023 16:35, duncan smith wrote: On 24/11/2023 14:31, Loris Bennett wrote: Hi, I want to print some records from a database table where one of the fields contains a JSON string which is read into a dict.  I am doing something like    print(f"{id} {d['foo']} {d['bar']}") However, the d

Re: Printing dict value for possibly undefined key

2023-11-25 Thread duncan smith via Python-list
On 24/11/2023 14:31, Loris Bennett wrote: Hi, I want to print some records from a database table where one of the fields contains a JSON string which is read into a dict. I am doing something like print(f"{id} {d['foo']} {d['bar']}") However, the dict does not always have the same keys, so

Re: Printing Unicode strings in a list

2022-04-30 Thread Chris Angelico
On Sun, 1 May 2022 at 00:03, Vlastimil Brom wrote: > (Even the redundant u prefix from your python2 sample is apparently > accepted, maybe for compatibility reasons.) Yes, for compatibility reasons. It wasn't accepted in Python 3.0, but 3.3 re-added it to make porting easier. It doesn't do anythi

Re: Printing Unicode strings in a list

2022-04-30 Thread Vlastimil Brom
čt 28. 4. 2022 v 13:33 odesílatel Stephen Tucker napsal: > > Hi PythonList Members, > > Consider the following log from a run of IDLE: > > == > > Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] > on win32 > Type "copyright", "credits" or "license()" for m

Re: Printing Unicode strings in a list

2022-04-28 Thread Rob Cliffe via Python-list
On 28/04/2022 14:27, Stephen Tucker wrote: To Cameron Simpson, Thanks for your in-depth and helpful reply. I have noted it and will be giving it close attention when I can. The main reason why I am still using Python 2.x is that my colleagues are still using a GIS system that has a Python pro

Re: Printing Unicode strings in a list

2022-04-28 Thread Jon Ribbens via Python-list
On 2022-04-28, Stephen Tucker wrote: > Hi PythonList Members, > > Consider the following log from a run of IDLE: > >== > > Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] > on win32 > Type "copyright", "credits" or "license()" for more information. p

Re: Printing Unicode strings in a list

2022-04-28 Thread Stephen Tucker
To Cameron Simpson, Thanks for your in-depth and helpful reply. I have noted it and will be giving it close attention when I can. The main reason why I am still using Python 2.x is that my colleagues are still using a GIS system that has a Python programmer's interface - and that interface uses P

Re: Printing Unicode strings in a list

2022-04-28 Thread Cameron Simpson
On 28Apr2022 12:32, Stephen Tucker wrote: >Consider the following log from a run of IDLE: >== > >Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] >on win32 >Type "copyright", "credits" or "license()" for more information. print (u"\u2551") >║ pri

Re: printing to stdout

2018-08-23 Thread richard lucassen
On Mon, 20 Aug 2018 08:19:12 +1000 Cameron Simpson wrote: [sorry for late reply] > Someone else has descibed zip tersely: it pairs it the elements of 2 > lists. In fact it joins up matching elements of an arbitrary number > of iterables. Here is a 3 iterable example: > > >>> zip( (1,2,3), (

Re: printing to stdout

2018-08-19 Thread Cameron Simpson
On 19Aug2018 15:09, richard lucassen wrote: On Sun, 19 Aug 2018 19:53:04 +1000 Cameron Simpson wrote: Although I do not understand what zip is doing exactly here (I presume I switch to use pointers instead of the values), Someone else has descibed zip tersely: it pairs it the elements of 2 li

Re: printing to stdout

2018-08-19 Thread Chris Angelico
On Mon, Aug 20, 2018 at 7:55 AM, Cameron Simpson wrote: > Draw little boxes with arrows. It helps. - Michael J. Eager Draw good boxes. - DeviCat ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: printing to stdout

2018-08-19 Thread Cameron Simpson
On 19Aug2018 18:10, richard lucassen wrote: On Sun, 19 Aug 2018 10:11:08 -0400 Joel Goldstick wrote: Your allusion to pointers is misguided. Python is not like C or assembler. You don't, and don't need to know where objects are stored. Names are assigned to reference data objects I'll hav

Re: printing to stdout

2018-08-19 Thread Richard Lucassen
On Sun, 19 Aug 2018 12:37:18 -0400 Joel Goldstick wrote: > > I'll have another look at it, I was just searching for a clear > > explanation, but the page I found was not clear enough for me. I'll > > have to take some time for it... > > try python.org tutorial, and search for terms like names, o

Re: printing to stdout

2018-08-19 Thread Joel Goldstick
On Sun, Aug 19, 2018 at 12:16 PM Richard Lucassen wrote: > > On Sun, 19 Aug 2018 10:11:08 -0400 > Joel Goldstick wrote: > > > > Well, apparently there were quite a lot of things that makes the > > > code more readable I'd say. And even better. But it was indeed not > > > very unPythony. OTOH, I'm

Re: printing to stdout

2018-08-19 Thread Richard Lucassen
On Sun, 19 Aug 2018 10:11:08 -0400 Joel Goldstick wrote: > > Well, apparently there were quite a lot of things that makes the > > code more readable I'd say. And even better. But it was indeed not > > very unPythony. OTOH, I'm not a programmer, otherwise I would have > > written this in C ;-) >

Re: printing to stdout

2018-08-19 Thread richard lucassen
On Sun, 19 Aug 2018 19:53:04 +1000 Cameron Simpson wrote: > There are always unPythonic bits. Even after you've cleaned them all > up, since people will disagree about the finer points of Pythonicism > there will be bits both over and under cleaned. Although I do not understand what zip is doing

Re: printing to stdout

2018-08-19 Thread Joel Goldstick
On Sun, Aug 19, 2018 at 9:56 AM richard lucassen wrote: > > On Sun, 19 Aug 2018 12:02:51 +0300 > Marko Rauhamaa wrote: > > > richard lucassen : > > > As I'm new to Python, just this question: are there any unPythony > > > things in this code? > > > > Your code looks neat. > > Well, apparently the

Re: printing to stdout

2018-08-19 Thread richard lucassen
On Sun, 19 Aug 2018 12:02:51 +0300 Marko Rauhamaa wrote: > richard lucassen : > > As I'm new to Python, just this question: are there any unPythony > > things in this code? > > Your code looks neat. Well, apparently there were quite a lot of things that makes the code more readable I'd say. And

Re: printing to stdout

2018-08-19 Thread richard lucassen
On Sun, 19 Aug 2018 19:53:04 +1000 Cameron Simpson wrote: [Oops, apparently you set the Reply-To to python-list@python.org, normally that's no problem, but I did something wrong somewhere] > There are always unPythonic bits. Even after you've cleaned them all > up, since people will disagree abo

Re: printing to stdout

2018-08-19 Thread Cameron Simpson
On 19Aug2018 09:32, richard lucassen wrote: This is a working script I made. It initializes the I/O expanders, then it waits for an INT from these I/O expanders on GPIO23, reads the contents and sends which bit on which chip went up or down to a fifo (and stdout for logging) As I'm new to Pytho

Re: printing to stdout

2018-08-19 Thread Marko Rauhamaa
richard lucassen : > As I'm new to Python, just this question: are there any unPythony > things in this code? Your code looks neat. > except IOError: > print ("[ALERT] I/O problem device 0x%x" % list_pcf[i]) Just double check that simply printing the alert is the correct recovery f

Re: printing to stdout

2018-08-19 Thread richard lucassen
On Fri, 17 Aug 2018 08:31:22 +1000 Cameron Simpson wrote: > Just looking at your loop I would be inclined to just call flush once > at the bottom, _before_ the sleep() call: > > sys.stdout.flush() > > Your call; the performance difference will be small, so it tends to > come down to keeping y

Re: printing to stdout

2018-08-17 Thread richard lucassen
On Fri, 17 Aug 2018 08:31:22 +1000 Cameron Simpson wrote: > This isn't specific to Python, you'll find it with most programmes. > (The shell's builtin "echo" command is an exception.) [buffer explanation] I already suspectec a buffered output and to check if it was the buffer, I created a lot o

Re: printing to stdout

2018-08-16 Thread Cameron Simpson
On 16Aug2018 22:37, richard lucassen wrote: I can run a shell script from the commandline as root in which I start a python script as user "ha". The output to stdout and stderr generated by the python script is visible in an xterm: #!/bin/dash exec 2>&1 chpst -u ha:ha:i2c -U ha /usr/local/ha/in

Re: Printing to a file and a terminal at the same time

2017-10-10 Thread MRAB
On 2017-10-10 17:00, Vail, Rick wrote: I have a script for Cisco devices that will do configuration or any CLI command. What I would like to do is print the output to my terminal(windows) and to a file. I can come up with stdout parameters To print to a file but not to the screen and when I re

RE: Printing to a file and a terminal at the same time

2017-10-10 Thread Vail, Rick
I have a script for Cisco devices that will do configuration or any CLI command. What I would like to do is print the output to my terminal(windows) and to a file. I can come up with stdout parameters To print to a file but not to the screen and when I remove the stdout part it prints to the sc

Re: Printing a Chunk Of Words

2017-09-28 Thread Mark Lawrence via Python-list
On 26/09/2017 01:15, Cai Gengyang wrote: """ Boolean Operators True and True is True True and False is False False and True is False False and False is False True or True is True True or False is True False or True is True False or False is False Not True is False

Re: Printing a Chunk Of Words

2017-09-27 Thread Matt Wheeler
On Wed, 27 Sep 2017 at 14:48 Peter Otten <__pete...@web.de> wrote: > > Reproducing the original string exactly the best I've managed is 260: > > That's a bit long, don't you think, as it can be beaten even by plain old > zipping: > ha! tbh yes It's longer than I was expecting to manage. $ cat bo

Re: Printing a Chunk Of Words

2017-09-27 Thread Thomas Jollans
On 2017-09-27 16:38, Matt Wheeler wrote: > On Wed, 27 Sep 2017 at 13:58 Thomas Jollans wrote: > >>> Reproducing the original string exactly the best I've managed is 260: >>> >>> t,f,a,o,n='True','False','and','or','not' >> >> The Not is capitalized in the original string. >> > > I guess you didn

Re: Printing a Chunk Of Words

2017-09-27 Thread Matt Wheeler
On Wed, 27 Sep 2017 at 13:58 Thomas Jollans wrote: > > Reproducing the original string exactly the best I've managed is 260: > > > > t,f,a,o,n='True','False','and','or','not' > > The Not is capitalized in the original string. > I guess you didn't try it? (or see `upper()` in the body of the `for

Re: Printing a Chunk Of Words

2017-09-27 Thread Peter Otten
Matt Wheeler wrote: > With deepest apologies to all involved... > > On Tue, 26 Sep 2017 at 08:42 Gregory Ewing > wrote: > >> Ben Bacarisse wrote: >> > Think functional! This is 257 characters: >> >> 250 chars, 17 shorter than the text it produces: >> >> a=[];o=[];n=[];A=list.append >> for b in

Re: Printing a Chunk Of Words

2017-09-27 Thread Thomas Jollans
On 2017-09-27 13:51, Matt Wheeler wrote: > With deepest apologies to all involved... > > On Tue, 26 Sep 2017 at 08:42 Gregory Ewing > wrote: > >> Ben Bacarisse wrote: >>> Think functional! This is 257 characters: >> >> 250 chars, 17 shorter than the text it produces: >> >> a=[];o=[];n=[];A=list

Re: Printing a Chunk Of Words

2017-09-27 Thread Matt Wheeler
With deepest apologies to all involved... On Tue, 26 Sep 2017 at 08:42 Gregory Ewing wrote: > Ben Bacarisse wrote: > > Think functional! This is 257 characters: > > 250 chars, 17 shorter than the text it produces: > > a=[];o=[];n=[];A=list.append > for b in range(3,-1,-1): > x=bool(b>>1);y=bo

Re: Printing a Chunk Of Words

2017-09-26 Thread Gregory Ewing
Ben Bacarisse wrote: Think functional! This is 257 characters: 250 chars, 17 shorter than the text it produces: a=[];o=[];n=[];A=list.append for b in range(3,-1,-1): x=bool(b>>1);y=bool(b&1);A(a,"%s and %s is %s"%(x,y,x and y));A(o,"%s or %s is %s"%(x,y,x or y)) if x:A(n,"not %s is %s"%(y

Re: Printing a Chunk Of Words

2017-09-25 Thread Ben Bacarisse
r...@zedat.fu-berlin.de (Stefan Ram) writes: > Cai Gengyang writes: >> Boolean Operators >> >>True and True is True >>True and False is False >>False and True is False >>False and False is False >>True or True is True >>True or False is True >>False or True is Tr

Re: Printing a Chunk Of Words

2017-09-25 Thread Steve D'Aprano
On Tue, 26 Sep 2017 10:15 am, Cai Gengyang wrote: > """ [snip text] > """ > > If I simply want to print a chunk of words and a paragraph like the above, > what command should I use ? Print to the terminal? Use print(). Print to an actual printer? There's no built-in command in Python to do so,

Re: Printing a Chunk Of Words

2017-09-25 Thread Rick Johnson
On Monday, September 25, 2017 at 7:15:41 PM UTC-5, Cai Gengyang wrote: > """ > Boolean Operators > > True and True is True > True and False is False > False and True is False > False and False is False > > True or True is True > True or False is True > False or

Re: Printing a Chunk Of Words

2017-09-25 Thread Chris Angelico
On Tue, Sep 26, 2017 at 10:15 AM, Cai Gengyang wrote: > """ > Boolean Operators > > True and True is True > True and False is False > False and True is False > False and False is False > > True or True is True > True or False is True > False or True is True > False or

Re: Printing a generator returns "", need to print its values

2016-12-05 Thread Steve D'Aprano
On Tue, 6 Dec 2016 05:39 am, vmaha...@centerpointmedia.com wrote: > Can someone help me print a generator object? The same way as you print any other object: print(obj) # Python 3 print obj # Python 2 But what you're actually asking for is a way to print the values produced by the generator

Re: Printing a generator returns "", need to print its values

2016-12-05 Thread Irmen de Jong
On 5-12-2016 19:39, vmaha...@centerpointmedia.com wrote: > On Wednesday, November 16, 2016 at 3:25:39 PM UTC-5, Peter Otten wrote: >> vmaha...@centerpointmedia.com wrote: >> >>> I am running Python2.7, wherein I am running the following price of code: >>> >>> y = m.predict(input_fn=lambda:input_fn(

Re: Printing a generator returns "", need to print its values

2016-12-05 Thread vmahajan
On Wednesday, November 16, 2016 at 3:25:39 PM UTC-5, Peter Otten wrote: > vmaha...@centerpointmedia.com wrote: > > > I am running Python2.7, wherein I am running the following price of code: > > > > y = m.predict(input_fn=lambda:input_fn(df_predict), as_iterable=True) > > print ('Predictions: {}'

Re: printing funny symbols within spyder ide

2016-11-25 Thread Nathan Ernst
You're attempting to print out control characters most of which have no visible representation. For "\7", at least if you're running from bash, and not in an IDE, you should get an audible bell. All decimal ordinals below 32 are control You can find a list of the symbols here: http://en.cppreferen

Re: Printing a generator returns "", need to print its values

2016-11-16 Thread Peter Otten
vmaha...@centerpointmedia.com wrote: > I am running Python2.7, wherein I am running the following price of code: > > y = m.predict(input_fn=lambda:input_fn(df_predict), as_iterable=True) > print ('Predictions: {}'.format(str(y))) > > The output of the following is "" 0x7f0476373e10>" > > Howeve

Re: Printing a generator returns "", need to print its values

2016-11-16 Thread MRAB
On 2016-11-16 20:01, vmaha...@centerpointmedia.com wrote: I am running Python2.7, wherein I am running the following price of code: y = m.predict(input_fn=lambda:input_fn(df_predict), as_iterable=True) print ('Predictions: {}'.format(str(y))) The output of the following is """ However, the des

Re: Printing to printer, windows 7

2015-02-17 Thread MRAB
On 2015-02-18 01:41, Dennis Lee Bieber wrote: On Mon, 16 Feb 2015 22:02:33 -0500, Dave Angel declaimed the following: It is a simple problem. All you have to do is send the correct bytes to a file object that will transfer those bytes to the printer. It's been a long time since I used Windo

Re: Printing to printer, windows 7

2015-02-17 Thread sohcahtoa82
On Monday, February 16, 2015 at 6:08:33 PM UTC-8, ken.h...@gmail.com wrote: > Would seem to be a simple problem. I just want to print to my printer > instead of the console using Python 2.7, Windows 7. Hours of looking through > FAQ's and Google haven't yielded a solution. Any suggestions appr

Re: Printing to printer, windows 7

2015-02-17 Thread sjmsoft
On Monday, February 16, 2015 at 10:08:33 PM UTC-4, ken.h...@gmail.com wrote: > Would seem to be a simple problem. I just want to print to my printer > instead of the console using Python 2.7, Windows 7. Hours of looking through > FAQ's and Google haven't yielded a solution. Any suggestions app

Re: Printing to printer, windows 7

2015-02-16 Thread Dave Angel
On 02/16/2015 09:08 PM, ken.hes...@gmail.com wrote: Would seem to be a simple problem. I just want to print to my printer instead of the console using Python 2.7, Windows 7. Hours of looking through FAQ's and Google haven't yielded a solution. Any suggestions appreciated -- It is a simple

Re: Printing characters outside of the ASCII range

2014-03-19 Thread Mark Lawrence
On 19/03/2014 14:43, Zachary Ware wrote: Ironically, on my way down the November 2012 archive page, I noticed a long thread about "Obnoxious postings from Google Groups". Thankfully the number of grotty postings from gg has dropped considerably. Sadly our resident unicode expert quite delibe

Re: Printing characters outside of the ASCII range

2014-03-19 Thread Zachary Ware
On 19/03/2014 13:11, diccon.tes...@gmail.com wrote: > Your handling Pick Multi value fields aren't you ;) > Just hit the same issue, thanks all here for various solutions. > Interfacing with OpenQM / Scarlet DME here. For future posts, please be sure to quote what you're replying to. Google Groups

Re: Printing characters outside of the ASCII range

2014-03-19 Thread Mark Lawrence
On 19/03/2014 13:11, diccon.tes...@gmail.com wrote: Your handling Pick Multi value fields aren't you ;) Just hit the same issue, thanks all here for various solutions. Interfacing with OpenQM / Scarlet DME here. The context is conspicious by its absence. In future would you please be kind en

Re: Printing characters outside of the ASCII range

2014-03-19 Thread diccon . tesson
Your handling Pick Multi value fields aren't you ;) Just hit the same issue, thanks all here for various solutions. Interfacing with OpenQM / Scarlet DME here. -- https://mail.python.org/mailman/listinfo/python-list

Re: Printing appropriately based on values retrieved

2013-11-02 Thread Nick the Gr33k
Στις 2/11/2013 8:25 μμ, ο/η Nick the Gr33k έγραψε: for row in newdata: (host, refs, city, useros, browser, visits, hits, downloads) = row if downloads != 'Δεν έχει κατεβάσει ταινία': print( '' ) for n, download in enumerate( downloads ): if n == 0:

Re: Printing a drop down menu for a specific field.

2013-10-27 Thread rurpy
On 10/27/2013 01:31 AM, Nick the Gr33k wrote: > Στις 27/10/2013 6:00 πμ, ο/η ru...@yahoo.com έγραψε: >[...] [following quote lightly edited for clarity] > I almost understand your code, but this part is not so clear to me: > key = host, city, useros, browser > if key not in seen: newdata

Re: Printing a drop down menu for a specific field.

2013-10-27 Thread Dave Angel
On 27/10/2013 03:31, Nick the Gr33k wrote: > Στις 27/10/2013 6:00 πμ, ο/η ru...@yahoo.com έγραψε: > > I read it thoroughly and tested it and it works as it should. > > I just wanted to mention that the definition of the function coalesce() > must come prior of: > >> newdata = coal

Re: Printing a drop down menu for a specific field.

2013-10-27 Thread Nick the Gr33k
Στις 27/10/2013 6:00 πμ, ο/η ru...@yahoo.com έγραψε: On 10/26/2013 06:11 PM, Nick the Gr33k wrote: Στις 27/10/2013 2:52 πμ, ο/η Nick the Gr33k έγραψε: Ah foun it had to change in you code this line: key = host, city, useros, browser, ref to this line: key = host, c

Re: Printing a drop down menu for a specific field.

2013-10-26 Thread rurpy
On 10/26/2013 06:11 PM, Nick the Gr33k wrote: > Στις 27/10/2013 2:52 πμ, ο/η Nick the Gr33k έγραψε: >> Ah foun it had to change in you code this line: >> key = host, city, useros, browser, ref >> >> to this line: >> >> key = host, city, useros, browser >> >> so 'ref' would

Re: Printing a drop down menu for a specific field.

2013-10-26 Thread Nick the Gr33k
Στις 27/10/2013 2:52 πμ, ο/η Nick the Gr33k έγραψε: Ah foun it had to change in you code this line: key = host, city, useros, browser, ref to this line: key = host, city, useros, browser so 'ref' wouldnt be calculated in the unique combination key. I'am still trying

Re: Printing a drop down menu for a specific field.

2013-10-26 Thread Nick the Gr33k
Στις 27/10/2013 2:31 πμ, ο/η Nick the Gr33k έγραψε: Στις 26/10/2013 9:33 μμ, ο/η ru...@yahoo.com έγραψε: On 10/20/2013 05:30 PM, Νίκος Αλεξόπουλος wrote: try: cur.execute( '''SELECT host, city, useros, browser, ref, hits, lastvisit FROM visitors WHERE counterID = (SELECT ID FROM counters WH

Re: Printing a drop down menu for a specific field.

2013-10-26 Thread Nick the Gr33k
Στις 26/10/2013 9:33 μμ, ο/η ru...@yahoo.com έγραψε: On 10/20/2013 05:30 PM, Νίκος Αλεξόπουλος wrote: try: cur.execute( '''SELECT host, city, useros, browser, ref, hits, lastvisit FROM visitors WHERE counterID = (SELECT ID FROM counters WHERE url = %s) ORDER BY lastvisit DESC''', page )

Re: Printing a drop down menu for a specific field.

2013-10-26 Thread rurpy
On 10/20/2013 05:30 PM, Νίκος Αλεξόπουλος wrote: > try: > cur.execute( '''SELECT host, city, useros, browser, ref, hits, > lastvisit FROM visitors WHERE counterID = (SELECT ID FROM counters WHERE > url = %s) ORDER BY lastvisit DESC''', page ) > data = cur.fetchall() > >

Re: Printing a drop down menu for a specific field.

2013-10-26 Thread Steven D'Aprano
On Sat, 26 Oct 2013 18:40:52 +0300, Nick the Gr33k wrote: > Can someone write this properly? i tried but cannot make it work. Start by writing down what problem you are trying to solve with this code, and what you expect the code to do. In detail. What input data does it take, what result shoul

Re: Printing a drop down menu for a specific field.

2013-10-26 Thread Nick the Gr33k
Στις 26/10/2013 5:10 μμ, ο/η Nick the Gr33k έγραψε: [QUOTE=turvey]Say your data is like the following: data = [('alice', 1), ('alice', 2), ('bob', 5), ('bob', 10), ('carrie', 3)] Where the first entry is your user and the second entry is a timestamp. Your data is structured basically like this,

Re: Printing a drop down menu for a specific field.

2013-10-21 Thread Joel Goldstick
On Mon, Oct 21, 2013 at 3:31 AM, Mark Lawrence wrote: > > On 21/10/2013 07:07, Νίκος Αλεξόπουλος wrote: >> >> >> Any help would be appreciated. > > > It is considered polite to wait for at least 24 hours before pinging. If > waiting for this time isn't an option then paying for support is. > > --

Re: Printing a drop down menu for a specific field.

2013-10-21 Thread Νίκος Αλεξόπουλος
Στις 21/10/2013 9:58 πμ, ο/η Steven D'Aprano έγραψε: On Mon, 21 Oct 2013 09:07:17 +0300, Νίκος Αλεξόπουλος wrote: for row in data: (host, city, useros, browser, ref, hits, lastvisit) = row lastvisit = lastvisit.strftime('%A %e %b, %H:%M') print( "" )

Re: Printing a drop down menu for a specific field.

2013-10-21 Thread Mark Lawrence
On 21/10/2013 07:07, Νίκος Αλεξόπουλος wrote: Any help would be appreciated. It is considered polite to wait for at least 24 hours before pinging. If waiting for this time isn't an option then paying for support is. -- Python is the second best programming language in the world. But the bes

Re: Printing a drop down menu for a specific field.

2013-10-21 Thread Steven D'Aprano
On Mon, 21 Oct 2013 09:07:17 +0300, Νίκος Αλεξόπουλος wrote: >> for row in data: >> (host, city, useros, browser, ref, hits, lastvisit) = row >> lastvisit = lastvisit.strftime('%A %e %b, %H:%M') >> >> print( "" ) >> for item in (host, city, useros, browser,

Re: Printing a drop down menu for a specific field.

2013-10-20 Thread Ben Finney
Νίκος Αλεξόπουλος writes: > Any help would be appreciated. Please stop posting merely for grabbing attention. If someone is going to answer, they'll answer. Don't annoy the forum with pleas for attention. -- \“Program testing can be a very effective way to show the | `\

Re: Printing a drop down menu for a specific field.

2013-10-20 Thread Νίκος Αλεξόπουλος
Στις 21/10/2013 2:30 πμ, ο/η Νίκος Αλεξόπουλος έγραψε: try: cur.execute( '''SELECT host, city, useros, browser, ref, hits, lastvisit FROM visitors WHERE counterID = (SELECT ID FROM counters WHERE url = %s) ORDER BY lastvisit DESC''', page ) data = cur.fetchall() for row in data:

Re: Printing time in "at" format?

2012-11-20 Thread Roy Smith
On Nov 20, 2012, at 1:16 PM, Tim Chase wrote: > Your statement can be ambiguously parsed as "I need to merely > *generate* time specifications that 'at' can parse", or it can be > parsed as "I need to generate *and consume* time specifications the > same way as 'at' does" > > If it's the former,

Re: Printing a text over an image

2012-11-15 Thread Marco Nawijn
On Wednesday, November 7, 2012 5:52:36 PM UTC+1, Martha Morrigan wrote: > Hi guys, > > > > Using python, wxpython and sqlite in a windows system, Im trying to > > print some certificates/diplomas/cards with a image at background with > > the name of person/text over it. > > > > I know the b

Re: Printing characters outside of the ASCII range

2012-11-11 Thread Lele Gaifax
danielk writes: > Ian's solution gives me what I need (thanks Ian!). But I notice a > difference between '__str__' and '__repr__'. > > class Pytest(str): > def __init__(self, data = None): > if data == None: data = "" > self.data = data > > def __repr__(self): > re

Re: Printing characters outside of the ASCII range

2012-11-11 Thread Thomas Rachel
Am 09.11.2012 18:17 schrieb danielk: I'm using this character as a delimiter in my application. Then you probably use the *byte* 254 as opposed to the *character* 254. So it might be better to either switch to byte strings, or output the representation of the string instead of itself. So d

Re: Printing characters outside of the ASCII range

2012-11-11 Thread danielk
On Friday, November 9, 2012 5:11:12 PM UTC-5, Ian wrote: > On Fri, Nov 9, 2012 at 2:46 PM, danielk wrote: > > > D:\home\python>pytest.py > > > Traceback (most recent call last): > > > File "D:\home\python\pytest.py", line 1, in > > > print(chr(253).decode('latin1')) > > > AttributeErro

Re: Printing characters outside of the ASCII range

2012-11-10 Thread wxjmfauth
Le vendredi 9 novembre 2012 18:17:54 UTC+1, danielk a écrit : > I'm converting an application to Python 3. The app works fine on Python 2. > > > > Simply put, this simple one-liner: > > > > print(chr(254)) > > > > errors out with: > > > > Traceback (most recent call last): > > File "

  1   2   3   4   5   >