473,387 Members | 1,899 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,387 software developers and data experts.

Optional code segment delimiter?

Is it possible to use optional delimiters other than tab and colons?

For example:

if this==1 {
print this
}

And is there an alternate delimiter for statements other than the
newline?

print this;print that; #for example
I know I'll probably get yelled at for this question, but I would just
like to know.

Regards,
Ken
Dec 29 '07 #1
3 1312
On Sat, 29 Dec 2007 09:20:00 -0800, xkenneth wrote:
Is it possible to use optional delimiters other than tab and colons?
No.
And is there an alternate delimiter for statements other than the
newline?

print this;print that; #for example
Yes.

But both are reasons to yell at you. ;-)

Ciao,
Marc 'BlackJack' Rintsch
Dec 29 '07 #2
On Dec 29, 10:20*am, xkenneth <xkenn...@gmail.comwrote:
Is it possible to use optional delimiters other than tab and colons?

For example:

* * *if this==1 {
* * * * * print this
* * *}
Certainly, it's very possible. Here's how to do it:
1. Download the python source code (easy)
2. Modify the parser as needed (hard)
3. Re-apply your patches to each additional version of Python that
gets released (hard)

Alternatively:
1. Write a script in regular Python/Perl/Ruby/Bash-script to convert
your code into real Python. (Bonus: This may give you the write-
compile-run cycle that some C/C++ programmers desperately crave!)

Or, another alternative:
1. Get used to using indention.
2. Use a Python-aware editor to automatically add the proper number
of indenting spaces for you.
3. If you feel the urge to use braces, write in Java until
thoroughly sick of them. If you don't feel the bile rising in your
throat, it's too soon to come back to Python.
>
And is there an alternate delimiter for statements other than the
newline?

print this;print that; #for example
>>print "This" ; print "That"
This
That
>>>
That wasn't so hard, now was it? Just remember that clarity beats
compactness any day. The semicolon doesn't even save you any
keystrokes if you're using a Python-aware editor. People who feel the
need to write a program on a single line will be rightfully mocked by
other Pythonistas. How is:

print "This"; print "That"

better than:

print "This"
print "That"

I know which one is easier for me to read.
>
I know I'll probably get yelled at for this question, but I would just
like to know.

Regards,
Ken
No yelling, but a little snickering from some of us.

--Jason
Dec 29 '07 #3
xkenneth wrote:
Is it possible to use optional delimiters other than tab and colons?

For example:

if this==1 {
print this
}
<http://timhatch.com/projects/pybraces/>

Heheheh..

<snip>
--
Dec 29 '07 #4

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

Similar topics

1
by: LenS | last post by:
If this is the wrong place to post this, please advise better place. Otherwise, I have created the following python program and it works. Running on XP. I think I am now at that stage of learning...
4
by: Raquel | last post by:
Could someone explain to me what the reason is for having a character delimiter (which is double quotes by default) for performing Loads/Imports on UDB? I would think that column delimiter along...
65
by: Skybuck Flying | last post by:
Hi, I needed a method to determine if a point was on a line segment in 2D. So I googled for some help and so far I have evaluated two methods. The first method was only a formula, the second...
0
by: raca | last post by:
Please look at this code fragment: #region Custom Code - Generated_Methods // Generated_Discussion_Methods public abstract IDataReader GetDiscussion(); public abstract void DeleteDiscussion(int...
5
by: Nadav | last post by:
Hi, Introduction: ************************************************************ I am working on a project that should encrypt PE files ( Portable executable ), this require me to inject some...
3
by: Ranjay | last post by:
Hi Everybody, Suppose i have a function like this class xx{ int func(); }; main(){ xx x1; x1.func();
19
by: dl | last post by:
I'll try to clarify the cryptic subject line. Let's say I have a base class 'GeometricObject' with a virtual method 'double distance (const GeometricObject &) const'. Among the derived classes...
1
by: preejith | last post by:
Error Code : 1329, No data - zero rows fetched, selected, or processed. MYSQL I am getting the following error while running a stored procedure in mysql5.0 Error Code : 1329 No data - zero rows...
7
by: Anz | last post by:
I used the javascript functions as shown below. <a href="javascript:;;;" onclick="this.style.behavior='url(#default#homepage)'; this.setHomePage(location.href);"> But this code works for IE,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.