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

can't figure out syntax prob

Can someone please tell me know what is wrong the code below. Whether I try
to just execute this class definition in IDLE, or include in a py file that
I attempt to run with python.exe, I get the error at the bottom.

In case this formatting gets messed up after posting, the carrot is pointing
at the second parenthesis.
I saw in Quick Python book, that I can define an __init__ function with more
than argument.
Thanks

-------------
class FileGroup:
sourceDir = ''
destinDir = ''
frequency = 1
recursive = False
def __init__(self, fg)
sourceDir = getSourceDir(fg)
destinDir = getDestinDir(fg)
frequency = getFrequency(fg)
recursive = getRecursive(fg)
---------
File "OregonBackup.py", line 23
def __init__(self,fg)
^
SyntaxError: invalid syntax
Jul 18 '05 #1
2 1242
"python newbie" <me*******@hotmail.com> writes:
File "OregonBackup.py", line 23
def __init__(self,fg)


You need a colon there:

def __init__(self,fg):
....
Jul 18 '05 #2
Thanks, wish I could "erase, erase" like that comedian Craig Shumaker says
and undo this post.
"Paul Rubin" <http://ph****@NOSPAM.invalid> wrote in message
news:7x************@ruckus.brouhaha.com...
"python newbie" <me*******@hotmail.com> writes:
File "OregonBackup.py", line 23
def __init__(self,fg)


You need a colon there:

def __init__(self,fg):
....

Jul 18 '05 #3

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

Similar topics

5
by: BStorm | last post by:
I have a transaction log file where the DataSet table's Description column is actually delimited into "subcolumns" based upon the transaction id. I would like to parse these into separate fields...
4
by: Aaron Walker | last post by:
Greetings, I'm attempting to write my first *real* template function that also deals with a map of strings to member function pointers that is making the syntax a little tricky to get right. ...
6
by: Frankie Montenegro | last post by:
Hi everyone, I need some help with the following C++ code. It is supposed to read input line by line, each line as one string; then split each string into its component words and store these...
2
by: Wayne Wengert | last post by:
I am trying to code a Sub to store some custom values in a profile for a new user registration (ASP.NET 2.0 environment). I copied the basic code from an example I found in a great article...
3
by: Brian Blais | last post by:
Hello, I have an odd kind of Heisenbug in what looks like a pretty simple program. The program is a progress bar code I got at the Python Cookbook: ...
4
by: _Raven | last post by:
Okay, I am playing with submitting forms with Ajax. I am trying to adapt this script to my forms: http://www.captain.at/howto-ajax-form-post-get.php I have included my code at the bottom of this...
7
by: =?ISO-8859-1?Q?Une_B=E9vue?= | last post by:
i'm in search of an online syntax highlighter able to highlight either JavaScript, CSS or HTMl only or a whole page. the result would be shown on the page itself, on demand. -- Une Bévue
2
by: mnacw | last post by:
Can anybody help me to resolve this prob. i have installed Visual Studio 2005 Professional edition. I am working in VB.Net. When I tried to connect to database it is connected but when i make some...
11
by: LayneMitch via WebmasterKB.com | last post by:
Hello. This is a reference file from a book I read in which the core subject is the use of 'event listeners'. I'm trying to load the file in Firefox and it's giving me an error message: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.