User Profile

Collapse

Profile Sidebar

Collapse
pmstel
pmstel
Last Activity: Jun 19 '08, 03:05 PM
Joined: Aug 9 '07
Location: Ste-Therese ( Canada)
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • pmstel
    replied to Hard time with dictionnary
    bvdet,

    I tried out what you have post and fully understand of what is going on and it makes sense. We use the same detailing software. If I do not use globals().updat e( my_dictionnary ), it won't work at all. I need to do it manually ===> var_name = dd['var_name']. I would like to avoid doing this. If I use globals().updat e( my_dictionnary) , then it works partially.



    1. I read a text file that actually...
    See more | Go to post

    Leave a comment:


  • pmstel
    replied to Hard time with dictionnary
    Either if I just do it like mention above, I have just find out the I must previously do the globals().updat e( sketch_dict ) before doing all the global stuff. Otherwise it still do not work.

    Any shortcut to simplify this will be appreciated. Thanks!...
    See more | Go to post

    Leave a comment:


  • pmstel
    replied to Hard time with dictionnary
    I have tried that before you submit the solution but for some reason that I cannot understand, some variable are not updated. When I run this piece of code to see if it's getting read by another function that I have written, I can print the variable name and his value.

    Code:
     
    for it in sketch_dict:
    	if it == "poker_game":
    		print "\n\nFound variable " + it + " and it is equal to " + sketch_dict[
    ...
    See more | Go to post
    Last edited by pmstel; May 15 '08, 10:35 AM. Reason: missing description of problem

    Leave a comment:


  • pmstel
    started a topic Hard time with dictionnary

    Hard time with dictionnary

    I have a dictionnary with variable in it that I would like to get it in global variable.


    example:

    Code:
    sketch_dict = { "width":48.0, "length":12.5, "thk":0.75 }
    for it in sketch_dict:
        if string.split( it, "__" )[0] == "":
            pass
        else:
            global it
            print it," = ",sketch_dict[ it ]
    ...
    See more | Go to post

  • pmstel
    replied to Compile the current file
    I finally found compielall. So in the option to set the shortcut that I mention on a previous post I have just entered the following:

    Code:
    import compileall;compileall.compile_dir('c:\\my_python_dir\\dev_dir')
    This will compile all py file within the current directory specified inside the command ans all sub directory. Not to bad ;)

    I still look to compile the last saved py file but at least I have a temporary...
    See more | Go to post

    Leave a comment:


  • pmstel
    replied to Compile the current file
    I'm going back and forth in different module that I have built to add new function in it or create new one or just create a new module with new function. Those modules and function can't run stand alone in Python, they work with a specific detailing software.

    So having 5 or 6 different module open, when I use save as, I need to compile them before publishing it in our detailing software database. So trying to get a shortcut to compile...
    See more | Go to post

    Leave a comment:


  • pmstel
    replied to Compile the current file
    That works good except for one little thing. When I do the compile manually in interactive window of PythonWin, it will compile only the current last save as file. Let say I have "test_A.py" and "test_B.py" open. If I do a save as of test_B.py then I do py_compile.comp ile("test_B.py" ) I will get my pyc file. If I do right away py_compile.comp ile("test_A.py" ), it will not work until I do a save as of "test_A.py"...
    See more | Go to post

    Leave a comment:


  • pmstel
    replied to Compile the current file
    OK I need to admit it, I was not clear.

    1st - I have python 2.3.5 where I added Python Win #208

    In the ineractive windows of PythonWin, like any other version, you type:

    import py_compile
    py_compile.comp ile( "your_script.py " )

    Saying that, this command will create your pyc file.

    Now, under pull-down menu "View" clicking Option then going on tab "Tools...
    See more | Go to post

    Leave a comment:


  • pmstel
    started a topic Compile the current file

    Compile the current file

    How can I compile to a .pyc the current file by putting the command in the tool menu of Python??
    See more | Go to post
No activity results to display
Show More
Working...