Search:

Type: Posts; User: WW; Keyword(s):

Page 1 of 10 1 2 3 4

Search: Search took 0.05 seconds.

  1. Replies
    13
    Views
    926

    Re: need a language for a simple task

    Based on your description of the problem, it appears to me that none of the solutions presented so far are correct. They all assume that the x coordinate of the corresponding points in the two lists...
  2. Replies
    3
    Views
    303

    Re: how to compile these Fortran subroutines???

    They are warnings, not errors. I got the same warnings when I compiled chebexc.f with gfortran, but it still created the object file chebexc.o.

    Try covering your eyes and ears and loudly singing...
  3. Re: 3d plots (of scientific data), like GNUplot, but interactive

    You could also check out mayavi (gallery).
  4. Replies
    4
    Views
    2,618

    Re: Importing c++ into python

    Check out the subprocess module. The simplest version is probably the call() function. Here's a quick demonstration:


    $ ls
    hello.cpp
    $ g++ hello.cpp -o hello
    $ ./hello
    Hello World
    $ python...
  5. Replies
    3
    Views
    24,082

    Re: Removing Double Quotation From Python String

    In Python, strings are immutable--you can't modify them in-place. The strip() and replace() methods don't modify the string, but instead return a new string. So you'll have to make your changes the...
  6. Replies
    4
    Views
    438

    Re: REALLY basic python question

    raw_input() reads characters into a string. The optional prompt argument is printed first before reading the characters.

    input() is equivalent to eval(raw_input()). In other words, it reads the...
  7. Replies
    4
    Views
    438

    Re: REALLY basic python question

    Put quotes around a literal string, and don't forget the colon:


    if nuke == "y":

    Also, for inputting a string, use raw_input instead of input.


    from time import sleep
  8. Replies
    3
    Views
    308

    Re: List files in folder

    If I understand what you want, you could use either find or tree.


    find midori-0.1.5

    or


    tree midori-0.1.5 -f -i --noreport
  9. Replies
    2
    Views
    2,123

    Re: help with boxplots in pylab

    boxplot() returns a dictionary. The keys correspond to different parts of the boxplot, and the values are lists of Line2D objects. Here is an example that shows how you can manually set the...
  10. Replies
    13
    Views
    9,356

    Re: Running program in Python from Gedit?

    The first double quote is not actually a double quote, it is '\xe2'. Go to line 6 and manually retype the line. You'll probably have to do this for some of the other quote-like characters.

    By...
  11. Re: Bash pushd gives error "No such file or directory"

    No need to "shout". :)

    So I take it we can ignore the problem reported in post #2, since it looks like those are exactly the errors that you would get if you had used ${FILES_PATH}=... instead...
  12. Replies
    5
    Views
    2,639

    Re: Pass arguments to fortran exe with Python

    Expanding on ghostdog74's suggestion to use the subprocess module...

    To simply run a command, you can use the call() method:


    >>> import subprocess
    >>> subprocess.call(['ls','-a'])
    . .. ...
  13. Replies
    6
    Views
    599

    Re: [C] compilation problem

    You have declared the function in callback.c to be 'static', so this function will not be visible outside of callback.c (even if you declare it your header file).
  14. Thread: Learning OpenGL

    by WW
    Replies
    8
    Views
    619

    Re: Learning OpenGL

    The OpenGL tutorials at nehe.gamedev.net are the ones I see recommended most often.

    Edit: Look at that... no response for almost an hour, then three within two minutes. Go figure. :)
  15. Replies
    2
    Views
    437

    Re: Compiler warning - but program works. Why?

    struct timespec is defined in time.h, so you shouldn't redefine it:


    #include <stdio.h>
    #include <time.h>

    int main(void)
    {
    struct timespec ts;
  16. Replies
    2
    Views
    1,786

    Re: Question about python minidom from xml.dom

    The newlines in your XML document become Text nodes in your DOM object:


    In [28]: commandlet.firstChild
    Out[28]:
    <DOM Text node "
    ">

    In [29]: commandlet.firstChild.toxml()
    Out[29]: u'\n'
  17. Thread: mean of a parabola

    by WW
    Replies
    7
    Views
    5,626

    Re: mean of a parabola

    That's right, and in this context, the velocity is generally zero at the boundary, so v(r,\theta) = V_max*(1 - r^2/R^2).
  18. Replies
    6
    Views
    994

    Re: thread-safe conversion from int to char* C

    In plain old C, a 'string' is char*.
  19. Replies
    5
    Views
    430

    Re: C structures and pointers question

    You can pass a pointer to the pointer (and adjust the rest of the code appropriately):


    #include <stdio.h>
    #include <stdlib.h>

    // Define list node structure
    typedef struct struct_node {...
  20. Replies
    5
    Views
    1,332

    Re: Is there a program to alphabetically order words?

    The reason for this post has been fixed, so I'll just make it a big ``Thank You!'' to the tireless moderators.
  21. Replies
    2
    Views
    1,648

    Re: Python curses problem

    Your second version of the call to wrapper, with 'main' as the argument instead of 'main()', is correct, but main() must be defined so that its first argument is the main window 'stdscr' variable. ...
  22. Replies
    5
    Views
    1,332

    Re: Is there a program to alphabetically order words?

    I think the essential part of the previous post is the sort command. Check it out.
  23. Thread: mean of a parabola

    by WW
    Replies
    7
    Views
    5,626

    Re: mean of a parabola

    If your pipe has a circular cross-section, won't you want the mean of a paraboloid, not a parabola? They are not the same.

    Parabola: V_mean = (2/3)*V_max
    Paraboloid: V_mean = (1/2)*V_max
  24. Thread: EOF in Python

    by WW
    Replies
    11
    Views
    88,163

    Re: EOF in Python

    Sorry, I don't understand your question. The code catches the EOFError exception that is raised when ctrl-D is entered. The code in the 'except' block includes a 'break' statement, which exits the...
  25. Thread: EOF in Python

    by WW
    Replies
    11
    Views
    88,163

    Re: EOF in Python

    Reread my post above. :)

    It works with input() as well as raw_input().
Results 1 to 25 of 250
Page 1 of 10 1 2 3 4