IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-10-24 20:19:38
Channels: 41
Logged Lines: 6230436
Size: 1991.11 MB
Powered by
Channel Info
Network: freenodeChannel: #python |
Search in www.irclog.org
Log from #python at freenode 2006-05-31
[02:56]<jnzu2>andrejkw: alternatively, using the stdlib optparse module.
[02:57]<sdyvxa>optparse rocks
[02:57]<zgmznacw>Jerub: which one is better?
[02:57]<jnzu2>andrejkw: the first is for getting a list of args.
[02:57]<zgmznacw>Jerub: I just want the value of the first argument
[02:57]<jnzu2>andrejkw: the second is for doing stuff like --verbose and --without-crashing flags
[02:57]<jnzu2>sys.argv[1]
[02:57]<jnzu2>:)
[02:57]<zgmznacw>Jerub: ok thx
[02:58]<jnzu2>(I always use optparse these days, because it gives me --help for free)
[02:58]<xrwcyrr>I have a problem with changing directories.. I do os.system("cd ..") and it returns zero then I do os.getcwd() but it still shows the same directory not the upper one
[02:59]<zgmznacw>Which Linux IDE would you recommend for Python. I don't really like IDLE, because it randomly locks up?
[02:59]<sdyvxa>Jerub: what i'm asking is how i can pull the text from within the except block?
[02:59]<jnzu2>hawking: that's because os.system works by doing an os.fork(), os.execlv('sh', args)
[02:59]<jnzu2>hawking: the net result is, you spawn a new process that changes directory and exits.
[02:59]<jnzu2>not affecting the parent process at all.
[02:59]<jnzu2>hawking: maybe you should consider using os.chdir()
[02:59]<xrwcyrr>yeah
[02:59]<xrwcyrr>os.chdir() works
[02:59]<sdyvxa>hawking: very similar to executing a cd in a subshell in bash
[02:59]<xrwcyrr>thanks
[03:00]<jnzu2>andrejkw: I use vim.
[03:00]<xrwcyrr>yes I see
[03:00]<zgmznacw>Jerub: I am thinking of something n00b friendly :P
[03:00]<fjffrc>andrejkw, I use jedit
[03:00]<zgmznacw>jerub: with lots lots of buttons
[03:00]<zgmznacw>Is jedit good?
[03:01]<fjffrc>andrejkw, it's not really an ide, more just an editor w/ syntax highlighting. But it gets the job done, and works well under any java capable platform
[03:01]<fjffrc>andrejkw, has other good features like built in ftp/sftp for reading/writing remote files etc
[03:02]<zgmznacw>Ok, thanks, I'll chekc it out
[03:05]<zgmznacw>Jerub: when the first argument is empty, the scritp fails. How can I fix that?
[03:07]<jnzu2>andrejkw: if len(sys.argv) < 2: raise ValueError, "GIVE ME AN ARGUMENT YOU SILLY SAUSAGE"
[03:07]<jnzu2>or something
[03:08]<zgmznacw>Is there a Python compiler or Exevutable packer?
[03:08]<zgmznacw>*Executable
[03:10]<mnfvr2>the latter, yes
[03:10]<mnfvr2>py2exe
[03:10]<sfudrrfd>THE ALIENS ARE WITH YOU ALWAYS
[03:10]<zgmznacw>For windows tho
[03:10]<mnfvr2>py2exe
[03:10]<zgmznacw>Oops
[03:11]<zgmznacw>I meant for Linux
[03:11]<zgmznacw>lol
[03:11]<sfudrrfd>Py2App?
[03:11]<sfudrrfd>oh, linux
[03:11]<zgmznacw>That's oS X
[03:11]<jnzu2>a .deb or .rpm
[03:11]<jnzu2>anything else is a stupid idea.
[03:11]<zgmznacw>I am talking about a single executable
[03:12]<jnzu2>yep.,
[03:12]<jnzu2>that's a .py file that's chmod +x under linux :)
[03:14]<zgmznacw>Jerub: :\
[03:14]<zgmznacw>Jerub: what if I want to hide my source code?
[03:19]<sfudrrfd>the python philosophy vehemently disagrees with closed-source
[03:20]<sfudrrfd>unless its a commercial product
[03:21]<jnzu2>andrejkw: what if I want to read your source? what if I want to fix your bug?
[03:21]<jnzu2>andrejkw: what possible reason do you have for stopping me from doing that?
[03:22]<zgmznacw>Jerub: privacy :p
[03:22]<jnzu2>andrejkw: you have none.
[03:22]<zgmznacw>How come?
[03:24]<ajmnz_t>hi! i want to write a parser using python. (wanna parse excel-formulas) what module is recommended to use? my background is c++ (using the great boost::spirit for parsing)
[03:27]<zgmznacw>How do I terminate a python application?
[03:27]<mzzczzggg>I read over a spec for a spreadsheet parser for gnumeric earlier today, I don't know if it's been implemented yet...
[03:27]<zgmznacw>oh nvm
[03:27]<zgmznacw>found out
[03:31]<dycnzj2y>Are python floats the same size on all platforms?
[03:32]<zgmznacw>Is there any equvalent to Perl system() ?
[03:32]<zgmznacw>*equivalent
[03:33]<dycnzj2y>andrejkw: assuming it just launches a program in a subproccess then os.system
[03:34]<zgmznacw>mikerobi: can I fetch the output into a variable?
[03:34]<syfjrjg>python rooms dead
[03:34]<dycnzj2y>andrejkw: by output do you men the program exit, code, or standard output
[03:35]<zgmznacw>mikerobi: what the program returns
[03:36]<dycnzj2y>andrejkw: look at the documentation for the os module and the popen2 module
[03:36]<syfjrjg>go Sabres
[03:36]<mnfvr2>I recommend you use the subprocess module instead
[03:37]<mnfvr2>the os and popen2 functions are incomplete and inconsistent
[03:37]<dycnzj2y>are floats the same size on all platforms?
[03:37]<syfjrjg>so is python good for games ?
[03:38]<dycnzj2y>Silogon: simple ones
[03:38]<mnfvr2>mikerobi: no
[03:38]<azvydus>Silogon: There's pygame. I'm currently using it for a text-based game.
[03:38]<azvydus>Silogon: That was supposed to be two seperate thoughts...
[03:38]<mnfvr2>mikerobi: http://docs.python.org/ref/types.html
[03:38]<dycnzj2y>deltab: is there a way to find size on my system?
[03:38]<mnfvr2>mikerobi: struct.calcsize
[03:38]<jfyvnzl>After i've ran an regexp = re.search(....), can I somehow count the results from that search?
[03:38]<syfjrjg>is the language fast enough for 3d stuffs ?
[03:39]<azvydus>Silogon: A lot of games write the engine in C++ and use Python for scripts.
[03:39]<dycnzj2y>Silogon: it is not fast enough for some 2d stuff
[03:40]<syfjrjg>script kiddies ?
[03:40]<syfjrjg>me says bye bye python
[03:41]<dycnzj2y>you can always use c++ and use python for scripting
[03:41]<syfjrjg>you i hate having to take a dump and not wanting to get up
[03:41]<syfjrjg>:(\
[03:41]<syfjrjg>i am lazy
[03:42]<syfjrjg>sue me
[03:42]<jnzu2>done.
[03:44]<zgmznacw>Using python, how would I remove all " from a string?







