Re: [Tutor] printing items form list

2017-03-03 Thread David Rock
> On Mar 3, 2017, at 13:42, dirkjso...@gmail.com wrote: > > On 03/03/2017 12:19 PM, Alan Gauld via Tutor wrote: >> >> That's one reason why join() is a better solution, it >> handles all of that for you. It's also faster, although >> in a small application you'd never

Re: [Tutor] printing items form list

2017-03-03 Thread dirkjso...@gmail.com
On 03/03/2017 12:19 PM, Alan Gauld via Tutor wrote: On 03/03/17 18:52, Peter Otten wrote: Antonio Zagheni via Tutor wrote: suitcase = ["book, ", "towel, ", "shirt, ", "pants"] Hm, looks like you opened Rafael's suitcase while he wasn't looking, and sneaked in some commas and spaces ;)

Re: [Tutor] printing items form list

2017-03-03 Thread Alan Gauld via Tutor
On 03/03/17 18:52, Peter Otten wrote: > Antonio Zagheni via Tutor wrote: > >> suitcase = ["book, ", "towel, ", "shirt, ", "pants"] > > Hm, looks like you opened Rafael's suitcase while he wasn't looking, and > sneaked in some commas and spaces ;) > > That's cheating... Its also very

Re: [Tutor] printing items form list

2017-03-03 Thread David Rock
> On Mar 3, 2017, at 12:52, Peter Otten <__pete...@web.de> wrote: > > Antonio Zagheni via Tutor wrote: > >> suitcase = ["book, ", "towel, ", "shirt, ", "pants"] > > Hm, looks like you opened Rafael's suitcase while he wasn't looking, and > sneaked in some commas and spaces ;) > > That's

Re: [Tutor] printing items form list

2017-03-03 Thread Peter Otten
Antonio Zagheni via Tutor wrote: > suitcase = ["book, ", "towel, ", "shirt, ", "pants"] Hm, looks like you opened Rafael's suitcase while he wasn't looking, and sneaked in some commas and spaces ;) That's cheating... ___ Tutor maillist -

Re: [Tutor] printing items form list

2017-03-03 Thread Antonio Zagheni via Tutor
ting items form list (Rafael Knuth)   2. Re: printing items form list (Peter Otten) -- Message: 1 Date: Fri, 3 Mar 2017 13:12:23 +0100 From: Rafael Knuth <rafael.kn...@gmail.com> To: "Tutor@python.org" <Tutor@p

Re: [Tutor] printing items form list

2017-03-03 Thread Mats Wichmann
On 03/03/2017 05:12 AM, Rafael Knuth wrote: > I want to print individual items from a list like this: > > You have a book, towel, shirt, pants in your luggage. > > This is my code: > > suitcase = ["book", "towel", "shirt", "pants"] > print ("You have a %s in your luggage." % suitcase) > >

Re: [Tutor] printing items form list

2017-03-03 Thread Peter Otten
Rafael Knuth wrote: > I want to print individual items from a list like this: > > You have a book, towel, shirt, pants in your luggage. > > This is my code: > > suitcase = ["book", "towel", "shirt", "pants"] > print ("You have a %s in your luggage." % suitcase) > > Instead of printing out the

[Tutor] printing items form list

2017-03-03 Thread Rafael Knuth
I want to print individual items from a list like this: You have a book, towel, shirt, pants in your luggage. This is my code: suitcase = ["book", "towel", "shirt", "pants"] print ("You have a %s in your luggage." % suitcase) Instead of printing out the items on the list, my code appends the

[Tutor] Printing a list without square brackets, was Re: Hi Tutor

2016-01-09 Thread Peter Otten
yehudak . wrote: > I wrote this short program for my grandson: Nothing against a little help here and there, but solving a problem can be fun, and you are taking away some of that fun. Does your grandson speak English? You might encourage him to post here himself. We bite, but only grandpas

[Tutor] printing all text that begins with 25

2014-10-02 Thread Bo Morris
Hello all, hope everyone is doing well. When I run the linux command hamachi list i get something along the lines of the following output 087-888-279 Pandora25.x.x.xxx alias: not set 096-779-867 AM1LaptopBD-PC25.x.x.xxx alias: not set

Re: [Tutor] printing all text that begins with 25

2014-10-02 Thread Dave Angel
Bo Morris crushe...@gmail.com Wrote in message: (Thanks for starting a new thread when asking a new question. But please use text mode in your emails, not html.) For the first version, write it as a filter, and pipe the two commands together in the shell. So all you have to do is read a

Re: [Tutor] printing all text that begins with 25

2014-10-02 Thread David Rock
* Bo Morris crushe...@gmail.com [2014-10-02 11:41]: Hello all, hope everyone is doing well. When I run the linux command hamachi list i get something along the lines of the following output 087-888-279 Pandora25.x.x.xxx alias: not set

Re: [Tutor] printing all text that begins with 25

2014-10-02 Thread Crush
Yes the format is always the same and the IPs will always be in the 3rd collumn; although, the amount of whitspace that seperates column 2 and 3 may be different depending on how long the name is in column 2. Also all of the IPs will begin with a 25, so there would be no fear of having to deal

Re: [Tutor] printing all text that begins with 25

2014-10-02 Thread Sebastian Silva
El jue, 2 de oct 2014 a las 11:33 AM, David Rock da...@graniteweb.com escribió: A regex may be possible, but you will have similar issues to using split. In my humble experience, a regex is the way to go: import re ip = re.findall( r'[0-9]+(?:\.[0-9]+){3}', s ) you will get a list of IP

Re: [Tutor] printing all text that begins with 25

2014-10-02 Thread John Doe
Hello, If you want to accomplish what you are looking for within linux (perhaps a bash script, instead?): $ hamachi list | grep -oP '25\.\d+\.\d+\.\d+' 25.0.0.0 25.255.255.255 For your python script, you want to group your regex: reg = re.compile(r'(25\.\d+\.\d+\.\d+)', re.MULTILINE) So when

Re: [Tutor] printing all text that begins with 25

2014-10-02 Thread Alan Gauld
On 02/10/14 16:41, Bo Morris wrote: of the following output 087-888-279 Pandora25.x.x.xxx alias: not set 096-779-867 AM1LaptopBD-PC25.x.x.xxx alias: not set 097-552-220 OWS-Desktop 125.0.0.0 alias: not set

Re: [Tutor] printing all text that begins with 25

2014-10-02 Thread Martin A. Brown
Hi Bo, I am trying to write a python script that will run the above command and only print out the IP's that begin with 25. How do I strip out all other text except for the IP's that begin with 25? I liked the suggestion by John Doe earlier that this is a pretty good case for 'grep', but

Re: [Tutor] Printing a list count - Help

2014-08-30 Thread boB Stepp
On Fri, Aug 29, 2014 at 2:17 PM, Derek Jenkins derektjenk...@gmail.com wrote: Hi everybody, I have a list that I want to go through and finally print a total count of particular items. In this case, I want to print the result of how many A's and B's are in the list. honor_roll_count = 0

[Tutor] Printing a list count - Help

2014-08-29 Thread Derek Jenkins
Hi everybody, I have a list that I want to go through and finally print a total count of particular items. In this case, I want to print the result of how many A's and B's are in the list. honor_roll_count = 0 student_grades = [A, C, B, B, C, A, F, B, B, B, C, A] for grades in student_grades:

Re: [Tutor] Printing a list count - Help

2014-08-29 Thread Danny Yoo
The above code prints 8 lines, each being an entry for which item in the list was either A or B. Again, I'm looking for the result to be the number 8 itself - the total number of instances that A or B occurs in the list. Hi Derek, Hint: the code currently prints a variable within the loop.

Re: [Tutor] Printing a list count - Help

2014-08-29 Thread Derek Jenkins
honor_roll_count = 0 student_grades = [A, C, B, B, C, A, F, B, B, B, C, A] for grades in student_grades: if grades == A or grades == B: honor_roll_count = honor_roll_count + 1 print honor_roll_count That works more to my liking. Thanks a million, Danny and Bob! On Fri, Aug 29,

Re: [Tutor] Printing a list count - Help

2014-08-29 Thread Derek Jenkins
Alex, Thanks for taking this one step further! I do appreciate it... +1 On Fri, Aug 29, 2014 at 3:48 PM, Alex Kleider aklei...@sonic.net wrote: On 2014-08-29 12:17, Derek Jenkins wrote: Hi everybody, I have a list that I want to go through and finally print a total count of particular

Re: [Tutor] Printing a list count - Help

2014-08-29 Thread Alan Gauld
On 29/08/14 20:17, Derek Jenkins wrote: Hi everybody, I have a list that I want to go through and finally print a total count of particular items. In this case, I want to print the result of how many A's and B's are in the list. honor_roll_count = 0 student_grades = [A, C, B, B, C, A, F, B, B,

[Tutor] Printing multi-line variables horizontally

2014-08-08 Thread Greg Markham
Hello, Python novice back again. :) I'm making progress in my learning process, but struggling whenever attempting to creatively go beyond what's required in the various chapter assignments. For example, there's a simple random die roller program that looks like the following: # Craps Roller

Re: [Tutor] Printing multi-line variables horizontally

2014-08-08 Thread Joel Goldstick
On Fri, Aug 8, 2014 at 4:50 AM, Greg Markham greg.mark...@gmail.com wrote: Hello, Python novice back again. :) I'm making progress in my learning process, but struggling whenever attempting to creatively go beyond what's required in the various chapter assignments. For example, there's a

Re: [Tutor] Printing multi-line variables horizontally

2014-08-08 Thread emile
On 08/08/2014 01:50 AM, Greg Markham wrote: die_1 = .-. | | | o | | | `-' die_2 = .-. |o| | | |o| `-' I'll leave the cleanup as an exercise for you. HTH, Emile ___ Tutor maillist - Tutor@python.org To

Re: [Tutor] Printing multi-line variables horizontally

2014-08-08 Thread Alan Gauld
On 08/08/14 09:50, Greg Markham wrote: I wanted to make it a little more interesting by using ascii art representations of the six die. When printing, however, they do so vertically and not horizontally. Here's a snippet of the code: die_1 = .-. | | | o | | | `-' The

Re: [Tutor] Printing multi-line variables horizontally

2014-08-08 Thread Danny Yoo
On Fri, Aug 8, 2014 at 1:50 AM, Greg Markham greg.mark...@gmail.com wrote: Hello, Python novice back again. :) I'm making progress in my learning process, but struggling whenever attempting to creatively go beyond what's required in the various chapter assignments. For example, there's a

Re: [Tutor] Printing multi-line variables horizontally

2014-08-08 Thread Mark Lawrence
On 08/08/2014 18:56, Joel Goldstick wrote: On Fri, Aug 8, 2014 at 4:50 AM, Greg Markham greg.mark...@gmail.com wrote: Hello, Python novice back again. :) I'm making progress in my learning process, but struggling whenever attempting to creatively go beyond what's required in the various

Re: [Tutor] Printing multi-line variables horizontally

2014-08-08 Thread emile
On 08/08/2014 10:58 AM, emile wrote: On 08/08/2014 01:50 AM, Greg Markham wrote: die_1 = .-. | | | o | | | `-' die_2 = .-. |o| | | |o| `-' Not quite sure how this part was dropped... for line in zip(die_1.split(\n),die_2.split(\n)): print line

Re: [Tutor] Printing multi-line variables horizontally

2014-08-08 Thread Steven D'Aprano
On Fri, Aug 08, 2014 at 01:50:53AM -0700, Greg Markham wrote: [...] So, how would I get this to display horizontally? Like so... .-. .-. | | |o| | o | | | | | |o| `-' `-' Nice question! I recommend that you try to solve the problem

Re: [Tutor] Printing from python

2014-03-21 Thread Lee Harr
is there another way to print a PDF form python? My problem is a PDF which is printed well by evince, but not with lp,  even not out of python using os.system(lp some_options file.pdf) Later on I have to build the PDF in a python program (using reportlab)  and then print it, even from the

[Tutor] Printing from python

2014-03-14 Thread Ulrich Goebel
Hallo, is there another way to pritt a PDF form python? My problem is a PDF which is printed well by evince, but not with lp, even not out of python using os.system(lp some_options file.pdf) Later on I have to build the PDF in a python program (using reportlab) and then print it, even from

Re: [Tutor] Printing from python

2014-03-14 Thread Ulrich Goebel
I just found a hint, the Qt QPrinter Class. I use Qt, so that could be a solution? Am 14.03.2014 11:40, schrieb Ulrich Goebel: Hallo, is there another way to pritt a PDF form python? My problem is a PDF which is printed well by evince, but not with lp, even not out of python using

Re: [Tutor] Printing from python

2014-03-14 Thread Ulrich Goebel
Am 14.03.2014 11:40, schrieb Ulrich Goebel: is there another way to pritt a PDF form python? sorry, that doesn't make sense. I should say: is there another way ... besides os.system()? -- Ulrich Goebel Paracelsusstr. 120, 53177 Bonn ___ Tutor

Re: [Tutor] Printing from python

2014-03-14 Thread Russel Winder
On Fri, 2014-03-14 at 11:40 +0100, Ulrich Goebel wrote: Hallo, is there another way to pritt a PDF form python? My problem is a PDF which is printed well by evince, but not with lp, even not out of python using os.system(lp some_options file.pdf) Python is deprecating os.system in

Re: [Tutor] Printing from python

2014-03-14 Thread Timo
op 14-03-14 12:14, Ulrich Goebel schreef: I just found a hint, the Qt QPrinter Class. I use Qt, so that could be a solution? This would be your best bet, use the tools which are provided. I'm a GTK user and use the GTK printing API to both create and print reports. If you want to use cups,

Re: [Tutor] Printing from python

2014-03-14 Thread Alan Gauld
On 14/03/14 10:40, Ulrich Goebel wrote: Later on I have to build the PDF in a python program (using reportlab) and then print it, even from the python program. So I look for a (nice documented) library which give access to the CUPS API or something else to print the PDF from python. I may be

Re: [Tutor] Printing from python

2014-03-14 Thread Ben Finney
Ulrich Goebel m...@fam-goebel.de writes: So I look for a (nice documented) library which give access to the CUPS API or something else to print the PDF from python. Any help is welcome! The problem isn't really one to be solved within your program, IMO. Printing is implemented as a service

Re: [Tutor] Printing list in a Column

2012-08-31 Thread Alan Gauld
On 31/08/12 02:12, Ashley Fowler wrote: Can anyone help me edit this code below to return the list in the form of a column instead of a row? def printList(): list1 = input(Insert a list) list = [list1] print (list) First you need to convert the string that your user types into

[Tutor] Printing a list as a column

2012-08-30 Thread Ashley Fowler
Does anyone know how to print a list in a form of a column instead of a row? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Printing a list as a column

2012-08-30 Thread Mark Lawrence
On 31/08/2012 01:15, Ashley Fowler wrote: Does anyone know how to print a list in a form of a column instead of a row? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

[Tutor] Printing list in a Column

2012-08-30 Thread Ashley Fowler
Can anyone help me edit this code below to return the list in the form of a column instead of a row? def printList(): list1 = input(Insert a list) list = [list1] print (list) ___ Tutor maillist - Tutor@python.org To unsubscribe or

Re: [Tutor] Printing list in a Column

2012-08-30 Thread Mark Lawrence
On 31/08/2012 02:12, Ashley Fowler wrote: Can anyone help me edit this code below to return the list in the form of a column instead of a row? def printList(): list1 = input(Insert a list) list = [list1] print (list) ___ Tutor

Re: [Tutor] Printing with no newline :(

2011-11-07 Thread Sarma Tangirala
On 6 November 2011 21:09, Alan Gauld alan.ga...@btinternet.com wrote: On 06/11/11 10:23, Sarma Tangirala wrote: I'm sorry. Didn't notice the python 3 part, I just joined the list and did not look at the OPs post. Sorry about that. welcome to the list :-) Please bear with me on this,

Re: [Tutor] Printing with no newline :(

2011-11-07 Thread Prasad, Ramit
for line in file: m = re.search(regexp, line) if m: letterGroup = m.group(0) print(letterGroup[4]) You can specify what to print after the argument(s) with the end keyword parameter: items = 1, 2, 3 for item in items: ... print(item, end= ) ...

[Tutor] Printing with no newline :(

2011-11-06 Thread Joe Batt
I am learning Python 3 and programming and am very new so please bear with me… I am writing a program to pull out specific characters in a sequence and then print then out. So far so good however when the characters are printed out they pint on separate lines as opposed to what I want, all on

Re: [Tutor] Printing with no newline :(

2011-11-06 Thread Sarma Tangirala
On 6 November 2011 13:11, Peter Otten __pete...@web.de wrote: Joe Batt wrote: I am learning Python 3 and programming and am very new so please bear with me… I am writing a program to pull out specific characters in a sequence and then print then out. So far so good however when the

Re: [Tutor] Printing with no newline :(

2011-11-06 Thread Dave Angel
On 11/06/2011 04:45 AM, Sarma Tangirala wrote: On 6 November 2011 13:11, Peter Otten__pete...@web.de wrote: Joe Batt wrote: I am learning Python 3 and programming and am very new so please bear SNIP for item in items: ... print(item, end=WHATEVER) Another way of writing the above.

Re: [Tutor] Printing with no newline :(

2011-11-06 Thread Sarma Tangirala
On 6 November 2011 15:47, Dave Angel d...@davea.name wrote: On 11/06/2011 04:45 AM, Sarma Tangirala wrote: On 6 November 2011 13:11, Peter Otten__pete...@web.de wrote: Joe Batt wrote: I am learning Python 3 and programming and am very new so please bear SNIP for item in items:

Re: [Tutor] Printing with no newline :(

2011-11-06 Thread Sarma Tangirala
I am so very sorry for the noise. I was careless in reading the OPs post. On 6 November 2011 15:53, Sarma Tangirala tvssarma.ome...@gmail.com wrote: On 6 November 2011 15:47, Dave Angel d...@davea.name wrote: On 11/06/2011 04:45 AM, Sarma Tangirala wrote: On 6 November 2011 13:11, Peter

Re: [Tutor] Printing with no newline :(

2011-11-06 Thread Dave Angel
On 11/06/2011 05:23 AM, Sarma Tangirala wrote: SNIP python 3 SNIP. Please bear with me on this, but does the following not print end for every iteration of items? for item in items: print(item, end=) Sure it does. And the value of end is the empty string. So it prints nothing but

Re: [Tutor] Printing with no newline :(

2011-11-06 Thread Dave Angel
On 11/06/2011 05:23 AM, Sarma Tangirala wrote: SNIP I just joined the list and did WELCOME to the list. I should have said that first. -- DaveA ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] Printing with no newline :(

2011-11-06 Thread Sarma Tangirala
On 6 November 2011 16:57, Dave Angel d...@davea.name wrote: On 11/06/2011 05:23 AM, Sarma Tangirala wrote: SNIP I just joined the list and did WELCOME to the list. I should have said that first. -- DaveA Ha! Sorry for the noise again! -- Sarma Tangirala, Class of 2012,

Re: [Tutor] Printing with no newline :(

2011-11-06 Thread Alan Gauld
On 06/11/11 10:23, Sarma Tangirala wrote: I'm sorry. Didn't notice the python 3 part, I just joined the list and did not look at the OPs post. Sorry about that. welcome to the list :-) Please bear with me on this, but does the following not print end for every iteration of items? for item

[Tutor] printing a key not a value

2011-10-25 Thread ADRIAN KELLY
if i have a dictionary called definitions is there a way of printing the keys and not the values that go with them? thanks so much Adrian___ Tutor maillist - Tutor@python.org To unsubscribe or

Re: [Tutor] printing a key not a value

2011-10-25 Thread bodsda
To: tutor@python.org Subject: [Tutor] printing a key not a value ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor ___ Tutor maillist

Re: [Tutor] printing a key not a value

2011-10-25 Thread Dipo Elegbede
2011 13:45:50 To: tutor@python.org Subject: [Tutor] printing a key not a value ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] printing a key not a value

2011-10-25 Thread Joel Goldstick
On Tue, Oct 25, 2011 at 9:45 AM, ADRIAN KELLY kellyadr...@hotmail.comwrote: if i have a dictionary called definitions is there a way of printing the keys and not the values that go with them? thanks so much Adrian ___ Tutor maillist -

Re: [Tutor] Printing in the same place

2011-08-17 Thread Peter Otten
brandon w wrote: I am trying to print in the same place to make a clock in a tkinter window. I will loop the following code to update the time. This seems to work but it is not printing in the same place: #!/usr/bin/python #Python 2.6.6 import time for t in range(5): digits =

Re: [Tutor] Printing in the same place

2011-08-17 Thread Alan Gauld
On 17/08/11 04:05, brandon w wrote: I am trying to print in the same place to make a clock in a tkinter window. I will loop the following code to update the time. This is not a tkinter program so its completely irrelevant to your stated aim. In tkinter how print works is of no importance. You

Re: [Tutor] Printing in the same place

2011-08-17 Thread Alan Gauld
On 17/08/11 09:02, Alan Gauld wrote: On 17/08/11 04:05, brandon w wrote: I am trying to print in the same place to make a clock in a tkinter window. I will loop the following code to update the time. This is not a tkinter program so its completely irrelevant to your stated aim. In tkinter how

Re: [Tutor] Printing in the same place

2011-08-17 Thread brandon w
On 08/17/2011 04:02 AM, Alan Gauld wrote: On 17/08/11 04:05, brandon w wrote: I am trying to print in the same place to make a clock in a tkinter window. I will loop the following code to update the time. This is not a tkinter program so its completely irrelevant to your stated aim. In tkinter

Re: [Tutor] Printing in the same place

2011-08-17 Thread Alan Gauld
On 17/08/11 23:20, brandon w wrote: I guess I will have to find another way to create a digital clock in a tkinter window. The point about a GUI is that you display widgets that have text on them. It could be a Label, or a Button or a Text box or even a Canvas. Then to change the text you

[Tutor] Printing in the same place

2011-08-16 Thread brandon w
I am trying to print in the same place to make a clock in a tkinter window. I will loop the following code to update the time. This seems to work but it is not printing in the same place: #!/usr/bin/python #Python 2.6.6 import time for t in range(5): digits = time.strftime('%H:%M:%S')

[Tutor] Printing RAW string

2011-06-10 Thread Kaustubh Pratap chand
How i can print the string in raw...as it is s=hello world\n print s Output: helloworld But i want it to be hello world\n I know it can be done by adding a 'r' prefix but is there any other way because the string will be taken in during input! Any help appreciated :D

Re: [Tutor] Printing RAW string

2011-06-10 Thread Jeremy G Clark
print(repr(s)) _ How i can print the string in raw...as it is s=hello world\n print s Output: helloworld But i want it to be hello world\n I know it can be done by adding a 'r' prefix but is there any other way because the string will be taken in during

[Tutor] Printing output from Python program to HTML

2011-05-10 Thread Spyros Charonis
Hello everyone, I have a Python script that extracts some text from a database file and annotates another file, writing the results to a new file. Because the files I am annotating are ASCII, I am very restricted as to how I can annotate the text, and I would like to instead write the results to

Re: [Tutor] Printing output from Python program to HTML

2011-05-10 Thread Brett Ritter
On Tue, May 10, 2011 at 8:16 AM, Spyros Charonis s.charo...@gmail.com wrote:           newline = line.replace(item, p font color = red item ... The Python compiler complains on the line I try to change the font color, saying invalid syntax. Your issue here is not importing libraries, but your

Re: [Tutor] Printing output from Python program to HTML

2011-05-10 Thread Steven D'Aprano
Spyros Charonis wrote: newline = line.replace(item, p font color = red item /font /p) # compiler complains here about the word red You should pay attention when Python tells you where there is an error. If it says there is a syntax error, then your syntax is invalid and you need

Re: [Tutor] Printing output from Python program to HTML

2011-05-10 Thread Spyros Charonis
Thanks, very simple but I missed that because it was supposed be in HTML code! On Tue, May 10, 2011 at 1:16 PM, Spyros Charonis s.charo...@gmail.comwrote: Hello everyone, I have a Python script that extracts some text from a database file and annotates another file, writing the results to a

Re: [Tutor] printing in python 3.x

2010-12-05 Thread Alan Gauld
Monte Milanuk memila...@gmail.com wrote ... I was under the impression that controlling exactly layout via html was kind of difficult and somewhat fragile. Absolutely true, especially compared to PDF. But its much better than it was say 10-15 years ago. But if you can construct the page such

Re: [Tutor] printing in python 3.x

2010-12-04 Thread Monte Milanuk
Alan, Perhaps this is a silly question (and possibly not strictly python-related) but I was under the impression that controlling exactly layout via html was kind of difficult and somewhat fragile. The latter perhaps less so as one could make some fairly concrete assumptions about the paper

Re: [Tutor] printing in python 3.x

2010-12-03 Thread Alan Gauld
Rance Hall ran...@gmail.com wrote But shop owner wants to do something nicer with the customer receipts. He is talking shop logos and pdf files. The simplest technique is probably to generate an HTML file and then get the OS to print that for you via the default browser. Google keeps

[Tutor] printing in python 3.x

2010-12-02 Thread Rance Hall
I've been working on this cli based python 3.x app for a friends shop. So far, everything is working well. We are now ready to start development on a new module of my code. The shop is a repair shop, and I've already done the code for client management and employee management and all the

[Tutor] Printing prime numbers

2010-09-30 Thread delegbede
Hi all, I am trying to write a function that prints out which number is prime in range (1,500) The function would check thru and the print out something like 1 is prime 2 is prime 3 is prime 4 is not 5 is prime Please help me. Thank you. Sent from my BlackBerry wireless device from MTN

Re: [Tutor] Printing prime numbers

2010-09-30 Thread Shashwat Anand
On Thu, Sep 30, 2010 at 5:27 PM, delegb...@dudupay.com wrote: Hi all, I am trying to write a function that prints out which number is prime in range (1,500) The function would check thru and the print out something like 1 is prime 2 is prime 3 is prime 4 is not 5 is prime Please help

Re: [Tutor] Printing prime numbers

2010-09-30 Thread delegbede
Ok. I will do that as soon As I get back to my workstation. Sent from my BlackBerry wireless device from MTN -Original Message- From: Shashwat Anand anand.shash...@gmail.com Date: Thu, 30 Sep 2010 19:11:33 To: delegb...@dudupay.com Cc: tutor@python.org Subject: Re: [Tutor] Printing prime

Re: [Tutor] Printing prime numbers

2010-09-30 Thread Emmanuel Ruellan
On Thu, Sep 30, 2010 at 1:57 PM, delegb...@dudupay.com wrote: 1 is prime One is /not/ prime. /pedant ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Printing prime numbers

2010-09-30 Thread Steven D'Aprano
On Thu, 30 Sep 2010 11:52:49 pm Emmanuel Ruellan wrote: On Thu, Sep 30, 2010 at 1:57 PM, delegb...@dudupay.com wrote: 1 is prime One is /not/ prime. /pedant There's no need to apologize for pedantry. Saying that one is prime is like saying that 2 is an odd number, or that glass is a type of

[Tutor] Printing time without if statement

2010-03-07 Thread Elisha Rosensweig
Hi, I have an event-based simulator written in Python (of course). It takes a while to run, and I want to have messages printed every so often to the screen, indicating the simulation time that has passed. Currently, every event that occurs follows the following code snippet: # initilize

Re: [Tutor] Printing time without if statement

2010-03-07 Thread Steve Willoughby
On Sun, Mar 07, 2010 at 11:38:49PM -0500, Elisha Rosensweig wrote: Hi, I have an event-based simulator written in Python (of course). It takes a while to run, and I want to have messages printed every so often to the screen, indicating the simulation time that has passed. Currently, every

Re: [Tutor] Printing time without if statement

2010-03-07 Thread Steven D'Aprano
On Mon, 8 Mar 2010 03:38:49 pm Elisha Rosensweig wrote: Hi, I have an event-based simulator written in Python (of course). It takes a while to run, and I want to have messages printed every so often to the screen, indicating the simulation time that has passed. Currently, every event that

[Tutor] Printing data to a printer...

2010-01-02 Thread Ken G.
Wow, I looked and looked. I can print out my program listing but can not print the resulted data produced by the program. How do I print out on my USB printer the data output of my Python program I ran in my Ubuntu terminal via Geany IDE? I already wrote several programs using raw_input,

Re: [Tutor] Printing data to a printer...

2010-01-02 Thread Rich Lovely
2010/1/2 Ken G. beach...@insightbb.com: Wow, I looked and looked.  I can print out my program listing but can not print the resulted data produced by the program. How do I print out on my USB printer the data output of my Python program I ran in my Ubuntu terminal via Geany IDE? I already

Re: [Tutor] Printing data to a printer...

2010-01-02 Thread Ken G.
Rich Lovely wrote: 2010/1/2 Ken G. beach...@insightbb.com: Wow, I looked and looked. I can print out my program listing but can not print the resulted data produced by the program. How do I print out on my USB printer the data output of my Python program I ran in my Ubuntu terminal via

Re: [Tutor] Printing data to a printer...

2010-01-02 Thread Alan Gauld
Ken G. beach...@insightbb.com wrote Wow, I looked and looked. I can print out my program listing but can not print the resulted data produced by the program. Printing is always difficult in a modern OS because your program and Python cannot be sure of what kind of device it is going to

[Tutor] printing xps or gif

2009-12-31 Thread Rayon
Can I use python to print xps or gif. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] printing xps or gif

2009-12-31 Thread Alan Gauld
Rayon evosw...@hotmail.com wrote Can I use python to print xps or gif. Yes. But how you do it depends on the context of what you are doing. Care to expound? Alan G. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

Re: [Tutor] printing xps or gif

2009-12-31 Thread ALAN GAULD
Well I have a folder with some sub folders that have a combo of xps and gif files I want to be able to point the program to it and have it print the contents of each sub folder. In that case I'd use os.walk to traverse the folders and find the files. I'd then use os.system() (or the

Re: [Tutor] Printing Sideway...

2009-11-08 Thread Alan Gauld
Ken G. wrote: I am using Ubuntu 9.04 as my primary OS. I have Windows XP installed in the first partition (dual boot). I have Python 2.6.2 installed on both OS. The printer is a Cannon MX300. To print on the envelope, I use Windows Works v4.5 which is easy to use. I just learned how to

Re: [Tutor] Printing Sideway...

2009-11-08 Thread Ken G.
Okay, thanks. Understood. It's not a big thing here. Thought I would ask. Ken Alan Gauld wrote: Ken G. wrote: I am using Ubuntu 9.04 as my primary OS. I have Windows XP installed in the first partition (dual boot). I have Python 2.6.2 installed on both OS. The printer is a Cannon

[Tutor] Printing Sideway...

2009-11-07 Thread Ken G.
It is possible to print letters sideway in Python? Instead of printing from left to right on the long side of a #10 envelope, I wish to print sideway, printing from the left short edge of envelope to its right short edge. Thanks, Ken ___ Tutor

Re: [Tutor] Printing Sideway...

2009-11-07 Thread bob gailer
Ken G. wrote: It is possible to print letters sideway in Python? Python is a programming language, not a printer driver. So this is not the best place to ask the question. But tell us more - what OS? (Windows or what) what printer? (Make and model) what are you doing in Python to print

Re: [Tutor] Printing Sideway...

2009-11-07 Thread bob gailer
Please always reply-all so a copy goes to the list. I am ccing this to the lists for you. Ken G. wrote: I am using Ubuntu 9.04 as my primary OS. I have Windows XP installed in the first partition (dual boot). I have Python 2.6.2 installed on both OS. The printer is a Cannon MX300. To print

[Tutor] printing tree structure

2009-07-03 Thread karma
Hi all , I have a nested list in the structure [root,[leftSubtree],[RightSubtree]] that I want to print out. I was thinking that a recursive solution would work here, but so far I can't quite get it working. This is what I have so far: Can someone suggest whether this is suited to a recursive

Re: [Tutor] printing tree structure

2009-07-03 Thread Lie Ryan
karma wrote: Hi all , I have a nested list in the structure [root,[leftSubtree],[RightSubtree]] that I want to print out. I was thinking that a recursive solution would work here, but so far I can't quite get it working. This is what I have so far: Can someone suggest whether this is

Re: [Tutor] printing tree structure

2009-07-03 Thread Alan Gauld
karma dorjeta...@googlemail.com wrote thinking that a recursive solution would work here, but so far I can't quite get it working. This is what I have so far: Can someone suggest whether this is suited to a recursive solution and Yes certainly if so, what am I doing wrong. L = ['a',

Re: [Tutor] printing tree structure

2009-07-03 Thread karma
Thanks all for the feedback. As you all rightly pointed out, I was confusing myself by not keeping a track of the recursion depth. Thanks again 2009/7/3 Alan Gauld alan.ga...@btinternet.com: karma dorjeta...@googlemail.com wrote thinking that a recursive solution would work here, but so far

  1   2   >