LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-05-2006, 04:27 AM   #1
datbenik
Member
 
Registered: Dec 2005
Location: Holland
Posts: 39

Rep: Reputation: 15
[python] print "\033[5;",x,"H=>"


I'm trying to make a progress bar or something like that. It doesn't work actually. My script (python):
Code:
import os
os.system("clear")
x =1
while x<20:
	print "\033[5;",x,"H=>"
	x = x+1
The result:
Code:
[5; 1 H=>
[5; 2 H=>
[5; 3 H=>
[5; 4 H=>
[5; 5 H=>
[5; 6 H=>
[5; 7 H=>
[5; 8 H=>
[5; 9 H=>
[5; 10 H=>
[5; 11 H=>
[5; 12 H=>
[5; 13 H=>
[5; 14 H=>
[5; 15 H=>
[5; 16 H=>
[5; 17 H=>
[5; 18 H=>
[5; 19 H=>
How can i fix this?
 
Old 01-05-2006, 05:12 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,481

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Try that:
Code:
import os
import sys;
import time
os.system("clear")
x=1
while x<20:
  sys.stdout.write("\033[5;"+str(x)+"H=>");
  sys.stdout.flush();
  time.sleep(1);
  x=x+1
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script: using "select" to show multi-word options? (like "option 1"/"o zidane_tribal Programming 6 03-21-2013 10:35 AM
what is "sticky bit mode" , "SUID" , "SGID" augustus123 Linux - General 10 08-03-2012 04:40 AM
Telling people to use "Google," to "RTFM," or "Use the search feature" Ausar General 77 03-21-2010 11:26 AM
"Xlib: extension "XFree86-DRI" missing on display ":0.0"." zaps Linux - Games 9 05-14-2007 03:07 PM
User "list" running process "python" TroelsSmit Linux - Newbie 2 02-22-2005 04:55 AM


All times are GMT -5. The time now is 07:20 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration