473,383 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Print command

Hi, All:
For unknow reasons, I often get compiler error in the print
statements. For example: I have following codes:

if len(currentFiberCode) > 0 :
print string.ljust(expandFiberCode(currentFiberCode,buil dingRoom),30), \
string.rjust(`currentTotal`,6), \
string.rjust(`currentAvailable`,11), \
string.rjust(`sm_ava`,7), \
string.rjust(`mm_ava`,6), \
string.rjust(`sm_used`,9), \
string.rjust(`mm_used`,9)
else:
print 'data exist in fiber database table'

When I comiped all the codes, I got :
Compiling ./NetDBfiber.py ...
File "./NetDBfiber.py", line 1086
string.rjust(`currentTotal`,6), \
^
SyntaxError: invalid token
How can I fix the problems ?
Thanks a lot.

Yong

Jul 18 '05 #1
9 3565
Yong Wang wrote:
Hi, All:
For unknow reasons, I often get compiler error in the print
statements. For example: I have following codes:

if len(currentFiberCode) > 0 :
print string.ljust(expandFiberCode(currentFiberCode,buil dingRoom),30), \
string.rjust(`currentTotal`,6), \
string.rjust(`currentAvailable`,11), \
string.rjust(`sm_ava`,7), \
string.rjust(`mm_ava`,6), \
string.rjust(`sm_used`,9), \
string.rjust(`mm_used`,9)
else:
print 'data exist in fiber database table'

When I comiped all the codes, I got :
Compiling ./NetDBfiber.py ...
File "./NetDBfiber.py", line 1086
string.rjust(`currentTotal`,6), \
^
SyntaxError: invalid token
How can I fix the problems ?
Thanks a lot.

Yong


Yong,
Is there a trailing space after the \ ? Looks like it.
wes

Jul 18 '05 #2
I think that you should try:
string.rjust('currentTotal',6)
instead of:
string.rjust(`currentTotal`,6)

You may also do it this this way:
'currentTotal'.rjust(6)
"Yong Wang" <yo**@net.tamu.edu> wrote in message
news:ma**************************************@pyth on.org...
Hi, All:
For unknow reasons, I often get compiler error in the print
statements. For example: I have following codes:

if len(currentFiberCode) > 0 :
print string.ljust(expandFiberCode(currentFiberCode,buil dingRoom),30), \ string.rjust(`currentTotal`,6), \
string.rjust(`currentAvailable`,11), \
string.rjust(`sm_ava`,7), \
string.rjust(`mm_ava`,6), \
string.rjust(`sm_used`,9), \
string.rjust(`mm_used`,9)
else:
print 'data exist in fiber database table'

When I comiped all the codes, I got :
Compiling ./NetDBfiber.py ...
File "./NetDBfiber.py", line 1086
string.rjust(`currentTotal`,6), \
^
SyntaxError: invalid token
How can I fix the problems ?
Thanks a lot.

Yong

Jul 18 '05 #3
"CptPicard" <jp********@earthlink.net> wrote in message
news:Wo******************@newsread3.news.atl.earth link.net...
I think that you should try:
string.rjust('currentTotal',6)
instead of:
string.rjust(`currentTotal`,6)

You may also do it this this way:
'currentTotal'.rjust(6)


No, I think he really did want the "backwards" single quotation marks. They
*are* different, you know...
--
I don't actually read my hotmail account, but you can replace hotmail with
excite if you really want to reach me.
Jul 18 '05 #4

"Russell Blau" <ru******@hotmail.com> wrote in message
news:2n************@uni-berlin.de...
"CptPicard" <jp********@earthlink.net> wrote in message
news:Wo******************@newsread3.news.atl.earth link.net...
I think that you should try:
string.rjust('currentTotal',6)
instead of:
string.rjust(`currentTotal`,6)

You may also do it this this way:
'currentTotal'.rjust(6)
No, I think he really did want the "backwards" single quotation marks.

They *are* different, you know...

Actually, I don't know the meaning of ``.
On some languages, it means "evaluate": Is it the same meaning in Python ?

--
I don't actually read my hotmail account, but you can replace hotmail with
excite if you really want to reach me.



Jul 18 '05 #5

"Russell Blau" <ru******@hotmail.com> wrote in message
Actually, I don't know the meaning of ``.
On some languages, it means "evaluate": Is it the same meaning in
Python?


Why ask when you can do? :
`name` Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'name' is not defined name = 2
`name`

'2'

Jul 18 '05 #6
"Peter Hansen" <pe***@engcorp.com> wrote in message
news:cv********************@powergate.ca...

"Russell Blau" <ru******@hotmail.com> wrote in message
> Actually, I don't know the meaning of ``.
> On some languages, it means "evaluate": Is it the same meaning in
> Python?


Ummm, actually, that wasn't me you were quoting; it was the OP who replied
to my message pointing out that `x` doesn't mean the same as 'x'.

--
I don't actually read my hotmail account, but you can replace hotmail with
excite if you really want to reach me.
Jul 18 '05 #7
Russell Blau wrote:
"Peter Hansen" <pe***@engcorp.com> wrote in message
news:cv********************@powergate.ca...
"Russell Blau" <ru******@hotmail.com> wrote in message
> Actually, I don't know the meaning of ``.
> On some languages, it means "evaluate": Is it the same meaning in
> Python?


Ummm, actually, that wasn't me you were quoting; it was the OP who replied
to my message pointing out that `x` doesn't mean the same as 'x'.


Quite right... my apologies for the bad editing. It was
'Cpt Picard' who wrote that, not Russell.

-Peter
Jul 18 '05 #8
Russell Blau wrote:
"Peter Hansen" <pe***@engcorp.com> wrote in message
news:cv********************@powergate.ca...
"Russell Blau" <ru******@hotmail.com> wrote in message
> Actually, I don't know the meaning of ``.
> On some languages, it means "evaluate": Is it the same meaning in
> Python?


Ummm, actually, that wasn't me you were quoting; it was the OP who replied
to my message pointing out that `x` doesn't mean the same as 'x'.


Quite right... my apologies for the bad editing. It was
'Cpt Picard' who wrote that, not Russell.

-Peter
Jul 18 '05 #9

"Peter Hansen" <pe***@engcorp.com> wrote in message
news:MJ********************@powergate.ca...
Russell Blau wrote:
"Peter Hansen" <pe***@engcorp.com> wrote in message
news:cv********************@powergate.ca...
"Russell Blau" <ru******@hotmail.com> wrote in message
> Actually, I don't know the meaning of ``.
> On some languages, it means "evaluate": Is it the same meaning in
> Python?
Ummm, actually, that wasn't me you were quoting; it was the OP who replied to my message pointing out that `x` doesn't mean the same as 'x'.


Quite right... my apologies for the bad editing. It was
'Cpt Picard' who wrote that, not Russell.


Thank you for the explanation on `` and for the fun ;-)

And sorry for asking for things that I could check by myself but the "you
know" at the end of Russel Blau's email sounds like a call for me to say
"no, actually, I don't know".
-Peter

Jul 18 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: James | last post by:
Hello All, I have a stored procedure which will act like a main/controller script which will then invoke more stored procedures (~20). Basically, it looks something like below: -- start...
1
by: Brian Turner | last post by:
I have a filenane defined in a table in my database. This filename field is also displayed on my form. I have place a print button on my form. I would like to be abel to click the Print button...
5
by: Darren DeCoste | last post by:
I have an access project with a Form that has a Command button to print the current record. I would like to Print the record 3 times, changing a text field on each print. The standard code of...
2
by: Rainbow | last post by:
I know that print funciton will be available in the application for each type of file. My question is, can I print a file(any type, e.g. word, bmp, html, etc) in program? No printer dialog...
2
by: Soumya Kar | last post by:
Hi All, My requirement is to be able to print a pdf document without the printer dialog being invoked. This I have achieved by using the shell and passing the verb = "Print". But a part of the...
5
by: MLH | last post by:
I use a fair number of debug.print statements. My apps are fairly well 'peppered' with them. I've often wondered if leaving them in the mdb, creating and rolling out an mde intended for use in the...
9
by: larryimic | last post by:
I have created a Access production database that records good parts and bad parts to a table thru querys using macros and command buttons on a form. A report (part label) is printed each time a...
6
tdw
by: tdw | last post by:
the View Orders form in my Access database has a Print button on it. It has other buttons too, like Edit etc. These buttons used to be at the bottom of the form laid out horizontally, but this was...
10
by: Prisoner at War | last post by:
Hi, your friendly neighborhood n00b here, just wondering why on earth the Py3K folks want to mess with a simple thing like the "print" "command" (is that what it's called, a command?), turning it...
12
by: Studiotyphoon | last post by:
Hi, I have report which I need to print 3 times, but would like to have the following headings Customer Copy - Print 1 Accounts Copy - Print 2 File Copy -Print 3 I created a macro to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.