code logs -> 2006 -> Wed, 02 Aug 2006< code.20060801.log - code.20060803.log >
--- Log opened Wed Aug 02 00:00:01 2006
00:26 MahalWalk is now known as Mahal
00:33 EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has quit [Ping Timeout]
00:34 EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has joined #code
02:59 Chalcedon [~Chalceon@60.234.221.ns-21239] has quit [Quit: ]
03:00 Chalcedon [~Chalceon@60.234.221.ns-21239] has joined #code
03:00 mode/#code [+o Chalcedon] by ChanServ
03:09 Chalcy [~Chalceon@60.234.221.ns-21239] has joined #code
03:09 mode/#code [+o Chalcy] by ChanServ
03:10 Chalcedon [~Chalceon@60.234.221.ns-21239] has quit [Ping Timeout]
05:02 Chalcedon [~Chalceon@60.234.221.ns-21239] has joined #code
05:02 mode/#code [+o Chalcedon] by ChanServ
05:03 Chalcy [~Chalceon@60.234.221.ns-21239] has quit [Ping Timeout]
05:22 Chalcy [~Chalceon@60.234.221.ns-21239] has joined #code
05:22 mode/#code [+o Chalcy] by ChanServ
05:24 Chalcedon [~Chalceon@60.234.221.ns-21239] has quit [Ping Timeout]
05:32 Syloq [Syloq@NetAdmin.Nightstar.Net] has quit [Quit: ]
06:01 You're now known as TheWatcher
06:45 Chalcy is now known as Chalcedon
07:37 MahalWork [~Mahal@Nightstar-12512.worldnet.co.nz] has quit [Ping Timeout]
07:42 MahalWork [~Mahal@Nightstar-12512.worldnet.co.nz] has joined #Code
07:42 mode/#code [+o MahalWork] by ChanServ
07:44 EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has quit [Client exited]
09:42 You're now known as TheWatcher[wr0k]
10:57 * Chalcedon has a query
10:58
<@Mahal>
Yes?
10:58
<@Chalcedon>
anyone got any suggestions as to why Python might not be recognising the function randint() after the random module has been imported?
10:58
<@Mahal>
Not me.
10:58
<@Chalcedon>
(other than I've used it wrong which I'm currently trying to figure out whether or not I've done)
10:58
<@Chalcedon>
yeah, sorry Mahal :)
10:59 * TheWatcher[wr0k] dredges up his python experience
11:00
<@TheWatcher[wr0k]>
randint is deprecated, what happens if you replace it with randrange(lower, upper + 1)?
11:00
<@TheWatcher[wr0k]>
(well, it /was/ deprecated, it might have been removed by now)
11:02
<@Chalcedon>
I get the same error (NameError: global name 'randint' [or randrange] not defined)
11:03
< ReivOw>
...Does python require library imports?
11:04
<@TheWatcher[wr0k]>
yes
11:04
<@Chalcedon>
yes ReivOw, and I've imported the correct module
11:04
<@TheWatcher[wr0k]>
from random import *
11:04
<@TheWatcher[wr0k]>
for example
11:04
<@Chalcedon>
I thought the import function was: import [module name]?
11:04
<@Chalcedon>
this could be my problem?
11:05
<@TheWatcher[wr0k]>
.. actually, sorry, language overlap
11:05
<@TheWatcher[wr0k]>
I think
11:05 * TheWatcher[wr0k] checks
11:06
<@TheWatcher[wr0k]>
you can either do
11:06
<@TheWatcher[wr0k]>
import random.randint
11:06
<@TheWatcher[wr0k]>
or
11:06
<@TheWatcher[wr0k]>
from random import *
11:07
<@TheWatcher[wr0k]>
looks like it wasn't langauge overlap after all.
11:07
<@Chalcedon>
what if I want to import the whole module?
11:07
<@TheWatcher[wr0k]>
use the 'from random import *'
11:08
<@Chalcedon>
ah ha!
11:08
<@Chalcedon>
gottit
11:08
<@Chalcedon>
thank you TW!!
11:08
<@Chalcedon>
my examples all have import [module] and I couldn't figure out what I'd done wrong
11:10
<@TheWatcher[wr0k]>
Sorry about the confusion - I tend not to use python much.
11:11
<@Chalcedon>
it wasn't very much confusion
11:12
<@Chalcedon>
now I just need to figure out what else I've done wrong...
11:12 * Chalcedon hates debugging
11:32 * Chalcedon supplies TW with marshmallows and cookies then goes to bed.
11:32
<@Chalcedon>
night all!
11:32
<@TheWatcher[wr0k]>
Night
11:58
<@Mahal>
Nini.
12:18 Mahal is now known as MahalZzz
12:19 ReivOw is now known as ReivZzz
12:20
<@TheWatcher[wr0k]>
Night Reiv, Mahal
12:20 MahalZzz [~Mahal@Nightstar-12512.worldnet.co.nz] has quit [Quit: This computer has gone to sleep]
12:23
< ReivZzz>
(Can you tell it just got late in kiwiland?)
12:23
<@TheWatcher[wr0k]>
Heh :)
12:23
< ReivZzz>
(I didn't, until I realised /Mahal/ was going to bed, so I should too... :p)
12:26 You're now known as theWatcher[afk]
12:26 You're now known as TheWatcher[afk]
12:47 You're now known as TheWatcher
12:47 You're now known as TheWatcher[wr0k]
13:28 EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has joined #code
14:17 MahalWork [~Mahal@Nightstar-12512.worldnet.co.nz] has quit [Ping Timeout]
14:49 Chalcy [~Chalceon@60.234.221.ns-21239] has joined #code
14:49 mode/#code [+o Chalcy] by ChanServ
14:50 Chalcedon [~Chalceon@60.234.221.ns-21239] has quit [Ping Timeout]
14:51
<@ToxicFrog|AFK>
I would think that [[import random.*]] would work as a synonym for [[from random import *]]
14:53
<@TheWatcher[wr0k]>
Dunno, maybe, but I think I've used python about 4 times, so..
14:59 ToxicFrog|AFK is now known as ToxicFrog|W`rkn
16:33 You're now known as TheWatcher
17:14 You're now known as TheWatcher[afk]
18:16 You're now known as TheWatcher
18:37 Dangerous_nick [g4z2s3w8r@Nightstar-13856.187.eunet.yu] has joined #Code
18:38
< Dangerous_nick>
idioti
18:38
< Dangerous_nick>
muni
18:39
< Dangerous_nick>
when you speak serbian all world is understand you
18:39
< Dangerous_nick>
croatia je jbn vgfa
18:40
< Dangerous_nick>
croatia fuck
18:40
< Dangerous_nick>
and bosnia
18:40
< Dangerous_nick>
and slovenia
18:40 * TheWatcher eyes Dangerous_nick
18:40 mode/#code [+b *!*@Nightstar-13856.187.eunet.yu] by ToxicFrog|W`rkn
18:40 Dangerous_nick was kicked from #code by ToxicFrog|W`rkn [ToxicFrog|W`rkn]
18:40
<@ToxicFrog|W`rkn>
Geez, he just never gives up.
18:41
<@ToxicFrog|W`rkn>
You kickban him from one channel and he moves on to the next one in the list.
18:41
<@TheWatcher>
Eugh
18:42
<@TheWatcher>
Some people have way too much time on their hands.
18:45 Syloq [Syloq@NetAdmin.Nightstar.Net] has joined #code
18:47 Chalcy [~Chalceon@60.234.221.ns-21239] has quit [Ping Timeout]
19:30 Chalcy [~Chalceon@60.234.221.ns-21239] has joined #code
19:30 mode/#code [+o Chalcy] by ChanServ
19:53 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has quit [Ping Timeout]
19:53 ToxicFrog|W`rkn [~ToxicFrog@Admin.Nightstar.Net] has quit [Ping Timeout]
19:58 ToxicFrog|W`rkn [~ToxicFrog@Nightstar-2174.cpe.net.cable.rogers.com] has joined #code
20:05 ToxicFrog|W`rkn [~ToxicFrog@Admin.Nightstar.Net] has quit [Quit: TCP stack dicking with me, bbiab]
20:09 ToxicFrog|W`rkn [~ToxicFrog@Nightstar-2174.cpe.net.cable.rogers.com] has joined #code
20:22 EvilDarkLord is now known as EvilAwayLord
21:41 MahalZzz [~Mahal@Nightstar-12919.worldnet.co.nz] has joined #code
21:41 You're now known as TheWatcher[afk]
21:46 MahalZzz is now known as MahalWr0k
21:49 MahalWr0k [~Mahal@Nightstar-12919.worldnet.co.nz] has quit [Quit: This computer has gone to sleep]
22:13 You're now known as TheWatcher
22:32 You're now known as TheWatcher[T-2]
22:35 You're now known as TheWatcher[afk]
22:43 ToxicFrog|W`rkn is now known as ToxicFrog|AFK
23:12 MahalWr0k [~Mahal@Nightstar-12919.worldnet.co.nz] has joined #code
23:14 MahalWork [~Mahal@Nightstar-12919.worldnet.co.nz] has joined #Code
23:14 mode/#code [+o MahalWork] by ChanServ
23:14 MahalWr0k is now known as Mahal
23:14 Chalcy is now known as Chalcedon
23:16 Mahal [~Mahal@Nightstar-12919.worldnet.co.nz] has quit [Quit: Leaving]
23:17 Mahal [~Mahal@Nightstar-12919.worldnet.co.nz] has joined #code
23:17 mode/#code [+o Mahal] by ChanServ
23:36
<@Chalcedon>
new question
23:36
<@Chalcedon>
in python, how do I return a list to empty without restarting the program?
23:38
<@Chalcedon>
perhaps thats a bad way of putting it.
23:39
<@Chalcedon>
function executes, returns a full list, I want to reset the list to empty before executing the function again.
23:39
<@Chalcedon>
(wihtout restarting)
23:40
<@Mahal>
list = void somewhere?
23:43
<@Chalcedon>
well, the list is initially defined as list = []
23:43
<@Chalcedon>
hang on, if I move it....
23:45
<@Chalcedon>
no, that doesn't work.
23:46
<@Chalcedon>
well... I've /partially/ solved the problem
23:46
<@Chalcedon>
I actually have two lists to set to zero.
23:49
<@Chalcedon>
I've got one, but the other just keeps getting longer....
23:54
<@Chalcedon>
list = []
23:55
<@Chalcedon>
define function(), append items to list in function, return list.
23:55
<@Chalcedon>
*function1()
23:56
<@Chalcedon>
def function2(), call function 1, use list, print relevant info.
23:57
<@Chalcedon>
I want to be able to reset the list to [] before using function2 again.
23:58
<@Chalcedon>
if I define it at the top of either of the two functions it always returns an empty list
23:59
<@Chalcedon>
and I'm having difficulty figuring out where on earth to put it.
--- Log closed Thu Aug 03 00:00:01 2006
code logs -> 2006 -> Wed, 02 Aug 2006< code.20060801.log - code.20060803.log >