On Fri, Nov 20, 2009 at 4:44 PM, Joseph Fennell wrote:
> My apologies yes these are in seperate files,
> --
> main.py
> ---
> cHandler.execute("SELECT * FROM table")
>
> #sets results from above to nl
>
> nl = cHandler.fetchall()
>
> dn = raw_input("User input: ")
>
> nl2
"Joseph Fennell" wrote
I assume that it's because the variable is considered local and the
imported
functions are not technically local to that document.
global in Python means "in the same module" not global across all modules
You are best to pass data into functions as arguments and to pa
"mark guinder" wrote
ok, all i know is that i have python installed on my computer(mac),
and i know how to open up "IDLE", how do i write my first program,
what do i use , how do i open that, and how to i save it as a prograam?
That's slightly more than I assume for beginners in my tuto
Stephen Nelson-Smith wrote:
I have the following method:
def get_log_dates(the_date_we_want_data_for):
t = time.strptime(the_date_we_want_data_for, '%Y%m%d')
t2 = datetime.datetime(*t[:-2])
extra_day = datetime.timedelta(days=1)
t3 = t2 + extra_day
next_log_date = t3.strftime('%Y%m%d')
On Friday 20 November 2009 09:48:38 am Alan Gauld wrote:
> "John" wrote
>
> > class A (wx.Panel);
> > def__init__(...)
> >
> > class B(wx.PyPanel):
> >
> > def __init__(..):
> > self.pages = A(...)
> >
> > class C (B)
> > def __init__(...)
> >
> > I can't change the code in either class A
On Fri, Nov 20, 2009 at 12:28 PM, Kent Johnson wrote:
> On Fri, Nov 20, 2009 at 3:05 PM, Dave Angel wrote:
> > Eric Pavey wrote:
>
> >> lol, in usual fashion, after I hack through it, while in the docs, I
> find
> >> the 'fancy' solution:
> >>
> >> import pkgutil
> >> import myPackage
> >> modul
On Fri, Nov 20, 2009 at 2:51 PM, Joseph Fennell wrote:
> Quick introduction, I'm Joseph Fennell, and I've been playing with python
> for the past 6 years (primarily in the interpreter) and have finally gotten
> started on a full project and I've run into a small problem. I have defined
> some m
On Fri, Nov 20, 2009 at 1:42 PM, mark guinder wrote:
> ok, all i know is that i have python installed on my computer(mac), and i
> know how to open up "IDLE", how do i write my first program, what do i use ,
> how do i open that, and how to i save it as a prograam?
Try taking a look at http://d
Quick introduction, I'm Joseph Fennell, and I've been playing with python
for the past 6 years (primarily in the interpreter) and have finally gotten
started on a full project and I've run into a small problem. I have defined
some modules, and when I import them into the page I want to use them o
On Fri, Nov 20, 2009 at 3:05 PM, Dave Angel wrote:
> Eric Pavey wrote:
>> lol, in usual fashion, after I hack through it, while in the docs, I find
>> the 'fancy' solution:
>>
>> import pkgutil
>> import myPackage
>> modules = pkgutil.iter_modules(myPackage.__path__)
>> for p in modules:
>> pr
ok, all i know is that i have python installed on my computer(mac),
and i know how to open up "IDLE", how do i write my first program,
what do i use , how do i open that, and how to i save it as a prograam?
___
Tutor maillist - Tutor@python.org
To
Eric Pavey wrote:
On Fri, Nov 20, 2009 at 11:14 AM, Eric Pavey wrote:
On Fri, Nov 20, 2009 at 10:58 AM, Eric Pavey wrote:
On Fri, Nov 20, 2009 at 10:40 AM, Dave Angel wrote:
lol, in usual fashion, after I hack through it, while in the docs, I find
the 'fancy' solution:
i
On Fri, Nov 20, 2009 at 10:58 AM, Eric Pavey wrote:
> On Fri, Nov 20, 2009 at 10:40 AM, Dave Angel wrote:
>
>> Eric Pavey wrote:
>>
>>> On Fri, Nov 20, 2009 at 4:09 AM, Kent Johnson wrote:
>>>
>>>
>>>
On Thu, Nov 19, 2009 at 9:31 PM, Eric Pavey wrote:
> Say I have this packa
On Fri, Nov 20, 2009 at 10:40 AM, Dave Angel wrote:
> Eric Pavey wrote:
>
>> On Fri, Nov 20, 2009 at 4:09 AM, Kent Johnson wrote:
>>
>>
>>
>>> On Thu, Nov 19, 2009 at 9:31 PM, Eric Pavey wrote:
>>>
>>>
Say I have this package layout
\myPackage
__init__.py
moduleA.p
Eric Pavey wrote:
On Fri, Nov 20, 2009 at 4:09 AM, Kent Johnson wrote:
On Thu, Nov 19, 2009 at 9:31 PM, Eric Pavey wrote:
Say I have this package layout
\myPackage
__init__.py
moduleA.py
moduleB.py
Is there a way (and I'm sure there is...) to query, for a given package
level, whic
Does the partial just do a lambda in the background? It's a neat
example, thanks! I've never seen this used before. Sorry if reply is
top-posted or otherwise weird, posting from mobile.
On 11/20/09, Lie Ryan wrote:
> lau...@protopc.com wrote:
>> John,
>>
>> Thank you so much for your help! -- Pro
Hi!
Slightly different (extented) than your original question, but here's how I'd
do this (although the program doesn't really do very much):
import time, random
def is_valid_date():
while True:
prompt = 'Enter the date in ISO format (-MM-DD), or 0 to exit: '
date = raw
Alan Gauld wrote:
"Ken G." wrote
I am trying to break out of a loop posted below. When asked for
monthdate, it should break out if I entered the number zero and it
does not. GRRR. Been working on this for almost an hour.
monthdate = 999
while monthdate <> 0:
You are comparing
"John" wrote
class A (wx.Panel);
def__init__(...)
class B(wx.PyPanel):
def __init__(..):
self.pages = A(...)
class C (B)
def __init__(...)
I can't change the code in either class A or class B. But I want to add
a
property to class A in class C. Is that possible?
You need to d
"Ken G." wrote
I am trying to break out of a loop posted below. When asked for
monthdate, it should break out if I entered the number zero and it does
not. GRRR. Been working on this for almost an hour.
monthdate = 999
while monthdate <> 0:
You are comparing monthdate with a num
I am trying to break out of a loop posted below. When asked for
monthdate, it should break out if I entered the number zero and it does
not. GRRR. Been working on this for almost an hour.
monthdate = 999
while monthdate <> 0:
monthdate = raw_input('Enter the month and date in t
On Fri, 2009-11-20 at 16:40 +0100, tutor-requ...@python.org wrote:
> That is a surprise! I was so use to using lprint as in Basic. Oh
> well. I will have to study up on fmt and/or groff.
>
> Would those two commands (fmt, groff) send data to lpr from shell?
> Is
> lpr the same hookup for USB
On Fri, Nov 20, 2009 at 4:09 AM, Kent Johnson wrote:
> On Thu, Nov 19, 2009 at 9:31 PM, Eric Pavey wrote:
> > Say I have this package layout
> >
> > \myPackage
> >
> > __init__.py
> > moduleA.py
> > moduleB.py
> >
> > Is there a way (and I'm sure there is...) to query, for a given package
> > le
On Fri, Nov 20, 2009 at 8:08 AM, Stephen Nelson-Smith
wrote:
> I need to make some code Python 2.4 compliant... the only thing I see
> is use of try: except: finally:
>
> To make this valid, I think I need to do a try: finally: and next try:
> except: inside. Is this correct?
Yes, the backwards-
On Fri, Nov 20, 2009 at 5:03 AM, Kent Johnson wrote:
> On Thu, Nov 19, 2009 at 5:47 PM, Geoff Dutton
> wrote:
> > Do you have recommendations for handling missing positional arguments?
> I'm
> > a huge fan of OptionParser module and use it in several programs to
> handle
> > options, but there m
ALAN GAULD wrote:
> > There is no universal easy way to print stuff unfortunately.
> > In console mode on Unix its not too bad, you can send data
> > to lpr, just as you would from the shell.
> That is a surprise! I was so use to using lprint as in Basic.
BASIC ran on a predefined platform
> > There is no universal easy way to print stuff unfortunately.
> > In console mode on Unix its not too bad, you can send data
> > to lpr, just as you would from the shell.
> That is a surprise! I was so use to using lprint as in Basic.
BASIC ran on a predefined platform so could be sure w
Alan Gauld wrote:
"Ken G." wrote
Is there a Python command to send data to printer?
I have a Canon MX300 hooked up by USB. I can print from Firefox and
Thunderbird. I am using Ubuntu 9.04 and Python 2.6.2.
There is no universal easy way to print stuff unfortunately.
In console mode on Un
On Friday 20 November 2009 04:48:59 am Lie Ryan wrote:
> Is this what you want?
>
> class C(B):
> �...@property
> def wxpanelFontSize(self):
> return self.pages.wxpanelFontSize
> �...@wxpanelfontsize.setter
> def wxpanelFontSize(self, value):
> self.pages.wxpanel
I need to make some code Python 2.4 compliant... the only thing I see
is use of try: except: finally:
To make this valid, I think I need to do a try: finally: and next try:
except: inside. Is this correct?
The code has;
try:
...
...
...
except SystemExit:
raise
except KeyboardInte
John wrote:
Hi,
I'm not to sure I can explain myself. But I need to ask because I do not
understand how it works or what is possible.
class A (wx.Panel);
def__init__(...)
class B(wx.PyPanel):
def __init__(..):
self.pages = A(...)
class C (B)
def __init__(...)
I can't change t
lau...@protopc.com wrote:
John,
Thank you so much for your help! -- Problem SOLVED!!! -- Your explanation
and example was extremely helpful. I am very grateful.
Lauren :-)
if you want to pass an argument, you can "curry" the function with
functools.partial()
# currying the function, don't
Hi,
I'm not to sure I can explain myself. But I need to ask because I do not
understand how it works or what is possible.
class A (wx.Panel);
def__init__(...)
class B(wx.PyPanel):
def __init__(..):
self.pages = A(...)
class C (B)
def __init__(...)
I can't change the code in eith
On Fri, Nov 20, 2009 at 1:54 AM, MARCUS NG wrote:
> Hey all,
> I have been searching online for ways to copy a zip file to a destination
> and extract the zip file with python.
> Currently nothing works due to my limited understanding.
> I am wondering if my syntax is wrong or am I missing anythin
On Thu, Nov 19, 2009 at 9:31 PM, Eric Pavey wrote:
> Say I have this package layout
>
> \myPackage
>
> __init__.py
> moduleA.py
> moduleB.py
>
> Is there a way (and I'm sure there is...) to query, for a given package
> level, which modules live under it?
> I thought I could do it like so:
>
> impo
On Thu, Nov 19, 2009 at 5:47 PM, Geoff Dutton wrote:
> Do you have recommendations for handling missing positional arguments? I'm
> a huge fan of OptionParser module and use it in several programs to handle
> options, but there must be an eligant way of handling missing arguments and
> alerting t
MARCUS NG wrote:
Hey all,
I have been searching online for ways to copy a zip file to a
destination and extract the zip file with python.
Currently nothing works due to my limited understanding.
I am wondering if my syntax is wrong or am I missing anything?
the code is as such. also if there is
"MARCUS NG" wrote
Currently nothing works due to my limited understanding.
That's a pretty vague description of the problem.
What exactly happens?
Does the file get copied?
Do you get error messages? If so what?
I am wondering if my syntax is wrong or am I missing anything?
If the syntax
"Ken G." wrote
Is there a Python command to send data to printer?
I have a Canon MX300 hooked up by USB. I can print from Firefox and
Thunderbird. I am using Ubuntu 9.04 and Python 2.6.2.
There is no universal easy way to print stuff unfortunately.
In console mode on Unix its not too bad
39 matches
Mail list logo