On Mon, Jul 9, 2012 at 3:10 AM, Chris Hare wrote:
>
> Here is what I want to do:
>
> I have a bunch of modules to import. instead of duplicating a lot of code
> for each import, I want to do something like this:
>
> importList = [ "sys", "os", "imp", "stat", "re", "webbrowser", "Image",
> "Strin
On Mon, Jul 9, 2012 at 3:10 AM, Gregory Lund wrote:
> I'm Not looking for an absolute solution, but perhaps some insight
> into some snippets of code, or
> suggestions of where I should seek out answers to this issue.
> Or where I've gone wrong below.
> NOTE: currently this 'code' below r
On Sun, Jul 8, 2012 at 11:47 PM, Fred G wrote:
> Hi--
>
> My current input looks like the following:
>
> FILE1.csv
> PERSON_IDPERSON_NAME
> 1 Jen
> 2 Mike
> 3 Jim
> 4
> 5 Jane
> 6 Joe
> 7
On 09/07/12 02:10, Chris Hare wrote:
Here is what I want to do:
I have a bunch of modules to import. instead of duplicating
> a lot of code for each import, I want to do something like this:
...lots of code stripped
Why not the more usual:
import sys, os, imp, stat,\
re, web
On Mon, Jul 9, 2012 at 6:40 AM, Chris Hare wrote:
>
> Here is what I want to do:
>
> I have a bunch of modules to import. instead of duplicating a lot of code
> for each import, I want to do something like this:
>
> importList = [ "sys", "os", "imp", "stat", "re", "webbrowser", "Image",
> "Strin
Why does this bloody ML want me to respond to the last person instead
of tutor@python.org?
---
On Mon, Jul 9, 2012 at 9:47 AM, Alan Gauld wrote:
> On 09/07/12 02:10, Chris Hare wrote:
>>
>>
>> Here is what I want to do:
>>
>> I have a bunch of modules to import. instead of duplicating
>
>> a lot o
On 09/07/12 10:19, Kwpolska wrote:
Why does this bloody ML want me to respond to the last person instead
of tutor@python.org?
Because that's how it, along with many other mailing lists, works.
If it helps, think of it as you receiving a mail from the sender and CCd
to the list. Therefore hitti
On Mon, Jul 9, 2012 at 3:14 AM, Hugo Arts wrote:
> On Mon, Jul 9, 2012 at 3:10 AM, Gregory Lund wrote:
>>
>> I'm Not looking for an absolute solution, but perhaps some insight
>> into some snippets of code, or
>> suggestions of where I should seek out answers to this issue.
>> Or where I'
Thanks all for the ideas. I wanted to have my own error messages printed for
the user - something a little more meaningful than the standard error.
Thanks for the advice - very helpful!
On Jul 9, 2012, at 6:12 AM, Alan Gauld wrote:
> On 09/07/12 10:19, Kwpolska wrote:
>> Why does this bloody
Might I recommend you use the logging module that is part of core
Python rather than rolling your own if Debug. I found the logging
module made growing my logging across multiple applications so easy!
http://docs.python.org/library/logging.html
On Mon, Jul 9, 2012 at 2:10 PM, Chris Hare wrote:
>
Thank you guys so much. I'm quite close now, but I'm having a bit of
trouble on the final for-loop to create the new dictionary. I have the
following 3 functions (note I'm re-typing it from a different computer so
while the identation will be off here, it is correct in the actual code):
#read in
Traceback (most recent call last):
File "bot.py", line 351, in
mgr.main()
File "/home/bot/bot/ch.py", line 1672, in main
con._feed(data)
File "/home/bot/bot/ch.py", line 628, in _feed
self._process(food.decode("latin-1").rstrip("\r\n")) #numnumz ;3
File "/home/bot/bot/ch.py", l
On Mon, Jul 9, 2012 at 11:31 AM, Keitaro Kaoru wrote:
> Traceback (most recent call last):
> File "bot.py", line 351, in
> mgr.main()
> File "/home/bot/bot/ch.py", line 1672, in main
> con._feed(data)
> File "/home/bot/bot/ch.py", line 628, in _feed
> self._process(food.decode("
Keitaro Kaoru wrote:
[...]
TypeError: not all arguments converted during string formatting
[...]
return self.html % ca
cant seem to find out whats wrong with it
Try experimenting at the interactive interpreter:
[steve@ando ~]$ python
Python 2.6.7 (r267:88850, Mar 10 2012,
So, I have to admit, imports have me really confused. I am trying to break
apart a 10,000+ line single file into various files, one for each class, and
one containing a whole bunch of functions which are used by a lot of classes.
Some of those functions use calls to methods in a Class. Even
On Mon, Jul 9, 2012 at 11:56 AM, Chris Hare wrote:
>
> So, I have to admit, imports have me really confused. I am trying to break
> apart a 10,000+ line single file into various files, one for each class, and
> one containing a whole bunch of functions which are used by a lot of classes.
> So
Hi Chris
> So, I have to admit, imports have me really confused. I am trying to break
> apart a 10,000+ line single file into various files, one for each class, and
> one containing a whole bunch of functions which are used by a lot of classes.
> Some of those functions use calls to methods i
On 09/07/2012 16:56, Chris Hare wrote:
So, I have to admit, imports have me really confused. I am trying to break
apart a 10,000+ line single file into various files, one for each class, and
one containing a whole bunch of functions which are used by a lot of classes.
Some of those function
On Jul 9, 2012, at 12:42 PM, Walter Prins wrote:
> Hi Chris
>
>> So, I have to admit, imports have me really confused. I am trying to break
>> apart a 10,000+ line single file into various files, one for each class, and
>> one containing a whole bunch of functions which are used by a lot of
* Chris Hare [2012-07-09 13:33]:
> import functions
> import os
> import db
>
> when everything was all in one file, that worked just fine. Now, with it all
> split up, once I changed
>
> r = DbPath()
>
> to
>
> r = functions.DbPath()
>
> things seems to work now. I hope this is it!!!
>
Got it! Thanks guys for all your help--what a satisfying feeling! Just out
of curiosity, in the following:
def new_dict (csv_to_dict, nested_line):
old_dict = csv_to_dict(file1)
old_list = nested_line(file2)
new_dict = {}
#for item in old_list:
#new_dict[item] = item
f
Sorry, just got that as well. It was the placement of the if-statement in
the nested for-loop. so v was stuck on 3...thanks again for the help with
this!!!
On Mon, Jul 9, 2012 at 1:57 PM, Fred G wrote:
> Got it! Thanks guys for all your help--what a satisfying feeling! Just
> out of curiosity
hey guys
I want to know whether it is possible for dynamically update the step
size in xrange or someother slick way.
Here is what I am trying to do, if during a loop I find the x in list
I want to skip next #n iterations.
for x in xrange(start,stop,step):
if x in list:
step = 14
On Mon, Jul 9, 2012 at 11:59 PM, Abhishek Pratap wrote:
> hey guys
>
> I want to know whether it is possible for dynamically update the step
> size in xrange or someother slick way.
>
> Here is what I am trying to do, if during a loop I find the x in list
> I want to skip next #n iterations.
>
>
On 07/09/2012 11:56 AM, Chris Hare wrote:
> So, I have to admit, imports have me really confused. I am trying to break
> apart a 10,000+ line single file into various files, one for each class, and
> one containing a whole bunch of functions which are used by a lot of classes.
> Some of those
Ok thanks Hugo. I have the while loop working
-A
On Mon, Jul 9, 2012 at 3:06 PM, Hugo Arts wrote:
> On Mon, Jul 9, 2012 at 11:59 PM, Abhishek Pratap
> wrote:
>>
>> hey guys
>>
>> I want to know whether it is possible for dynamically update the step
>> size in xrange or someother slick way.
>>
Good advice - thanks for that. And I think you're right - I think what is
happening is in fact a bunch of circular references. As I resolve issues, I
will be looking for those! Appreciate all the advice!
On Jul 9, 2012, at 5:16 PM, Dave Angel wrote:
> On 07/09/2012 11:56 AM, Chris Hare wrote
Mark Lawrence wrote:
On 09/07/2012 16:56, Chris Hare wrote:
So, I have to admit, imports have me really confused. I am trying to
break apart a 10,000+ line single file into various files
Please don't break the file up for the sake of doing it, you're writing
python not java :-)
Agreed, b
While you can't do it with a straight generator, you can create your own:
class MyIter:
def __init__(self, start, stop, step=1):
self.start = start
self.stop = stop
self.step = step
def __iter__(self):
self.cur = self.start
while self.cur < self.sto
29 matches
Mail list logo