A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • 5 years ago

Hi, I have a question: I've just done ps5, and I want to run it just by double clicking the file from window explorer, but somehow it doesn't work - it doesn't seem to recognize the the file words.txt (IDLE works fine)

  • This Question is Closed
  1. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    yaa same with me. no output is seen, infact for any problem.

  2. carlsmith
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I don't personally use Windows much, but I'm thinking that your problem maybe that, because the application, I assume, has no graphics, it doesn't open a new window, it is working, but in the background. With a text based application, you need a terminal, erm, a command line, texty, input/output thingy, to see the output from your app. Sorry, I maybe way off base, I'm not sure off hand what ps5 is, but that might be the problem?

  3. carlsmith
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    P.S. Are you sure you want the file `words.txt` to have a .txt extension? You probably do, I don't know the problem, but Python files need a .py extension, `text.py`. If you still stuck, I'd be happy to look at ps5 and see if I can help, just let me know.

  4. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    when i try to double on ps5.py( windows) it opens up a dos shell and starts the game... seems to work fine, is your wordlist in the same directory as the py file?

  5. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    yea...I'm using python 3.2 atm though - dunno if this is the problem... it doesn't seem to recognize any input from me (though it works totally fine in IDLE) u wanna try opening mine?

  6. carlsmith
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Note: In Python3, you do user_in = input('some prompt: ') In Python 2, you do user_in = raw_input('some prompt: ') This course uses Python2, so you'll find things like floor division, the print function/statement and the input/raw_input function a bit different from what you do in Python3.

  7. carlsmith
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I'm happy to look at your code if you want to post a copy of it or a link to a gist.github page.

  8. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    thanks Carl, I do notice the difference :) it doesn't seem to recognize my input if i'm not in idle >< for example lets say this code: while True: cmd = input("Enter i for the rules, n for new game, or . to exit ") if cmd == '.': break else: print('invalid') if i input ., or whatever, it will give me 'invalid'... ive attached my file

    1 Attachment
  9. carlsmith
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I've just ran cmd = input('please type a dot then enter: ) if cmd == '.': print 'eggs and spam' and it works fine from the command line, I'm on Linux and my Python3 interpreter is Python3.1, but this should make no difference. I don't know what to say. When you run the script from the command line, try being more explicit by doing python3.2 /some/path/name/ps5_ghost.py

  10. carlsmith
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Let me know how you get on.

  11. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    if it is on a Windows OS, you would probably use back slashes instead of the forward slash... c:\path\filename etc...

  12. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    also for the system to find the "." you have to setup the environment variable, for the system to find the current directory. it depends which OS u are using, to configure it accordingly....

  13. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    ClaPik, u may not be able to do what u want to do, "clicking from explorer and running the program". I say that because even with say Windows Visual Studio program. There are two distant areas to create programs. Within the GUI, and at the command line. even after the command line program is complied, if u click it in explorer, and the code isn't within the the program to enable it to pause somehow, it will just "blink" and it's gone. meaning it ran, but u can see it, because it is not complied to run in the GUI.

  14. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    ***correction: two **distinct, different areas to create programs... GUI vs command line....

  15. carlsmith
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Nice one et. I was trying to help, but don't really get Windows. Just one thing, is it not C:\\Docs\ I always remember having to do a double slash after the drive name, kinda like with URLs http://www I'm so glad I use Linux python ~/scripts/file.py

  16. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    whenever u use a drive letter, with one back slash, like, " c:\" it represents the root of the drive letter. Double back slashes, are used for networking, without the letter included. \\sharefolder you can access the actual share document by typing: \\sharefolder\sharedocument with the GUI like in Linux these days, you can do the same thing by clicking on, check boxes, radio buttons, and following the instructions, etc... of it's always good to know what's going on behind the scenes. Of course u have to have the rights and permissions to access it, and perform the actions.

  17. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    then again, even triple slashes are used within the address bar of Internet browsers, IExplorer, Firefox, etc.., to access locations on a computer locally, (file:///C:/MIT ) but not in the Windows Explorer, like i was explaining before. I forgot of forget the actually syntax at the moment, but if you just open a file on your computer you'll see in the address bar various slashes.

  18. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    i was saying i forgot, but then decided to give the example above, by copying and pasting part of an actual example, so disregard me saying i forgot or forget, because i gave the example above: file:///C:/MIT

  19. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    http://en.wikipedia.org/wiki/File_URI_scheme The file URI scheme is a URI scheme specified in RFC 1630 and RFC 1738, typically used to retrieve files from within one's own computer.

  20. carlsmith
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Very interesting stuff. I'm still glad I don't use Windows day to day. Mind you, I'll be working somewhere that does in a couple of weeks time so I may come here and rack your brains a bit et. If that's ok.

  21. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    lol sure sometimes it's good to bring back old memories, :D

  22. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    ClaPik - have you got it to work yet?? I have the pyhon install directory in my PATH environment variable - maybe you need to do that. How to set the path in Windows 2000 / Windows XP. - http://www.computerhope.com/issues/ch000549.htm that pretty much worked for Windows 7 Starter too.

  23. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    hey sorry sth was wrong with the notification i couldnt see any and it turned out to be a lot btw it doesnt work Anyway, it doesn't matter too much though... Just another question, is it possible to make an exe file from python 3.2?

  24. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.